Bug 747601. Only create Info.plist file after webapp icon has been downloaded. r=mstange a=desktop-only.

OSX caches the application info when Info.plist is created and if the icon has not yet been embedded in the .app package, Finder might indefinitely cache a no-icon app
This commit is contained in:
Felipe Gomes 2012-04-22 14:30:03 -07:00
Родитель e658a30e40
Коммит a6a703eabb
2 изменённых файлов: 9 добавлений и 2 удалений

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

@ -105,5 +105,7 @@ function getIconForApp(aShell, callback) {
function onIconDownloaded(aShell, aMimeType, aStatusCode, aIcon, aCallback) {
if (Components.isSuccessCode(aStatusCode)) {
aShell.processIcon(aMimeType, aIcon, aCallback);
} else {
aCallback.call(aShell);
}
}

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

@ -495,7 +495,7 @@ MacNativeApp.prototype = {
throw(ex);
}
getIconForApp(this);
getIconForApp(this, this._createPListFile);
},
_removeInstallation: function(keepProfile) {
@ -561,7 +561,10 @@ MacNativeApp.prototype = {
writer.setString("Webapp", "Name", this.appName);
writer.setString("Webapp", "Profile", this.appProfileDir.leafName);
writer.writeFile();
},
_createPListFile: function() {
// ${InstallDir}/Contents/Info.plist
let infoPListContent = '<?xml version="1.0" encoding="UTF-8"?>\n\
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n\
<plist version="1.0">\n\
@ -616,7 +619,7 @@ MacNativeApp.prototype = {
* @param aCallback a callback function to be called
* after the process finishes
*/
processIcon: function(aMimeType, aIcon) {
processIcon: function(aMimeType, aIcon, aCallback) {
try {
let process = Cc["@mozilla.org/process/util;1"]
.createInstance(Ci.nsIProcess);
@ -633,6 +636,8 @@ MacNativeApp.prototype = {
9);
} catch(e) {
throw(e);
} finally {
aCallback.call(this);
}
}