Remove nsISupportsArray usage from nsIMsgFilterService::applyFiltersToFolders and nsMsgFilterAfterTheFact::nsMsgFilterAfterTheFact

RESOLVED FIXED in Thunderbird 20.0

Status

MailNews Core
Filters
--
trivial
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: aceman, Assigned: aceman)

Tracking

Trunk
Thunderbird 20.0
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

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

Description

4 years ago
I'll try to change the aFolders argument of nsIMsgFilterService::applyFiltersToFolders to nsIArray.
(Assignee)

Comment 1

4 years ago
Created attachment 692779 [details] [diff] [review]
patch
Attachment #692779 - Flags: review?(neil)
(Assignee)

Updated

4 years ago
Status: NEW → ASSIGNED

Comment 2

4 years ago
Comment on attachment 692779 [details] [diff] [review]
patch

>-  nsCOMPtr <nsIMsgWindow>     m_msgWindow;
>-  nsCOMPtr <nsIMsgFilterList> m_filters;
>-  nsCOMPtr <nsISupportsArray> m_folders;
>-  nsCOMPtr <nsIMsgFolder>     m_curFolder;
>-  nsCOMPtr <nsIMsgDatabase>   m_curFolderDB;
>-  nsCOMPtr <nsIMsgFilter>     m_curFilter;
>+  nsCOMPtr<nsIMsgWindow>      m_msgWindow;
>+  nsCOMPtr<nsIMsgFilterList>  m_filters;
>+  nsCOMPtr<nsIArray>          m_folders;
>+  nsCOMPtr<nsIMsgFolder>      m_curFolder;
>+  nsCOMPtr<nsIMsgDatabase>    m_curFolderDB;
>+  nsCOMPtr<nsIMsgFilter>      m_curFilter;
>   uint32_t                    m_curFilterIndex;
>   uint32_t                    m_curFolderIndex;
>   uint32_t                    m_numFilters;
>   uint32_t                    m_numFolders;
>   nsTArray<nsMsgKey>          m_searchHits;
>   nsCOMPtr<nsIMutableArray>   m_searchHitHdrs;
>-  nsCOMPtr <nsIMsgSearchSession> m_searchSession;
>+  nsCOMPtr<nsIMsgSearchSession> m_searchSession;
[I wish you didn't reformat stuff, it makes the real change harder to spot...]

>-nsMsgFilterAfterTheFact::nsMsgFilterAfterTheFact(nsIMsgWindow *aMsgWindow, nsIMsgFilterList *aFilterList, nsISupportsArray *aFolderList)
>+nsMsgFilterAfterTheFact::nsMsgFilterAfterTheFact(nsIMsgWindow *aMsgWindow, nsIMsgFilterList *aFilterList, nsIArray *aFolderList)
> {
>   m_curFilterIndex = m_curFolderIndex = m_nextAction = 0;
>   m_msgWindow = aMsgWindow;
>   m_filters = aFilterList;
>   m_folders = aFolderList;
[Bah, this should so be C++ initialisation...]

>-  nsresult rv = m_folders->QueryElementAt(m_curFolderIndex++, NS_GET_IID(nsIMsgFolder), getter_AddRefs(m_curFolder));
>+  nsresult rv = m_folders->QueryElementAt(m_curFolderIndex++,
>+                                          NS_GET_IID(nsIMsgFolder),
>+                                          getter_AddRefs(m_curFolder));
>   NS_ENSURE_SUCCESS(rv, rv);
>   nsCOMPtr <nsIDBFolderInfo> dbFolderInfo;
>-  rv = m_curFolder->GetDBFolderInfoAndDB(getter_AddRefs(dbFolderInfo), getter_AddRefs(m_curFolderDB));
>+  rv = m_curFolder->GetDBFolderInfoAndDB(getter_AddRefs(dbFolderInfo),
>+                                         getter_AddRefs(m_curFolderDB));
Ironically you reformatted without changing the code. There is a useful change you could have done, but I'm going to have to give you r- now. To get the r+ you can either figure out the improvement you could have made or undo the reformatting. (And fix the typo below of course.)

>+  var folders = Components.classes["@mozilla.org/supports;1"]
>+                          .createInstance(Components.interfaces.nsIMutableArray);
Typo.
Attachment #692779 - Flags: review?(neil) → review-
(Assignee)

Comment 3

4 years ago
(In reply to neil@parkwaycc.co.uk from comment #2)
> >-  nsresult rv = m_folders->QueryElementAt(m_curFolderIndex++, NS_GET_IID(nsIMsgFolder), getter_AddRefs(m_curFolder));
> >+  nsresult rv = m_folders->QueryElementAt(m_curFolderIndex++,
> >+                                          NS_GET_IID(nsIMsgFolder),
> >+                                          getter_AddRefs(m_curFolder));
> >   NS_ENSURE_SUCCESS(rv, rv);
> >   nsCOMPtr <nsIDBFolderInfo> dbFolderInfo;
> >-  rv = m_curFolder->GetDBFolderInfoAndDB(getter_AddRefs(dbFolderInfo), getter_AddRefs(m_curFolderDB));
> >+  rv = m_curFolder->GetDBFolderInfoAndDB(getter_AddRefs(dbFolderInfo),
> >+                                         getter_AddRefs(m_curFolderDB));
> Ironically you reformatted without changing the code. There is a useful
> change you could have done, but I'm going to have to give you r- now. To get
> the r+ you can either figure out the improvement you could have made or undo
> the reformatting. (And fix the typo below of course.)
Does it hide inside the lines I have changed or is it in the lines between? :)

Comment 4

4 years ago
(In reply to aceman from comment #3)
> Does it hide inside the lines I have changed or is it in the lines between?
It's in one of the lines you changed.
(Assignee)

Comment 5

4 years ago
Created attachment 694938 [details] [diff] [review]
patch v2
Attachment #692779 - Attachment is obsolete: true
Attachment #694938 - Flags: review?(neil)

Updated

4 years ago
Attachment #694938 - Flags: review?(neil) → review+
(Assignee)

Updated

4 years ago
Attachment #694938 - Flags: review?(kent)

Updated

4 years ago
Attachment #694938 - Flags: review?(kent) → review+
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/60503161ac00
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 20.0
You need to log in before you can comment on or make changes to this bug.