on Mac OS X, don't ever set creator code and only set type code if the file doesn't have an extension. b=236389 r=smorgan sr=bsmedberg a=mconnor

This commit is contained in:
joshmoz@gmail.com 2007-10-10 08:40:06 -07:00
Родитель df7e2277b7
Коммит 210191891d
1 изменённых файлов: 5 добавлений и 8 удалений

Просмотреть файл

@ -1165,17 +1165,14 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel)
mTempFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0600);
#ifdef XP_MACOSX
// Now that the file exists set Mac type and creator
if (mMimeInfo)
{
// Now that the file exists set Mac type if the file has no extension
// and we can determine a type.
if (ext.IsEmpty() && mMimeInfo) {
nsCOMPtr<nsILocalFileMac> macfile = do_QueryInterface(mTempFile);
if (macfile)
{
PRUint32 type, creator;
if (macfile) {
PRUint32 type;
mMimeInfo->GetMacType(&type);
mMimeInfo->GetMacCreator(&creator);
macfile->SetFileType(type);
macfile->SetFileCreator(creator);
}
}
#endif