Bug 812119 - [HOMESCREEN] Must reboot after deleting an app to see its icon disappear from homescreen. r=fabrice. a=blocking-basecamp

This commit is contained in:
Vivien Nicolas 2012-12-03 23:46:57 +01:00
parent 2112386f54
commit 7723a604fc
2 changed files with 10 additions and 3 deletions

View File

@ -744,8 +744,12 @@ WebappsApplicationMgmt.prototype = {
break;
case "Webapps:Uninstall:Return:OK":
if (this._onuninstall) {
let detail = {
manifestURL: msg.manifestURL,
origin: msg.origin
};
let event = new this._window.MozApplicationEvent("applicationuninstall",
{ application : createApplicationObject(this._window, { origin: msg.origin }) });
{ application : createApplicationObject(this._window, detail) });
this._onuninstall.handleEvent(event);
}
break;

View File

@ -1538,7 +1538,7 @@ this.DOMApplicationRegistry = {
continue;
}
if (!this.webapps[id].removable)
if (!app.removable)
return;
// Clean up the deprecated manifest cache if needed.
@ -1569,6 +1569,7 @@ this.DOMApplicationRegistry = {
delete this.webapps[id];
this._saveApps((function() {
aData.manifestURL = app.manifestURL;
this.broadcastMessage("Webapps:Uninstall:Return:OK", aData);
Services.obs.notifyObservers(this, "webapps-sync-uninstall", appNote);
this.broadcastMessage("Webapps:RemoveApp", { id: id });
@ -1768,13 +1769,15 @@ this.DOMApplicationRegistry = {
}
let origin = this.webapps[record.id].origin;
let manifestURL = this.webapps[record.id].manifestURL;
delete this.webapps[record.id];
let dir = this._getAppDir(record.id);
try {
dir.remove(true);
} catch (e) {
}
this.broadcastMessage("Webapps:Uninstall:Return:OK", { origin: origin });
this.broadcastMessage("Webapps:Uninstall:Return:OK", { origin: origin,
manifestURL: manifestURL });
} else {
if (this.webapps[record.id]) {
this.webapps[record.id] = record.value;