Open Bug 1683590 Opened 3 years ago Updated 2 years ago

Redesign nsIFolderListener to use specific types rather than nsISupports

Categories

(MailNews Core :: General, task)

Tracking

(thunderbird_esr91 wontfix)

ASSIGNED
94 Branch
Tracking Status
thunderbird_esr91 --- wontfix

People

(Reporter: benc, Assigned: benc)

References

(Blocks 1 open bug)

Details

(Keywords: leave-open)

Attachments

(4 files)

nsIFolderListener OnItemAdded() and OnItemRemoved() both pass the subject item as nsISupports*. Looking through the code, it seems it's always either a message (nsIMsgDbHdr) or a folder (nsIMsgFolder), so probably easiest to just split it up into onFolderAdded/onFolderRemoved/onMessageAdded/onMessageRemoved().
And, I guess, lowercase the method names while we're at it?

https://searchfox.org/comm-central/source/mailnews/base/public/nsIFolderListener.idl

Assignee: nobody → benc
Status: NEW → ASSIGNED
Keywords: leave-open

Removes .NotifyItemAdded() and .NotifyItemRemoved() which both used nsISupports
and replaces them with specific folder and nsIMsgDBHdr versions.
Still calls the nsISupports-based nsIFolderListener OnItemAdded/OnItemRemoved()
callbacks but lays the groundwork for doing the same thing there.

Breaks up OnItemAdded() and OnItemRemoved() into folder and message-specific
versions. Also lowercases the callback functions in the .idl while we're here
e.g. OnItemEvent() becomes onItemEvent().

Depends on D126579

Target Milestone: --- → 94 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/1b9c89f7af3b
Remove nsISupport use in nsIMsgFolder.NotifyItemAdded/NotifyItemRemoved. r=mkmelin
https://hg.mozilla.org/comm-central/rev/89021f52292d
Remove nsISupport use in nsIFolderListener.OnItemAdded/Removed callbacks. r=mkmelin

Gaah - I ran tests locally and did a try build and everything!
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=bf25eccea93426b114510be74cffd37f0fb61b5e
But I figured out what I screwed up - I had uncommitted fixes when I did my magic "empty" push to kick of the try run, so the try run included them and it worked (and then my "hg qpop && hg qdelete try" helpfully threw them all away again)...
Sorry about that. Should have done the function renaming in a separate patch.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/c59b95ce556f
Remove nsISupport use in nsIFolderListener.OnItemAdded/Removed callbacks. r=mkmelin

This change seems to be causing an error on tests that create folders. Does not seem to affect the tests completing because its usually triggered in the cleanup function. It does add noise to debugging actual failures though.
https://treeherder.mozilla.org/logviewer?job_id=357745269&repo=comm-central&lineNumber=3458

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/ee483e7bc11c
Follow up - when logging do not assume all folders have a parent. r=mkmelin
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: