From 88e1bc4dc4e7c5705b246837b0608295237b2ba1 Mon Sep 17 00:00:00 2001 From: "philringnalda%gmail.com" Date: Wed, 28 Feb 2007 04:33:49 +0000 Subject: [PATCH] Bug 368272: Notify observers upon generator installation, patch by Ryan Flint , r=myk --- .../components/microsummaries/src/nsMicrosummaryService.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/browser/components/microsummaries/src/nsMicrosummaryService.js b/browser/components/microsummaries/src/nsMicrosummaryService.js index 5cc88fe8fdcc..2df62d9acc9c 100644 --- a/browser/components/microsummaries/src/nsMicrosummaryService.js +++ b/browser/components/microsummaries/src/nsMicrosummaryService.js @@ -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; },