Bug 368272: Notify observers upon generator installation, patch by Ryan Flint <ryan@ryanflint.com>, r=myk
git-svn-id: svn://10.0.0.236/trunk@221062 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
c76f1731b0
commit
92d0ba5fa4
@ -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;
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user