-rw-r--r-- | noncore/net/mail/taskbarapplet/mailapplet.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/noncore/net/mail/taskbarapplet/mailapplet.cpp b/noncore/net/mail/taskbarapplet/mailapplet.cpp index 2fc1d01..9c0d32f 100644 --- a/noncore/net/mail/taskbarapplet/mailapplet.cpp +++ b/noncore/net/mail/taskbarapplet/mailapplet.cpp | |||
@@ -14,2 +14,5 @@ | |||
14 | 14 | ||
15 | /* UNIX */ | ||
16 | #include <signal.h> | ||
17 | |||
15 | using namespace Opie::Core; | 18 | using namespace Opie::Core; |
@@ -30,2 +33,9 @@ MailApplet::MailApplet( QWidget *parent ) | |||
30 | 33 | ||
34 | /* for networking we must block SIGPIPE and Co. */ | ||
35 | struct sigaction blocking_action,temp_action; | ||
36 | blocking_action.sa_handler = SIG_IGN; | ||
37 | sigemptyset(&(blocking_action.sa_mask)); | ||
38 | blocking_action.sa_flags = 0; | ||
39 | sigaction(SIGPIPE,&blocking_action,&temp_action); | ||
40 | |||
31 | if ( !m_config->readBoolEntry( "Disabled", false ) ) { | 41 | if ( !m_config->readBoolEntry( "Disabled", false ) ) { |
@@ -71,6 +81,4 @@ void MailApplet::slotClicked() { | |||
71 | } | 81 | } |
72 | |||
73 | if (m_statusMail) | 82 | if (m_statusMail) |
74 | m_statusMail->reset_status(); | 83 | m_statusMail->reset_status(); |
75 | |||
76 | hide(); | 84 | hide(); |
@@ -78,3 +86,4 @@ void MailApplet::slotClicked() { | |||
78 | 86 | ||
79 | void MailApplet::startup() { | 87 | void MailApplet::startup() |
88 | { | ||
80 | Settings *settings = new Settings(); | 89 | Settings *settings = new Settings(); |
@@ -84,3 +93,4 @@ void MailApplet::startup() { | |||
84 | 93 | ||
85 | m_intervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; | 94 | //m_intervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; |
95 | m_intervalMs = 100; | ||
86 | m_intervalTimer = new QTimer(); | 96 | m_intervalTimer = new QTimer(); |
@@ -92,2 +102,3 @@ void MailApplet::slotCheck() { | |||
92 | // Check wether the check interval has been changed. | 102 | // Check wether the check interval has been changed. |
103 | odebug << "MailApplet::slotCheck()" << oendl; | ||
93 | int newIntervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; | 104 | int newIntervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; |
@@ -107,6 +118,7 @@ void MailApplet::slotCheck() { | |||
107 | odebug << QString( "test %1" ).arg( m_newMails ) << oendl; | 118 | odebug << QString( "test %1" ).arg( m_newMails ) << oendl; |
108 | if ( m_newMails > 0 && newMailsOld != m_newMails ) { | 119 | if ( m_newMails > 0) { |
109 | ODevice *device = ODevice::inst(); | ||
110 | if ( isHidden() ) | 120 | if ( isHidden() ) |
111 | show(); | 121 | show(); |
122 | if (newMailsOld != m_newMails) { | ||
123 | ODevice *device = ODevice::inst(); | ||
112 | if ( m_config->readBoolEntry( "BlinkLed", true ) ) { | 124 | if ( m_config->readBoolEntry( "BlinkLed", true ) ) { |
@@ -119,3 +131,3 @@ void MailApplet::slotCheck() { | |||
119 | device->playAlarmSound(); | 131 | device->playAlarmSound(); |
120 | 132 | } | |
121 | Config cfg( "mail" ); | 133 | Config cfg( "mail" ); |
@@ -123,6 +135,9 @@ void MailApplet::slotCheck() { | |||
123 | cfg.writeEntry( "newMails", m_newMails ); | 135 | cfg.writeEntry( "newMails", m_newMails ); |
136 | { | ||
137 | odebug << "QCop abschicken" << oendl; | ||
124 | QCopEnvelope env( "QPE/Pim", "newMails(int)" ); | 138 | QCopEnvelope env( "QPE/Pim", "newMails(int)" ); |
125 | env << m_newMails; | 139 | env << m_newMails; |
140 | } | ||
141 | odebug << "QCop abschicken done" << oendl; | ||
126 | repaint( true ); | 142 | repaint( true ); |
127 | |||
128 | } else { | 143 | } else { |