summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/statusmail.cpp10
-rw-r--r--noncore/net/mail/libmailwrapper/statusmail.h10
2 files changed, 9 insertions, 11 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,12 +1,10 @@
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
6StatusMail::StatusMail(QList<Account>*list) 4StatusMail::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;
@@ -16,19 +14,19 @@ StatusMail::StatusMail(QList<Account>*list)
16} 14}
17 15
18StatusMail::~StatusMail() 16StatusMail::~StatusMail()
19{ 17{
20} 18}
21 19
22void StatusMail::initAccounts(QList<Account>*accounts) 20void 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;
diff --git a/noncore/net/mail/libmailwrapper/statusmail.h b/noncore/net/mail/libmailwrapper/statusmail.h
index 498f7a3..2637232 100644
--- a/noncore/net/mail/libmailwrapper/statusmail.h
+++ b/noncore/net/mail/libmailwrapper/statusmail.h
@@ -1,26 +1,26 @@
1#ifndef __MAIL_STATUS_H 1#ifndef __MAIL_STATUS_H
2#define __MAIL_STATUS_H 2#define __MAIL_STATUS_H
3 3
4#include <settings.h> 4#include "settings.h"
5#include <abstractmail.h> 5#include "abstractmail.h"
6#include <mailtypes.h> 6#include "mailtypes.h"
7 7
8class StatusMail 8class StatusMail
9{ 9{
10public: 10public:
11 StatusMail(QList<Account>*list); 11 StatusMail(QList<Account>&list);
12 virtual ~StatusMail(); 12 virtual ~StatusMail();
13 13
14 /* this should be called if opiemail is starte or a mailbox touched - may be trough 14 /* this should be called if opiemail is starte or a mailbox touched - may be trough
15 a qcop signal or if tab on the taskbar applet*/ 15 a qcop signal or if tab on the taskbar applet*/
16 virtual void reset_status(); 16 virtual void reset_status();
17 virtual void check_current_stat(folderStat&targetStat); 17 virtual void check_current_stat(folderStat&targetStat);
18 18
19protected: 19protected:
20 void initAccounts(QList<Account>*list); 20 void initAccounts(QList<Account>&accounts);
21 /* this must be cause we have to calculate the recent for pop3*/ 21 /* this must be cause we have to calculate the recent for pop3*/
22 folderStat currentImapStat; 22 folderStat currentImapStat;
23 /* currentPop3Stat is the sum of messages in POP3 accounts in CURRENT loop 23 /* currentPop3Stat is the sum of messages in POP3 accounts in CURRENT loop
24 the recent are calculated to the difference of the LAST loop */ 24 the recent are calculated to the difference of the LAST loop */
25 folderStat currentPop3Stat; 25 folderStat currentPop3Stat;
26 /* lastPop3Stat is the sum of messages in LAST loop */ 26 /* lastPop3Stat is the sum of messages in LAST loop */