Closed Bug 1460049 Opened 2 years ago Closed Last year

remove some unneeded includes in mailnews/

Categories

(MailNews Core :: Backend, enhancement, P5, trivial)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 62.0

People

(Reporter: aceman, Assigned: aceman)

References

Details

(Whiteboard: only check in when nothing else can be checked in and you want to invoke a new build on trunk)

Attachments

(3 files)

+++ This bug was initially created as a clone of Bug #1447498 +++

There are some includes in the /mailnews c++ files (.h, .cpp, .mm) that seem unneeded, the code does not use any identifier from the included file.
I've made a quick script to identify where nsI* objects aren't used in the file, but nsI*.h file is included. Many of them are unneeded.
Cleaning up the needless includes may speed up compiling by a tiny bit ;)

I will attach several patches into this bug that cover the individual code directories under /mailnews.
There is no priority to check them in after review.
Jorg, you can use the patches for check-ins when needed, similar to bug 1399756.
Try run: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=a4f2870dd962722eb603e3a883b5ac9bdac83082
Assignee: nobody → acelists
Status: NEW → ASSIGNED
Attachment #8974160 - Flags: review?(jorgk)
Summary: remove some unneeded includes in /mailnews → remove some unneeded includes in mailnews/
Attachment #8974160 - Flags: review?(jorgk) → review+
Comment on attachment 8974161 [details] [diff] [review]
1460049-imap1.patch [landed comment #7]

Review of attachment 8974161 [details] [diff] [review]:
-----------------------------------------------------------------

::: mailnews/imap/src/nsImapCore.h
@@ +51,5 @@
>  #define kImapMsgFlaggedFlag           0x0004
>  #define kImapMsgDeletedFlag           0x0008
>  #define kImapMsgDraftFlag             0x0010
>  #define kImapMsgRecentFlag            0x0020
> +#define kImapMsgForwardedFlag         0x0040		/* Not always supported, check mailbox folder */

What has changed here?

::: mailnews/imap/src/nsImapProtocol.cpp
@@ +17,5 @@
>  #include "nsIMsgStatusFeedback.h"
>  #include "nsImapCore.h"
>  #include "nsImapProtocol.h"
>  #include "nsIMsgMailNewsUrl.h"
> +#include "nsIIMAPHostSessionList.h"

Already included via nsImapProtocol.h.
(In reply to Jorg K (GMT+1) from comment #3)
> ::: mailnews/imap/src/nsImapCore.h
> > +#define kImapMsgForwardedFlag         0x0040		/* Not always supported, check mailbox folder */
> What has changed here?

Ugly tabs removed. But it seems I still forgot some.

> ::: mailnews/imap/src/nsImapProtocol.cpp
> @@ +17,5 @@
> >  #include "nsIMsgStatusFeedback.h"
> >  #include "nsImapCore.h"
> >  #include "nsImapProtocol.h"
> >  #include "nsIMsgMailNewsUrl.h"
> > +#include "nsIIMAPHostSessionList.h"
> Already included via nsImapProtocol.h.

That's the case for many of the includes. I'm OK if a file uses the interface and includes the header twice (once from .h, once from .cpp). I want to remove includes that aren't used in any way.
Attachment #8974545 - Flags: review?(jorgk) → review+
Attachment #8974161 - Flags: review?(jorgk) → review+
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/08f127811076
remove some unneeded includes from mailnews/extensions. r=jorgk
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/2485443d92eb
remove some unneeded includes from mailnews/imap - part 1. r=jorgk
Attachment #8974160 - Attachment description: 1460049-ext.patch → 1460049-ext.patch [landed comment #6]
Attachment #8974161 - Attachment description: 1460049-imap1.patch → 1460049-imap1.patch [landed comment #7]
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/57c11a2b6db7
remove some unneeded includes from mailnews/imap - part 2. r=jorgk
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 62.0
Attachment #8974545 - Attachment description: 1460049-imap2.patch → 1460049-imap2.patch [landed comment #8]
Keywords: leave-open
Blocks: 1496518
Blocks: 1510571
You need to log in before you can comment on or make changes to this bug.