Last Comment Bug 840230 - replace nsISupportsArray variable mailnews/base/src/nsMessenger*Integration.*::mFoldersWithNewMail
: replace nsISupportsArray variable mailnews/base/src/nsMessenger*Integration.*...
Status: RESOLVED FIXED
:
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: All All
: -- minor (vote)
: Thunderbird 22.0
Assigned To: :aceman
:
Mentors:
Depends on:
Blocks: 394167
  Show dependency treegraph
 
Reported: 2013-02-11 13:00 PST by :aceman
Modified: 2013-02-25 06:51 PST (History)
0 users
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch (17.79 KB, patch)
2013-02-11 13:16 PST, :aceman
no flags Details | Diff | Review
patch v2 (18.41 KB, patch)
2013-02-12 11:26 PST, :aceman
neil: review+
Details | Diff | Review

Description :aceman 2013-02-11 13:00:40 PST
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.
Comment 1 :aceman 2013-02-11 13:16:23 PST
Created attachment 712598 [details] [diff] [review]
patch

Manually run tested on linux.
Comment 2 :aceman 2013-02-11 15:48:51 PST
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.
Comment 3 :aceman 2013-02-12 11:26:42 PST
Created attachment 713017 [details] [diff] [review]
patch v2

This could be better.
Comment 5 :aceman 2013-02-13 05:13:58 PST
Comment on attachment 713017 [details] [diff] [review]
patch v2

Seems to work.
Comment 6 neil@parkwaycc.co.uk 2013-02-22 13:41:10 PST
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.
Comment 7 Ryan VanderMeulen [:RyanVM] 2013-02-25 06:51:53 PST
https://hg.mozilla.org/comm-central/rev/092b0c4ef3dd

Note You need to log in before you can comment on or make changes to this bug.