Bug 333277: null description in helper version info leaves Download Actions blank, patch by Phil Ringnalda <philringnalda@gmail.com>, r=mscott

This commit is contained in:
gavin%gavinsharp.com 2006-08-06 20:34:15 +00:00
Родитель f90760d995
Коммит 7c128784ed
1 изменённых файлов: 9 добавлений и 4 удалений

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

@ -249,15 +249,20 @@ var gDownloadActionsWindow = {
_getDisplayNameForFile: function (aFile)
{
#ifdef XP_WIN
if (aFile instanceof Components.interfaces.nsILocalFileWin)
return aFile.getVersionInfoField("FileDescription");
#else
if (aFile instanceof Components.interfaces.nsILocalFileWin) {
try {
return aFile.getVersionInfoField("FileDescription");
}
catch (e) {
// fall through to the filename
}
}
#endif
// XXXben - Read the bundle name on OS X.
var ios = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var url = ios.newFileURI(aFile).QueryInterface(Components.interfaces.nsIURL);
return url.fileName;
#endif
},
_loadMIMERegistryData: function ()