replace nsISupportsArray variable mailnews/base/src/nsMessenger*Integration.*::mFoldersWithNewMail

RESOLVED FIXED in Thunderbird 22.0

Status

MailNews Core
Backend
--
minor
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: aceman, Assigned: aceman)

Tracking

Trunk
Thunderbird 22.0

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

18.41 KB, patch
neil@parkwaycc.co.uk
: review+
Details | Diff | Splinter Review
(Assignee)

Description

5 years ago
Defined as a variable in:

    mailnews/base/src/nsMessengerUnixIntegration.cpp (View Hg log or Hg annotations)
        line 580 -- mFoldersWithNewMail->Count(&count);
        line 692 -- int32_t indexInNewArray = mFoldersWithNewMail->IndexOf(weakFolder);
        line 707 -- mFoldersWithNewMail->AppendElement(weakFolder);
        line 714 -- mFoldersWithNewMail->RemoveElementAt(indexInNewArray); 
    mailnews/base/src/nsMessengerUnixIntegration.h (View Hg log or Hg annotations)
        line 53 -- nsCOMPtr<nsISupportsArray> mFoldersWithNewMail; // keep track of all the root folders with pending new mail 
    mailnews/base/src/nsMessengerWinIntegration.cpp (View Hg log or Hg annotations)
        line 690 -- mFoldersWithNewMail->Count(&count);
        line 773 -- mFoldersWithNewMail->Count(&count);
        line 885 -- int32_t indexInNewArray = mFoldersWithNewMail->IndexOf(weakFolder);
        line 905 -- mFoldersWithNewMail->InsertElementAt(weakFolder, 0);
        line 921 -- mFoldersWithNewMail->RemoveElementAt(indexInNewArray); 
    mailnews/base/src/nsMessengerWinIntegration.h (View Hg log or Hg annotations)
        line 76 -- nsCOMPtr<nsISupportsArray> mFoldersWithNewMail; // keep track of all the root folders with pending new mail 

Referenced (in 2 files total) in:

    mailnews/base/src/nsMessengerUnixIntegration.cpp (View Hg log or Hg annotations)
        line 107 -- NS_NewISupportsArray(getter_AddRefs(mFoldersWithNewMail));
        line 403 -- ifptr->SetData(mFoldersWithNewMail);
        line 467 -- if (NS_FAILED(mFoldersWithNewMail->Count(&count)))
        line 477 -- weakReference = do_QueryElementAt(mFoldersWithNewMail, i);
        line 574 -- NS_ENSURE_TRUE(mFoldersWithNewMail, NS_ERROR_FAILURE);
        line 588 -- weakReference = do_QueryElementAt(mFoldersWithNewMail, i);
        line 689 -- if (mBiffStateAtom == aProperty && mFoldersWithNewMail) 
    mailnews/base/src/nsMessengerWinIntegration.cpp (View Hg log or Hg annotations)
        line 259 -- NS_NewISupportsArray(getter_AddRefs(mFoldersWithNewMail));
        line 504 -- ifptr->SetData(mFoldersWithNewMail);
        line 694 -- weakReference = do_QueryElementAt(mFoldersWithNewMail, index);
        line 766 -- NS_ENSURE_TRUE(mFoldersWithNewMail, NS_ERROR_FAILURE);
        line 778 -- weakReference = do_QueryElementAt(mFoldersWithNewMail, 0);
        line 882 -- if (mBiffStateAtom == aProperty && mFoldersWithNewMail) 

I have chosen nsIMutableArray for the replacement array because it is passed to a xul dialog and it's JS processing. But maybe there is a better way.
(Assignee)

Comment 1

5 years ago
Created attachment 712598 [details] [diff] [review]
patch

Manually run tested on linux.
Attachment #712598 - Flags: review?(neil)
(Assignee)

Comment 2

5 years ago
Comment on attachment 712598 [details] [diff] [review]
patch

Compilation fails on Windows:
https://tbpl.mozilla.org/?tree=Thunderbird-Try&rev=031da2ae1103

Will make a new version.
Attachment #712598 - Flags: review?(neil)
(Assignee)

Comment 3

5 years ago
Created attachment 713017 [details] [diff] [review]
patch v2

This could be better.
Attachment #712598 - Attachment is obsolete: true
(Assignee)

Comment 4

5 years ago
Try build:
https://tbpl.mozilla.org/?tree=Thunderbird-Try&rev=d183b9471c39
(Assignee)

Comment 5

5 years ago
Comment on attachment 713017 [details] [diff] [review]
patch v2

Seems to work.
Attachment #713017 - Flags: review?(neil)

Comment 6

5 years ago
Comment on attachment 713017 [details] [diff] [review]
patch v2

I couldn't seem to get the new mail alert to open either with or without the patch, so maybe there's something else wrong with my build, but I was able to manually trigger the balloon and icon tooltip with the patch applied, so that's something.
Attachment #713017 - Flags: review?(neil) → review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/092b0c4ef3dd
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 22.0
You need to log in before you can comment on or make changes to this bug.