-rw-r--r-- | noncore/net/mail/taskbarapplet/mailapplet.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/net/mail/taskbarapplet/mailapplet.cpp b/noncore/net/mail/taskbarapplet/mailapplet.cpp index 6078013..f242bda 100644 --- a/noncore/net/mail/taskbarapplet/mailapplet.cpp +++ b/noncore/net/mail/taskbarapplet/mailapplet.cpp | |||
@@ -50,48 +50,50 @@ void MailApplet::paintEvent( QPaintEvent* ) { | |||
50 | QFontMetrics fm( f ); | 50 | QFontMetrics fm( f ); |
51 | p.setFont( f ); | 51 | p.setFont( f ); |
52 | p.setPen( Qt::blue ); | 52 | p.setPen( Qt::blue ); |
53 | p.drawText( AppLnk::smallIconSize()/3, AppLnk::smallIconSize() - 2, QString::number( m_newMails ) ); | 53 | p.drawText( AppLnk::smallIconSize()/3, AppLnk::smallIconSize() - 2, QString::number( m_newMails ) ); |
54 | return; | 54 | return; |
55 | 55 | ||
56 | } | 56 | } |
57 | 57 | ||
58 | void MailApplet::mouseReleaseEvent( QMouseEvent* e ) { | 58 | void MailApplet::mouseReleaseEvent( QMouseEvent* e ) { |
59 | slotClicked(); | 59 | slotClicked(); |
60 | } | 60 | } |
61 | 61 | ||
62 | void MailApplet::slotClicked() { | 62 | void MailApplet::slotClicked() { |
63 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 63 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
64 | e << QString( "opiemail" ); | 64 | e << QString( "opiemail" ); |
65 | 65 | ||
66 | ODevice *device = ODevice::inst(); | 66 | ODevice *device = ODevice::inst(); |
67 | if ( !device-> ledList().isEmpty() ) { | 67 | if ( !device-> ledList().isEmpty() ) { |
68 | OLed led = ( device->ledList().contains( Led_Mail ) ) ? Led_Mail : device->ledList()[0]; | 68 | OLed led = ( device->ledList().contains( Led_Mail ) ) ? Led_Mail : device->ledList()[0]; |
69 | 69 | ||
70 | device->setLedState( led, Led_Off ); | 70 | device->setLedState( led, Led_Off ); |
71 | } | 71 | } |
72 | 72 | ||
73 | if (m_statusMail) m_statusMail->reset_status(); | 73 | if (m_statusMail) m_statusMail->reset_status(); |
74 | |||
75 | hide(); | ||
74 | } | 76 | } |
75 | 77 | ||
76 | void MailApplet::startup() { | 78 | void MailApplet::startup() { |
77 | Settings *settings = new Settings(); | 79 | Settings *settings = new Settings(); |
78 | QList<Account> ma = settings->getAccounts(); | 80 | QList<Account> ma = settings->getAccounts(); |
79 | m_statusMail = new StatusMail( ma ); | 81 | m_statusMail = new StatusMail( ma ); |
80 | delete settings; | 82 | delete settings; |
81 | 83 | ||
82 | m_intervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; | 84 | m_intervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; |
83 | m_intervalTimer = new QTimer(); | 85 | m_intervalTimer = new QTimer(); |
84 | m_intervalTimer->start( m_intervalMs ); | 86 | m_intervalTimer->start( m_intervalMs ); |
85 | connect( m_intervalTimer, SIGNAL( timeout() ), this, SLOT( slotCheck() ) ); | 87 | connect( m_intervalTimer, SIGNAL( timeout() ), this, SLOT( slotCheck() ) ); |
86 | } | 88 | } |
87 | 89 | ||
88 | void MailApplet::slotCheck() { | 90 | void MailApplet::slotCheck() { |
89 | // Check wether the check interval has been changed. | 91 | // Check wether the check interval has been changed. |
90 | int newIntervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; | 92 | int newIntervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; |
91 | if ( newIntervalMs != m_intervalMs ) { | 93 | if ( newIntervalMs != m_intervalMs ) { |
92 | m_intervalTimer->changeInterval( newIntervalMs ); | 94 | m_intervalTimer->changeInterval( newIntervalMs ); |
93 | m_intervalMs = newIntervalMs; | 95 | m_intervalMs = newIntervalMs; |
94 | } | 96 | } |
95 | 97 | ||
96 | if (m_statusMail == 0) { | 98 | if (m_statusMail == 0) { |
97 | return; | 99 | return; |