mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 308204: null description in helper version info leaves Download Actions blank, patch by Phil Ringnalda <philringnalda@gmail.com>, r=mconnor
This commit is contained in:
parent
938d13e4b9
commit
28977a8df1
@ -283,15 +283,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 ()
|
||||
|
@ -51,14 +51,18 @@
|
||||
<![CDATA[
|
||||
#ifdef XP_WIN
|
||||
var lfw = aFile.QueryInterface(Components.interfaces.nsILocalFileWin);
|
||||
return lfw.getVersionInfoField("FileDescription");
|
||||
#else
|
||||
try {
|
||||
return lfw.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
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
Loading…
Reference in New Issue
Block a user