Closed
Bug 368272
Opened 18 years ago
Closed 17 years ago
Notify observers upon generator installation
Categories
(Firefox Graveyard :: Microsummaries, defect)
Firefox Graveyard
Microsummaries
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 3 alpha1
People
(Reporter: rflint, Assigned: rflint)
Details
Attachments
(2 files, 4 obsolete files)
1.42 KB,
patch
|
Details | Diff | Splinter Review | |
2.36 KB,
patch
|
myk
:
review+
|
Details | Diff | Splinter Review |
In the same spirit of bug 368252, it would be great if notifications of generator installs were broadcast to observers. This patch adds a "generator-installed" topic with the new generator as the subject and its file name (might be better as a file URI?) as the data. We might also want a "generator-updated" topic to cover updates and generators installed via reinstallMissingGenerator().
Attachment #252876 -
Flags: review?(myk)
Comment 1•18 years ago
|
||
Comment on attachment 252876 [details] [diff] [review] Possible patch > In the same spirit of bug 368252, it would be great if notifications > of generator installs were broadcast to observers. Hmm, indeed, this does seem like it could be useful. Does this make it easier to code something in the Microsummary Manager extension, or did you have another purpose in mind? > This patch adds a "generator-installed" topic I think it would make sense to prefix microsummary-related topics with the string "microsummary" to distinguish them from other notifications, so this should be "microsummary-generator-installed". > with the new generator as the subject and its file name > (might be better as a file URI?) as the data. The generator stores its file's URI in its localURI property. If that would be useful to observers, then we should just expose that property through the nsIMicrosummaryGenerator interface. > We might also want a "generator-updated" topic to cover updates and > generators installed via reinstallMissingGenerator(). Right, good point.
Comment 2•18 years ago
|
||
Comment on attachment 252876 [details] [diff] [review] Possible patch r- pending resolution of issues raised in previous comment. Looking forward to the next patch!
Attachment #252876 -
Flags: review?(myk) → review-
Assignee | ||
Comment 3•18 years ago
|
||
>Does this make it easier to code something in the Microsummary Manager extension,
>or did you have another purpose in mind?
Yep, this'll allow me to clean up how the listbox is redrawn when a generator is installed from the add-ons manager and allow me to redraw when a generator's installed via the sidebar or otherwise with the manager open.
This patch adds the additional 'updated' notification and prefixes them both with 'microsummary-'. Generators installed from reinstallMissingGenerator() and user reinstalls/updates will also fire the 'installed' and 'updated' topics respectively.
Attachment #252876 -
Attachment is obsolete: true
Attachment #253851 -
Flags: review?(myk)
Comment 4•17 years ago
|
||
Comment on attachment 253851 [details] [diff] [review] Patch Looks good, just one more thing: instead of passing the file name to observers via the "data" parameters, simply expose the existing "localURI" property of MicrosummaryGenerator objects as a read-only nsIURI attribute of nsIMicrosummaryObserver (bumping the UUID for that interface in the process). Then observers will be able to access that value by QIing generator.localURI to nsIFileURL, getting its "file" attribute, and accessing the file's "leafName" attribute.
Attachment #253851 -
Flags: review?(myk) → review-
Assignee | ||
Comment 5•17 years ago
|
||
Expose the generator's localURI attribute, rev the interface's UUID and pass null via the data param.
Attachment #253851 -
Attachment is obsolete: true
Attachment #254620 -
Flags: review?(myk)
Comment 6•17 years ago
|
||
Comment on attachment 254620 [details] [diff] [review] Patch v2 Looks great, r=myk. Ryan, do you have CVS access, or do you need someone to check this in?
Attachment #254620 -
Flags: review?(myk) → review+
Comment 7•17 years ago
|
||
FWIW, here's a patch for testing this functionality. It just makes the microsummary service observe its own microsummary-generater-installed/updated notifications and log a message to the console when it observes one.
Comment 8•17 years ago
|
||
Patch checked in to the trunk: Checking in public/nsIMicrosummaryService.idl; /cvsroot/mozilla/browser/components/microsummaries/public/nsIMicrosummaryService.idl,v <-- nsIMicrosummaryService.idl new revision: 1.6; previous revision: 1.5 done Checking in src/nsMicrosummaryService.js; /cvsroot/mozilla/browser/components/microsummaries/src/nsMicrosummaryService.js,v <-- nsMicrosummaryService.js new revision: 1.53; previous revision: 1.52 done Thanks for the fix!
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3 alpha1
Assignee | ||
Comment 9•17 years ago
|
||
The previous patch notified observers before the call to _saveGeneratorXML() resulting in a bit of a race condition (doh!). This patch moves the notification to a more appropriate location.
Attachment #254620 -
Attachment is obsolete: true
Attachment #256183 -
Flags: review?(myk)
Assignee | ||
Updated•17 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 10•17 years ago
|
||
Might help to attach the right file...
Attachment #256183 -
Attachment is obsolete: true
Attachment #256184 -
Flags: review?(myk)
Attachment #256183 -
Flags: review?(myk)
Comment 11•17 years ago
|
||
Comment on attachment 256184 [details] [diff] [review] Real patch Yup, this makes sense, and the patch looks good, r=myk
Attachment #256184 -
Flags: review?(myk) → review+
Comment 12•17 years ago
|
||
browser/components/microsummaries/src/nsMicrosummaryService.js 1.56
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Firefox → Firefox Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•