Closed Bug 822131 Opened 11 years ago Closed 11 years ago

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

Categories

(MailNews Core :: Filters, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 20.0

People

(Reporter: aceman, Assigned: aceman)

References

()

Details

Attachments

(1 file, 1 obsolete file)

15.76 KB, patch
neil
: review+
rkent
: review+
Details | Diff | Splinter Review
I'll try to change the aFolders argument of nsIMsgFilterService::applyFiltersToFolders to nsIArray.
Attached patch patch (obsolete) — Splinter Review
Attachment #692779 - Flags: review?(neil)
Status: NEW → ASSIGNED
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-
(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? :)
(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.
Attached patch patch v2Splinter Review
Attachment #692779 - Attachment is obsolete: true
Attachment #694938 - Flags: review?(neil)
Attachment #694938 - Flags: review?(neil) → review+
Attachment #694938 - Flags: review?(kent)
Attachment #694938 - Flags: review?(kent) → review+
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/60503161ac00
Status: ASSIGNED → RESOLVED
Closed: 11 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.