Bug 368272: Notify observers upon generator installation, patch by Ryan Flint <ryan@ryanflint.com>, r=myk

This commit is contained in:
philringnalda%gmail.com 2007-02-28 04:33:49 +00:00
parent e1d3a954d4
commit 88e1bc4dc4

View File

@ -465,12 +465,13 @@ MicrosummaryService.prototype = {
// The existing cache entry for this generator, if it is already installed.
var generator = this._localGenerators[generatorID];
var topic;
var file;
if (generator) {
// This generator is already installed. Save it in the existing file
// (i.e. update the existing generator with the newly downloaded XML).
file = generator.localURI.QueryInterface(Ci.nsIFileURL).file.clone();
this._obs.notifyObservers(generator, "microsummary-generator-updated", null);
topic = "microsummary-generator-updated";
}
else {
// This generator is not already installed. Save it as a new file.
@ -482,7 +483,7 @@ MicrosummaryService.prototype = {
generator = new MicrosummaryGenerator();
generator.localURI = this._ios.newFileURI(file);
this._localGenerators[generatorID] = generator;
this._obs.notifyObservers(generator, "microsummary-generator-installed", null);
topic = "microsummary-generator-installed";
}
// Initialize (or reinitialize) the generator from its XML definition,
@ -492,6 +493,8 @@ MicrosummaryService.prototype = {
LOG("installed generator " + generatorID);
this._obs.notifyObservers(generator, topic, null);
return generator;
},