Diffstat (limited to 'noncore/net/mail/libmailwrapper/statusmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/statusmail.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/noncore/net/mail/libmailwrapper/statusmail.cpp b/noncore/net/mail/libmailwrapper/statusmail.cpp index 3e1d8d1..9f4c47c 100644 --- a/noncore/net/mail/libmailwrapper/statusmail.cpp +++ b/noncore/net/mail/libmailwrapper/statusmail.cpp | |||
@@ -1,40 +1,38 @@ | |||
1 | #include "statusmail.h" | 1 | #include "statusmail.h" |
2 | #include "mailtypes.h" | ||
3 | #include "abstractmail.h" | ||
4 | #include <qlist.h> | 2 | #include <qlist.h> |
5 | 3 | ||
6 | StatusMail::StatusMail(QList<Account>*list) | 4 | StatusMail::StatusMail(QList<Account>&list) |
7 | { | 5 | { |
8 | currentImapStat.message_count=0; | 6 | currentImapStat.message_count=0; |
9 | currentImapStat.message_unseen=0; | 7 | currentImapStat.message_unseen=0; |
10 | currentImapStat.message_recent=0; | 8 | currentImapStat.message_recent=0; |
11 | lastPop3Stat = currentImapStat; | 9 | lastPop3Stat = currentImapStat; |
12 | currentPop3Stat = currentImapStat; | 10 | currentPop3Stat = currentImapStat; |
13 | connectionList.setAutoDelete(true); | 11 | connectionList.setAutoDelete(true); |
14 | connectionList.clear(); | 12 | connectionList.clear(); |
15 | initAccounts(list); | 13 | initAccounts(list); |
16 | } | 14 | } |
17 | 15 | ||
18 | StatusMail::~StatusMail() | 16 | StatusMail::~StatusMail() |
19 | { | 17 | { |
20 | } | 18 | } |
21 | 19 | ||
22 | void StatusMail::initAccounts(QList<Account>*accounts) | 20 | void StatusMail::initAccounts(QList<Account>&accounts) |
23 | { | 21 | { |
24 | if (!accounts) return; | 22 | |
25 | Account *it; | 23 | Account *it; |
26 | folderStat currentStat; | 24 | folderStat currentStat; |
27 | AbstractMail * current = 0; | 25 | AbstractMail * current = 0; |
28 | for ( it = accounts->first(); it; it = accounts->next() ) { | 26 | for ( it = accounts.first(); it; it = accounts.next() ) { |
29 | if ( it->getType().compare( "IMAP" ) == 0 ) { | 27 | if ( it->getType().compare( "IMAP" ) == 0 ) { |
30 | IMAPaccount*ima = static_cast<IMAPaccount *>(it); | 28 | IMAPaccount*ima = static_cast<IMAPaccount *>(it); |
31 | current = AbstractMail::getWrapper(ima); | 29 | current = AbstractMail::getWrapper(ima); |
32 | connectionList.append(current); | 30 | connectionList.append(current); |
33 | current->statusFolder(currentStat); | 31 | current->statusFolder(currentStat); |
34 | currentImapStat.message_count+=currentStat.message_unseen; | 32 | currentImapStat.message_count+=currentStat.message_unseen; |
35 | currentImapStat.message_count+=currentStat.message_recent; | 33 | currentImapStat.message_count+=currentStat.message_recent; |
36 | currentImapStat.message_count+=currentStat.message_count; | 34 | currentImapStat.message_count+=currentStat.message_count; |
37 | } else if ( it->getType().compare( "POP3" ) == 0 ) { | 35 | } else if ( it->getType().compare( "POP3" ) == 0 ) { |
38 | POP3account *pop3 = static_cast<POP3account *>(it); | 36 | POP3account *pop3 = static_cast<POP3account *>(it); |
39 | current = AbstractMail::getWrapper(pop3); | 37 | current = AbstractMail::getWrapper(pop3); |
40 | connectionList.append(current); | 38 | connectionList.append(current); |