summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/statusmail.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/statusmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/statusmail.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/net/mail/libmailwrapper/statusmail.cpp b/noncore/net/mail/libmailwrapper/statusmail.cpp
index 51383f6..7e14df3 100644
--- a/noncore/net/mail/libmailwrapper/statusmail.cpp
+++ b/noncore/net/mail/libmailwrapper/statusmail.cpp
@@ -1,50 +1,54 @@
#include "statusmail.h"
+#include <opie2/odebug.h>
+
+using namespace Opie::Core;
+
StatusMail::StatusMail(QList<Account>&list)
{
currentImapStat.message_count=0;
currentImapStat.message_unseen=0;
currentImapStat.message_recent=0;
lastPop3Stat = currentImapStat;
currentPop3Stat = currentImapStat;
connectionList.setAutoDelete(true);
connectionList.clear();
initAccounts(list);
}
StatusMail::~StatusMail()
{
}
void StatusMail::initAccounts(QList<Account>&accounts)
{
Account *it;
folderStat currentStat;
AbstractMail * current = 0;
currentPop3Stat.message_count=0;
currentPop3Stat.message_recent=0;
currentPop3Stat.message_unseen=0;
for ( it = accounts.first(); it; it = accounts.next() ) {
if ( it->getType()==MAILLIB::A_IMAP && !it->getOffline() ) {
IMAPaccount*ima = static_cast<IMAPaccount *>(it);
current = AbstractMail::getWrapper(ima);
connectionList.append(current);
current->statusFolder(currentStat);
currentImapStat.message_count+=currentStat.message_unseen;
currentImapStat.message_count+=currentStat.message_recent;
currentImapStat.message_count+=currentStat.message_count;
} else if ( it->getType() == MAILLIB::A_POP3 && !it->getOffline() ) {
POP3account *pop3 = static_cast<POP3account *>(it);
current = AbstractMail::getWrapper(pop3);
connectionList.append(current);
current->statusFolder(currentStat);
currentPop3Stat.message_count+=currentStat.message_count;
}
current->logout();
}
odebug << "Pop3 init count: " << currentPop3Stat.message_count << "" << oendl;
currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0;
lastPop3Stat.message_unseen = currentPop3Stat.message_unseen;
lastPop3Stat.message_recent = currentPop3Stat.message_recent;
lastPop3Stat.message_count = currentPop3Stat.message_count;