Diffstat (limited to 'noncore/net/mail/taskbarapplet/mailapplet.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/taskbarapplet/mailapplet.cpp | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/noncore/net/mail/taskbarapplet/mailapplet.cpp b/noncore/net/mail/taskbarapplet/mailapplet.cpp index 5ba7085..f81dce8 100644 --- a/noncore/net/mail/taskbarapplet/mailapplet.cpp +++ b/noncore/net/mail/taskbarapplet/mailapplet.cpp | |||
@@ -12,2 +12,5 @@ | |||
12 | #include <opie/odevice.h> | 12 | #include <opie/odevice.h> |
13 | #include <qlist.h> | ||
14 | |||
15 | #include <libmailwrapper/settings.h> | ||
13 | 16 | ||
@@ -42,4 +45,9 @@ MailApplet::MailApplet( QWidget *parent, const char *name, WFlags fl ) | |||
42 | 45 | ||
43 | QTimer::singleShot( 0, this, SLOT( slotCheck() ) ); | 46 | // delay 5 sec until the whole mail backend gets started .-) |
47 | QTimer::singleShot( 5000, this, SLOT( startup() ) ); | ||
48 | } | ||
44 | } | 49 | } |
50 | |||
51 | MailApplet::~MailApplet() { | ||
52 | delete m_statusMail; | ||
45 | } | 53 | } |
@@ -60,2 +68,11 @@ void MailApplet::slotClicked() { | |||
60 | } | 68 | } |
69 | |||
70 | // m_statusMails->reset_status(); | ||
71 | } | ||
72 | |||
73 | void MailApplet::startup() { | ||
74 | Settings *settings = new Settings(); | ||
75 | QList<Account> ma = settings->getAccounts(); | ||
76 | StatusMail m_statusMail = StatusMail( ma ); | ||
77 | delete settings; | ||
61 | } | 78 | } |
@@ -70,5 +87,8 @@ void MailApplet::slotCheck() { | |||
70 | 87 | ||
71 | int newMails = 0; | ||
72 | 88 | ||
73 | if ( true ) { | 89 | folderStat stat; |
90 | m_statusMail->check_current_stat( stat ); | ||
91 | |||
92 | qDebug( QString( "test %1" ).arg( stat.message_unseen ) ); | ||
93 | if ( stat.message_unseen > 0 ) { | ||
74 | ODevice *device = ODevice::inst(); | 94 | ODevice *device = ODevice::inst(); |
@@ -84,8 +104,9 @@ void MailApplet::slotCheck() { | |||
84 | 104 | ||
105 | qDebug( QString( "test %1" ).arg( stat.message_unseen ) ); | ||
106 | |||
85 | Config cfg( "mail" ); | 107 | Config cfg( "mail" ); |
86 | cfg.setGroup( "Status" ); | 108 | cfg.setGroup( "Status" ); |
87 | cfg.writeEntry( "NewMails", newMails ); // todo | 109 | cfg.writeEntry( "NewMails", ( int )stat.message_unseen ); |
88 | |||
89 | QCopEnvelope env( "QPE/Pim", "newMails(int)" ); | 110 | QCopEnvelope env( "QPE/Pim", "newMails(int)" ); |
90 | env << newMails; | 111 | env << stat.message_unseen; |
91 | 112 | ||