author | alwin <alwin> | 2004-01-06 12:57:52 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-01-06 12:57:52 (UTC) |
commit | 46753cb77877f4807ab9b1ba3e6c7a4eed7bc1bd (patch) (unidiff) | |
tree | cd0b99b0856f65499f7d15aaf5670822183dd660 | |
parent | 71b6178795294dcdc85dee7a8ec8e8470c5b06e0 (diff) | |
download | opie-46753cb77877f4807ab9b1ba3e6c7a4eed7bc1bd.zip opie-46753cb77877f4807ab9b1ba3e6c7a4eed7bc1bd.tar.gz opie-46753cb77877f4807ab9b1ba3e6c7a4eed7bc1bd.tar.bz2 |
status of pop3 accounts slightly reworked
when starting opiemail from taskbar applet the status will be
reset
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.cpp | 9 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/statusmail.cpp | 8 | ||||
-rw-r--r-- | noncore/net/mail/taskbarapplet/mailapplet.cpp | 2 |
4 files changed, 16 insertions, 4 deletions
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp index d8a36e7..bf91c63 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.cpp +++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp | |||
@@ -80,256 +80,265 @@ void RecMail::setBcc(const QStringList&list) | |||
80 | } | 80 | } |
81 | 81 | ||
82 | const QStringList& RecMail::Bcc()const | 82 | const QStringList& RecMail::Bcc()const |
83 | { | 83 | { |
84 | return bcc; | 84 | return bcc; |
85 | } | 85 | } |
86 | 86 | ||
87 | RecPart::RecPart() | 87 | RecPart::RecPart() |
88 | : m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_description(""),m_lines(0),m_size(0) | 88 | : m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_description(""),m_lines(0),m_size(0) |
89 | { | 89 | { |
90 | m_Parameters.clear(); | 90 | m_Parameters.clear(); |
91 | m_poslist.clear(); | 91 | m_poslist.clear(); |
92 | } | 92 | } |
93 | 93 | ||
94 | RecPart::~RecPart() | 94 | RecPart::~RecPart() |
95 | { | 95 | { |
96 | } | 96 | } |
97 | 97 | ||
98 | void RecPart::setSize(unsigned int size) | 98 | void RecPart::setSize(unsigned int size) |
99 | { | 99 | { |
100 | m_size = size; | 100 | m_size = size; |
101 | } | 101 | } |
102 | 102 | ||
103 | const unsigned int RecPart::Size()const | 103 | const unsigned int RecPart::Size()const |
104 | { | 104 | { |
105 | return m_size; | 105 | return m_size; |
106 | } | 106 | } |
107 | 107 | ||
108 | void RecPart::setLines(unsigned int lines) | 108 | void RecPart::setLines(unsigned int lines) |
109 | { | 109 | { |
110 | m_lines = lines; | 110 | m_lines = lines; |
111 | } | 111 | } |
112 | 112 | ||
113 | const unsigned int RecPart::Lines()const | 113 | const unsigned int RecPart::Lines()const |
114 | { | 114 | { |
115 | return m_lines; | 115 | return m_lines; |
116 | } | 116 | } |
117 | 117 | ||
118 | const QString& RecPart::Type()const | 118 | const QString& RecPart::Type()const |
119 | { | 119 | { |
120 | return m_type; | 120 | return m_type; |
121 | } | 121 | } |
122 | 122 | ||
123 | void RecPart::setType(const QString&type) | 123 | void RecPart::setType(const QString&type) |
124 | { | 124 | { |
125 | m_type = type; | 125 | m_type = type; |
126 | } | 126 | } |
127 | 127 | ||
128 | const QString& RecPart::Subtype()const | 128 | const QString& RecPart::Subtype()const |
129 | { | 129 | { |
130 | return m_subtype; | 130 | return m_subtype; |
131 | } | 131 | } |
132 | 132 | ||
133 | void RecPart::setSubtype(const QString&subtype) | 133 | void RecPart::setSubtype(const QString&subtype) |
134 | { | 134 | { |
135 | m_subtype = subtype; | 135 | m_subtype = subtype; |
136 | } | 136 | } |
137 | 137 | ||
138 | const QString& RecPart::Identifier()const | 138 | const QString& RecPart::Identifier()const |
139 | { | 139 | { |
140 | return m_identifier; | 140 | return m_identifier; |
141 | } | 141 | } |
142 | 142 | ||
143 | void RecPart::setIdentifier(const QString&identifier) | 143 | void RecPart::setIdentifier(const QString&identifier) |
144 | { | 144 | { |
145 | m_identifier = identifier; | 145 | m_identifier = identifier; |
146 | } | 146 | } |
147 | 147 | ||
148 | const QString& RecPart::Encoding()const | 148 | const QString& RecPart::Encoding()const |
149 | { | 149 | { |
150 | return m_encoding; | 150 | return m_encoding; |
151 | } | 151 | } |
152 | 152 | ||
153 | void RecPart::setEncoding(const QString&encoding) | 153 | void RecPart::setEncoding(const QString&encoding) |
154 | { | 154 | { |
155 | m_encoding = encoding; | 155 | m_encoding = encoding; |
156 | } | 156 | } |
157 | 157 | ||
158 | const QString& RecPart::Description()const | 158 | const QString& RecPart::Description()const |
159 | { | 159 | { |
160 | return m_description; | 160 | return m_description; |
161 | } | 161 | } |
162 | 162 | ||
163 | void RecPart::setDescription(const QString&desc) | 163 | void RecPart::setDescription(const QString&desc) |
164 | { | 164 | { |
165 | m_description = desc; | 165 | m_description = desc; |
166 | } | 166 | } |
167 | 167 | ||
168 | void RecPart::setParameters(const part_plist_t&list) | 168 | void RecPart::setParameters(const part_plist_t&list) |
169 | { | 169 | { |
170 | m_Parameters = list; | 170 | m_Parameters = list; |
171 | } | 171 | } |
172 | 172 | ||
173 | const part_plist_t& RecPart::Parameters()const | 173 | const part_plist_t& RecPart::Parameters()const |
174 | { | 174 | { |
175 | return m_Parameters; | 175 | return m_Parameters; |
176 | } | 176 | } |
177 | 177 | ||
178 | void RecPart::addParameter(const QString&key,const QString&value) | 178 | void RecPart::addParameter(const QString&key,const QString&value) |
179 | { | 179 | { |
180 | m_Parameters[key]=value; | 180 | m_Parameters[key]=value; |
181 | } | 181 | } |
182 | 182 | ||
183 | const QString RecPart::searchParamter(const QString&key)const | 183 | const QString RecPart::searchParamter(const QString&key)const |
184 | { | 184 | { |
185 | QString value(""); | 185 | QString value(""); |
186 | part_plist_t::ConstIterator it = m_Parameters.find(key); | 186 | part_plist_t::ConstIterator it = m_Parameters.find(key); |
187 | if (it != m_Parameters.end()) { | 187 | if (it != m_Parameters.end()) { |
188 | value = it.data(); | 188 | value = it.data(); |
189 | } | 189 | } |
190 | return value; | 190 | return value; |
191 | } | 191 | } |
192 | 192 | ||
193 | void RecPart::setPositionlist(const QValueList<int>&poslist) | 193 | void RecPart::setPositionlist(const QValueList<int>&poslist) |
194 | { | 194 | { |
195 | m_poslist = poslist; | 195 | m_poslist = poslist; |
196 | } | 196 | } |
197 | 197 | ||
198 | const QValueList<int>& RecPart::Positionlist()const | 198 | const QValueList<int>& RecPart::Positionlist()const |
199 | { | 199 | { |
200 | return m_poslist; | 200 | return m_poslist; |
201 | } | 201 | } |
202 | 202 | ||
203 | RecBody::RecBody() | 203 | RecBody::RecBody() |
204 | : m_BodyText(),m_PartsList(),m_description() | 204 | : m_BodyText(),m_PartsList(),m_description() |
205 | { | 205 | { |
206 | m_PartsList.clear(); | 206 | m_PartsList.clear(); |
207 | } | 207 | } |
208 | 208 | ||
209 | RecBody::~RecBody() | 209 | RecBody::~RecBody() |
210 | { | 210 | { |
211 | } | 211 | } |
212 | 212 | ||
213 | void RecBody::setBodytext(const QString&bodyText) | 213 | void RecBody::setBodytext(const QString&bodyText) |
214 | { | 214 | { |
215 | m_BodyText = bodyText; | 215 | m_BodyText = bodyText; |
216 | } | 216 | } |
217 | 217 | ||
218 | const QString& RecBody::Bodytext()const | 218 | const QString& RecBody::Bodytext()const |
219 | { | 219 | { |
220 | return m_BodyText; | 220 | return m_BodyText; |
221 | } | 221 | } |
222 | 222 | ||
223 | void RecBody::setParts(const QValueList<RecPart>&parts) | 223 | void RecBody::setParts(const QValueList<RecPart>&parts) |
224 | { | 224 | { |
225 | m_PartsList.clear(); | 225 | m_PartsList.clear(); |
226 | m_PartsList = parts; | 226 | m_PartsList = parts; |
227 | } | 227 | } |
228 | 228 | ||
229 | const QValueList<RecPart>& RecBody::Parts()const | 229 | const QValueList<RecPart>& RecBody::Parts()const |
230 | { | 230 | { |
231 | return m_PartsList; | 231 | return m_PartsList; |
232 | } | 232 | } |
233 | 233 | ||
234 | void RecBody::addPart(const RecPart& part) | 234 | void RecBody::addPart(const RecPart& part) |
235 | { | 235 | { |
236 | m_PartsList.append(part); | 236 | m_PartsList.append(part); |
237 | } | 237 | } |
238 | 238 | ||
239 | void RecBody::setDescription(const RecPart&des) | 239 | void RecBody::setDescription(const RecPart&des) |
240 | { | 240 | { |
241 | m_description = des; | 241 | m_description = des; |
242 | } | 242 | } |
243 | 243 | ||
244 | const RecPart& RecBody::Description()const | 244 | const RecPart& RecBody::Description()const |
245 | { | 245 | { |
246 | return m_description; | 246 | return m_description; |
247 | } | 247 | } |
248 | 248 | ||
249 | /* handling encoded content */ | 249 | /* handling encoded content */ |
250 | encodedString::encodedString() | 250 | encodedString::encodedString() |
251 | { | 251 | { |
252 | init(); | 252 | init(); |
253 | } | 253 | } |
254 | 254 | ||
255 | encodedString::encodedString(const char*nContent,unsigned int nSize) | 255 | encodedString::encodedString(const char*nContent,unsigned int nSize) |
256 | { | 256 | { |
257 | init(); | 257 | init(); |
258 | setContent(nContent,nSize); | 258 | setContent(nContent,nSize); |
259 | } | 259 | } |
260 | 260 | ||
261 | encodedString::encodedString(char*nContent,unsigned int nSize) | 261 | encodedString::encodedString(char*nContent,unsigned int nSize) |
262 | { | 262 | { |
263 | init(); | 263 | init(); |
264 | setContent(nContent,nSize); | 264 | setContent(nContent,nSize); |
265 | } | 265 | } |
266 | 266 | ||
267 | encodedString::encodedString(const encodedString&old) | 267 | encodedString::encodedString(const encodedString&old) |
268 | { | 268 | { |
269 | init(); | 269 | init(); |
270 | copy_old(old); | 270 | copy_old(old); |
271 | qDebug("encodedeString: copy constructor!"); | 271 | qDebug("encodedeString: copy constructor!"); |
272 | } | 272 | } |
273 | 273 | ||
274 | encodedString& encodedString::operator=(const encodedString&old) | 274 | encodedString& encodedString::operator=(const encodedString&old) |
275 | { | 275 | { |
276 | init(); | 276 | init(); |
277 | copy_old(old); | 277 | copy_old(old); |
278 | qDebug("encodedString: assign operator!"); | 278 | qDebug("encodedString: assign operator!"); |
279 | return *this; | 279 | return *this; |
280 | } | 280 | } |
281 | 281 | ||
282 | encodedString::~encodedString() | 282 | encodedString::~encodedString() |
283 | { | 283 | { |
284 | clean(); | 284 | clean(); |
285 | } | 285 | } |
286 | 286 | ||
287 | void encodedString::init() | 287 | void encodedString::init() |
288 | { | 288 | { |
289 | content = 0; | 289 | content = 0; |
290 | size = 0; | 290 | size = 0; |
291 | } | 291 | } |
292 | 292 | ||
293 | void encodedString::clean() | 293 | void encodedString::clean() |
294 | { | 294 | { |
295 | if (content) { | 295 | if (content) { |
296 | free(content); | 296 | free(content); |
297 | } | 297 | } |
298 | content = 0; | 298 | content = 0; |
299 | size = 0; | 299 | size = 0; |
300 | } | 300 | } |
301 | 301 | ||
302 | void encodedString::copy_old(const encodedString&old) | 302 | void encodedString::copy_old(const encodedString&old) |
303 | { | 303 | { |
304 | clean(); | 304 | clean(); |
305 | if (old.size>0 && old.content) { | 305 | if (old.size>0 && old.content) { |
306 | content = (char*)malloc(old.size*sizeof(char)); | 306 | content = (char*)malloc(old.size*sizeof(char)); |
307 | memcpy(content,old.content,size); | 307 | memcpy(content,old.content,size); |
308 | size = old.size; | 308 | size = old.size; |
309 | } | 309 | } |
310 | } | 310 | } |
311 | 311 | ||
312 | const char*encodedString::Content()const | 312 | const char*encodedString::Content()const |
313 | { | 313 | { |
314 | return content; | 314 | return content; |
315 | } | 315 | } |
316 | 316 | ||
317 | const int encodedString::Length()const | 317 | const int encodedString::Length()const |
318 | { | 318 | { |
319 | return size; | 319 | return size; |
320 | } | 320 | } |
321 | 321 | ||
322 | void encodedString::setContent(const char*nContent,int nSize) | 322 | void encodedString::setContent(const char*nContent,int nSize) |
323 | { | 323 | { |
324 | if (nSize>0 && nContent) { | 324 | if (nSize>0 && nContent) { |
325 | content = (char*)malloc(nSize*sizeof(char)); | 325 | content = (char*)malloc(nSize*sizeof(char)); |
326 | memcpy(content,nContent,nSize); | 326 | memcpy(content,nContent,nSize); |
327 | size = nSize; | 327 | size = nSize; |
328 | } | 328 | } |
329 | } | 329 | } |
330 | 330 | ||
331 | void encodedString::setContent(char*nContent,int nSize) | 331 | void encodedString::setContent(char*nContent,int nSize) |
332 | { | 332 | { |
333 | content = nContent; | 333 | content = nContent; |
334 | size = nSize; | 334 | size = nSize; |
335 | } | 335 | } |
336 | |||
337 | folderStat&folderStat::operator=(const folderStat&old) | ||
338 | { | ||
339 | message_count = old.message_count; | ||
340 | message_unseen = old.message_unseen; | ||
341 | message_recent = old.message_recent; | ||
342 | return *this; | ||
343 | } | ||
344 | |||
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h index 05c4816..b2047cb 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.h +++ b/noncore/net/mail/libmailwrapper/mailtypes.h | |||
@@ -1,192 +1,193 @@ | |||
1 | #ifndef __MAIL_TYPES_H | 1 | #ifndef __MAIL_TYPES_H |
2 | #define __MAIL_TYPES_H | 2 | #define __MAIL_TYPES_H |
3 | 3 | ||
4 | #define FLAG_ANSWERED 0 | 4 | #define FLAG_ANSWERED 0 |
5 | #define FLAG_FLAGGED 1 | 5 | #define FLAG_FLAGGED 1 |
6 | #define FLAG_DELETED 2 | 6 | #define FLAG_DELETED 2 |
7 | #define FLAG_SEEN 3 | 7 | #define FLAG_SEEN 3 |
8 | #define FLAG_DRAFT 4 | 8 | #define FLAG_DRAFT 4 |
9 | #define FLAG_RECENT 5 | 9 | #define FLAG_RECENT 5 |
10 | 10 | ||
11 | #include <qlist.h> | 11 | #include <qlist.h> |
12 | #include <qbitarray.h> | 12 | #include <qbitarray.h> |
13 | #include <qstring.h> | 13 | #include <qstring.h> |
14 | #include <qstringlist.h> | 14 | #include <qstringlist.h> |
15 | #include <qmap.h> | 15 | #include <qmap.h> |
16 | #include <qvaluelist.h> | 16 | #include <qvaluelist.h> |
17 | 17 | ||
18 | class AbstractMail; | 18 | class AbstractMail; |
19 | /* a class to describe mails in a mailbox */ | 19 | /* a class to describe mails in a mailbox */ |
20 | /* Attention! | 20 | /* Attention! |
21 | From programmers point of view it would make sense to | 21 | From programmers point of view it would make sense to |
22 | store the mail body into this class, too. | 22 | store the mail body into this class, too. |
23 | But: not from the point of view of the device. | 23 | But: not from the point of view of the device. |
24 | Mailbodies can be real large. So we request them when | 24 | Mailbodies can be real large. So we request them when |
25 | needed from the mail-wrapper class direct from the server itself | 25 | needed from the mail-wrapper class direct from the server itself |
26 | (imap) or from a file-based cache (pop3?) | 26 | (imap) or from a file-based cache (pop3?) |
27 | So there is no interface "const QString&body()" but you should | 27 | So there is no interface "const QString&body()" but you should |
28 | make a request to the mailwrapper with this class as parameter to | 28 | make a request to the mailwrapper with this class as parameter to |
29 | get the body. Same words for the attachments. | 29 | get the body. Same words for the attachments. |
30 | */ | 30 | */ |
31 | class RecMail | 31 | class RecMail |
32 | { | 32 | { |
33 | public: | 33 | public: |
34 | RecMail(); | 34 | RecMail(); |
35 | RecMail(const RecMail&old); | 35 | RecMail(const RecMail&old); |
36 | virtual ~RecMail(); | 36 | virtual ~RecMail(); |
37 | 37 | ||
38 | const int getNumber()const{return msg_number;} | 38 | const int getNumber()const{return msg_number;} |
39 | void setNumber(int number){msg_number=number;} | 39 | void setNumber(int number){msg_number=number;} |
40 | const QString&getDate()const{ return date; } | 40 | const QString&getDate()const{ return date; } |
41 | void setDate( const QString&a ) { date = a; } | 41 | void setDate( const QString&a ) { date = a; } |
42 | const QString&getFrom()const{ return from; } | 42 | const QString&getFrom()const{ return from; } |
43 | void setFrom( const QString&a ) { from = a; } | 43 | void setFrom( const QString&a ) { from = a; } |
44 | const QString&getSubject()const { return subject; } | 44 | const QString&getSubject()const { return subject; } |
45 | void setSubject( const QString&s ) { subject = s; } | 45 | void setSubject( const QString&s ) { subject = s; } |
46 | const QString&getMbox()const{return mbox;} | 46 | const QString&getMbox()const{return mbox;} |
47 | void setMbox(const QString&box){mbox = box;} | 47 | void setMbox(const QString&box){mbox = box;} |
48 | void setMsgid(const QString&id){msg_id=id;} | 48 | void setMsgid(const QString&id){msg_id=id;} |
49 | const QString&Msgid()const{return msg_id;} | 49 | const QString&Msgid()const{return msg_id;} |
50 | void setReplyto(const QString&reply){replyto=reply;} | 50 | void setReplyto(const QString&reply){replyto=reply;} |
51 | const QString&Replyto()const{return replyto;} | 51 | const QString&Replyto()const{return replyto;} |
52 | void setMsgsize(int size){msg_size = size;} | 52 | void setMsgsize(int size){msg_size = size;} |
53 | const int Msgsize()const{return msg_size;} | 53 | const int Msgsize()const{return msg_size;} |
54 | 54 | ||
55 | 55 | ||
56 | void setTo(const QStringList&list); | 56 | void setTo(const QStringList&list); |
57 | const QStringList&To()const; | 57 | const QStringList&To()const; |
58 | void setCC(const QStringList&list); | 58 | void setCC(const QStringList&list); |
59 | const QStringList&CC()const; | 59 | const QStringList&CC()const; |
60 | void setBcc(const QStringList&list); | 60 | void setBcc(const QStringList&list); |
61 | const QStringList&Bcc()const; | 61 | const QStringList&Bcc()const; |
62 | const QBitArray&getFlags()const{return msg_flags;} | 62 | const QBitArray&getFlags()const{return msg_flags;} |
63 | void setFlags(const QBitArray&flags){msg_flags = flags;} | 63 | void setFlags(const QBitArray&flags){msg_flags = flags;} |
64 | 64 | ||
65 | void setWrapper(AbstractMail*wrapper); | 65 | void setWrapper(AbstractMail*wrapper); |
66 | AbstractMail* Wrapper(); | 66 | AbstractMail* Wrapper(); |
67 | 67 | ||
68 | protected: | 68 | protected: |
69 | QString subject,date,from,mbox,msg_id,replyto; | 69 | QString subject,date,from,mbox,msg_id,replyto; |
70 | int msg_number,msg_size; | 70 | int msg_number,msg_size; |
71 | QBitArray msg_flags; | 71 | QBitArray msg_flags; |
72 | QStringList to,cc,bcc; | 72 | QStringList to,cc,bcc; |
73 | AbstractMail*wrapper; | 73 | AbstractMail*wrapper; |
74 | void init(); | 74 | void init(); |
75 | void copy_old(const RecMail&old); | 75 | void copy_old(const RecMail&old); |
76 | }; | 76 | }; |
77 | 77 | ||
78 | typedef QMap<QString,QString> part_plist_t; | 78 | typedef QMap<QString,QString> part_plist_t; |
79 | 79 | ||
80 | class RecPart | 80 | class RecPart |
81 | { | 81 | { |
82 | protected: | 82 | protected: |
83 | QString m_type,m_subtype,m_identifier,m_encoding,m_description; | 83 | QString m_type,m_subtype,m_identifier,m_encoding,m_description; |
84 | unsigned int m_lines,m_size; | 84 | unsigned int m_lines,m_size; |
85 | part_plist_t m_Parameters; | 85 | part_plist_t m_Parameters; |
86 | /* describes the position in the mail */ | 86 | /* describes the position in the mail */ |
87 | QValueList<int> m_poslist; | 87 | QValueList<int> m_poslist; |
88 | 88 | ||
89 | public: | 89 | public: |
90 | RecPart(); | 90 | RecPart(); |
91 | virtual ~RecPart(); | 91 | virtual ~RecPart(); |
92 | 92 | ||
93 | const QString&Type()const; | 93 | const QString&Type()const; |
94 | void setType(const QString&type); | 94 | void setType(const QString&type); |
95 | const QString&Subtype()const; | 95 | const QString&Subtype()const; |
96 | void setSubtype(const QString&subtype); | 96 | void setSubtype(const QString&subtype); |
97 | const QString&Identifier()const; | 97 | const QString&Identifier()const; |
98 | void setIdentifier(const QString&identifier); | 98 | void setIdentifier(const QString&identifier); |
99 | const QString&Encoding()const; | 99 | const QString&Encoding()const; |
100 | void setEncoding(const QString&encoding); | 100 | void setEncoding(const QString&encoding); |
101 | const QString&Description()const; | 101 | const QString&Description()const; |
102 | void setDescription(const QString&desc); | 102 | void setDescription(const QString&desc); |
103 | void setLines(unsigned int lines); | 103 | void setLines(unsigned int lines); |
104 | const unsigned int Lines()const; | 104 | const unsigned int Lines()const; |
105 | void setSize(unsigned int size); | 105 | void setSize(unsigned int size); |
106 | const unsigned int Size()const; | 106 | const unsigned int Size()const; |
107 | 107 | ||
108 | 108 | ||
109 | void setParameters(const part_plist_t&list); | 109 | void setParameters(const part_plist_t&list); |
110 | const part_plist_t&Parameters()const; | 110 | const part_plist_t&Parameters()const; |
111 | void addParameter(const QString&key,const QString&value); | 111 | void addParameter(const QString&key,const QString&value); |
112 | const QString searchParamter(const QString&key)const; | 112 | const QString searchParamter(const QString&key)const; |
113 | void setPositionlist(const QValueList<int>&poslist); | 113 | void setPositionlist(const QValueList<int>&poslist); |
114 | const QValueList<int>& Positionlist()const; | 114 | const QValueList<int>& Positionlist()const; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | class RecBody | 117 | class RecBody |
118 | { | 118 | { |
119 | protected: | 119 | protected: |
120 | QString m_BodyText; | 120 | QString m_BodyText; |
121 | QValueList<RecPart> m_PartsList; | 121 | QValueList<RecPart> m_PartsList; |
122 | RecPart m_description; | 122 | RecPart m_description; |
123 | 123 | ||
124 | public: | 124 | public: |
125 | RecBody(); | 125 | RecBody(); |
126 | virtual ~RecBody(); | 126 | virtual ~RecBody(); |
127 | void setBodytext(const QString&); | 127 | void setBodytext(const QString&); |
128 | const QString& Bodytext()const; | 128 | const QString& Bodytext()const; |
129 | 129 | ||
130 | void setDescription(const RecPart&des); | 130 | void setDescription(const RecPart&des); |
131 | const RecPart& Description()const; | 131 | const RecPart& Description()const; |
132 | 132 | ||
133 | void setParts(const QValueList<RecPart>&parts); | 133 | void setParts(const QValueList<RecPart>&parts); |
134 | const QValueList<RecPart>& Parts()const; | 134 | const QValueList<RecPart>& Parts()const; |
135 | void addPart(const RecPart&part); | 135 | void addPart(const RecPart&part); |
136 | }; | 136 | }; |
137 | 137 | ||
138 | class encodedString | 138 | class encodedString |
139 | { | 139 | { |
140 | public: | 140 | public: |
141 | encodedString(); | 141 | encodedString(); |
142 | /* | 142 | /* |
143 | creates an new content string. | 143 | creates an new content string. |
144 | it makes a deep copy of it! | 144 | it makes a deep copy of it! |
145 | */ | 145 | */ |
146 | encodedString(const char*nContent,unsigned int length); | 146 | encodedString(const char*nContent,unsigned int length); |
147 | /* | 147 | /* |
148 | Take over the nContent. Means: it will just copy the pointer, not the content. | 148 | Take over the nContent. Means: it will just copy the pointer, not the content. |
149 | so make sure: No one else frees the string, the string has allocated with | 149 | so make sure: No one else frees the string, the string has allocated with |
150 | malloc for compatibility with c-based libs | 150 | malloc for compatibility with c-based libs |
151 | */ | 151 | */ |
152 | encodedString(char*nContent,unsigned int nSize); | 152 | encodedString(char*nContent,unsigned int nSize); |
153 | /* copy construkor - makes ALWAYS a deep copy!!!! */ | 153 | /* copy construkor - makes ALWAYS a deep copy!!!! */ |
154 | encodedString(const encodedString&old); | 154 | encodedString(const encodedString&old); |
155 | /* assign operator - makes ALWAYS a deep copy!!!! */ | 155 | /* assign operator - makes ALWAYS a deep copy!!!! */ |
156 | encodedString& operator=(const encodedString&old); | 156 | encodedString& operator=(const encodedString&old); |
157 | /* destructor - cleans the content */ | 157 | /* destructor - cleans the content */ |
158 | virtual ~encodedString(); | 158 | virtual ~encodedString(); |
159 | 159 | ||
160 | /* returns a pointer to the content - do not delete yoursel! */ | 160 | /* returns a pointer to the content - do not delete yoursel! */ |
161 | const char*Content()const; | 161 | const char*Content()const; |
162 | /* returns the lengths of the content 'cause it must not be a null-terminated string! */ | 162 | /* returns the lengths of the content 'cause it must not be a null-terminated string! */ |
163 | const int Length()const; | 163 | const int Length()const; |
164 | 164 | ||
165 | /* | 165 | /* |
166 | makes a deep copy of nContent! | 166 | makes a deep copy of nContent! |
167 | */ | 167 | */ |
168 | void setContent(const char*nContent,int nSize); | 168 | void setContent(const char*nContent,int nSize); |
169 | /* | 169 | /* |
170 | Take over the nContent. Means: it will just copy the pointer, not the content. | 170 | Take over the nContent. Means: it will just copy the pointer, not the content. |
171 | so make sure: No one else frees the string, the string has allocated with | 171 | so make sure: No one else frees the string, the string has allocated with |
172 | malloc for compatibility with c-based libs | 172 | malloc for compatibility with c-based libs |
173 | */ | 173 | */ |
174 | void setContent(char*nContent,int nSize); | 174 | void setContent(char*nContent,int nSize); |
175 | 175 | ||
176 | protected: | 176 | protected: |
177 | char * content; | 177 | char * content; |
178 | unsigned int size; | 178 | unsigned int size; |
179 | 179 | ||
180 | void init(); | 180 | void init(); |
181 | void copy_old(const encodedString&old); | 181 | void copy_old(const encodedString&old); |
182 | void clean(); | 182 | void clean(); |
183 | }; | 183 | }; |
184 | 184 | ||
185 | struct folderStat | 185 | struct folderStat |
186 | { | 186 | { |
187 | unsigned int message_count; | 187 | unsigned int message_count; |
188 | unsigned int message_unseen; | 188 | unsigned int message_unseen; |
189 | unsigned int message_recent; | 189 | unsigned int message_recent; |
190 | folderStat&operator=(const folderStat&old); | ||
190 | }; | 191 | }; |
191 | 192 | ||
192 | #endif | 193 | #endif |
diff --git a/noncore/net/mail/libmailwrapper/statusmail.cpp b/noncore/net/mail/libmailwrapper/statusmail.cpp index 98f6204..1d7d559 100644 --- a/noncore/net/mail/libmailwrapper/statusmail.cpp +++ b/noncore/net/mail/libmailwrapper/statusmail.cpp | |||
@@ -1,89 +1,91 @@ | |||
1 | #include "statusmail.h" | 1 | #include "statusmail.h" |
2 | #include <qlist.h> | 2 | #include <qlist.h> |
3 | 3 | ||
4 | StatusMail::StatusMail(QList<Account>&list) | 4 | StatusMail::StatusMail(QList<Account>&list) |
5 | { | 5 | { |
6 | currentImapStat.message_count=0; | 6 | currentImapStat.message_count=0; |
7 | currentImapStat.message_unseen=0; | 7 | currentImapStat.message_unseen=0; |
8 | currentImapStat.message_recent=0; | 8 | currentImapStat.message_recent=0; |
9 | lastPop3Stat = currentImapStat; | 9 | lastPop3Stat = currentImapStat; |
10 | currentPop3Stat = currentImapStat; | 10 | currentPop3Stat = currentImapStat; |
11 | connectionList.setAutoDelete(true); | 11 | connectionList.setAutoDelete(true); |
12 | connectionList.clear(); | 12 | connectionList.clear(); |
13 | initAccounts(list); | 13 | initAccounts(list); |
14 | } | 14 | } |
15 | 15 | ||
16 | StatusMail::~StatusMail() | 16 | StatusMail::~StatusMail() |
17 | { | 17 | { |
18 | } | 18 | } |
19 | 19 | ||
20 | void StatusMail::initAccounts(QList<Account>&accounts) | 20 | void StatusMail::initAccounts(QList<Account>&accounts) |
21 | { | 21 | { |
22 | 22 | ||
23 | Account *it; | 23 | Account *it; |
24 | folderStat currentStat; | 24 | folderStat currentStat; |
25 | AbstractMail * current = 0; | 25 | AbstractMail * current = 0; |
26 | currentPop3Stat.message_count=0; | 26 | currentPop3Stat.message_count=0; |
27 | currentPop3Stat.message_recent=0; | 27 | currentPop3Stat.message_recent=0; |
28 | currentPop3Stat.message_unseen=0; | 28 | currentPop3Stat.message_unseen=0; |
29 | for ( it = accounts.first(); it; it = accounts.next() ) { | 29 | for ( it = accounts.first(); it; it = accounts.next() ) { |
30 | if ( it->getType().compare( "IMAP" ) == 0 ) { | 30 | if ( it->getType().compare( "IMAP" ) == 0 ) { |
31 | IMAPaccount*ima = static_cast<IMAPaccount *>(it); | 31 | IMAPaccount*ima = static_cast<IMAPaccount *>(it); |
32 | current = AbstractMail::getWrapper(ima); | 32 | current = AbstractMail::getWrapper(ima); |
33 | connectionList.append(current); | 33 | connectionList.append(current); |
34 | current->statusFolder(currentStat); | 34 | current->statusFolder(currentStat); |
35 | currentImapStat.message_count+=currentStat.message_unseen; | 35 | currentImapStat.message_count+=currentStat.message_unseen; |
36 | currentImapStat.message_count+=currentStat.message_recent; | 36 | currentImapStat.message_count+=currentStat.message_recent; |
37 | currentImapStat.message_count+=currentStat.message_count; | 37 | currentImapStat.message_count+=currentStat.message_count; |
38 | } else if ( it->getType().compare( "POP3" ) == 0 ) { | 38 | } else if ( it->getType().compare( "POP3" ) == 0 ) { |
39 | POP3account *pop3 = static_cast<POP3account *>(it); | 39 | POP3account *pop3 = static_cast<POP3account *>(it); |
40 | current = AbstractMail::getWrapper(pop3); | 40 | current = AbstractMail::getWrapper(pop3); |
41 | connectionList.append(current); | 41 | connectionList.append(current); |
42 | current->statusFolder(currentStat); | 42 | current->statusFolder(currentStat); |
43 | currentPop3Stat.message_count+=currentStat.message_unseen; | ||
44 | currentPop3Stat.message_count+=currentStat.message_recent; | ||
45 | currentPop3Stat.message_count+=currentStat.message_count; | 43 | currentPop3Stat.message_count+=currentStat.message_count; |
46 | } | 44 | } |
47 | current->logout(); | 45 | current->logout(); |
48 | } | 46 | } |
49 | lastPop3Stat = currentPop3Stat; | 47 | qDebug("Pop3 init count: %i",currentPop3Stat.message_count); |
48 | currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0; | ||
49 | lastPop3Stat.message_unseen = currentPop3Stat.message_unseen; | ||
50 | lastPop3Stat.message_recent = currentPop3Stat.message_recent; | ||
51 | lastPop3Stat.message_count = currentPop3Stat.message_count; | ||
50 | } | 52 | } |
51 | 53 | ||
52 | void StatusMail::reset_status() | 54 | void StatusMail::reset_status() |
53 | { | 55 | { |
54 | lastPop3Stat = currentPop3Stat; | 56 | lastPop3Stat = currentPop3Stat; |
55 | } | 57 | } |
56 | 58 | ||
57 | void StatusMail::check_current_stat(folderStat&targetStat) | 59 | void StatusMail::check_current_stat(folderStat&targetStat) |
58 | { | 60 | { |
59 | AbstractMail*it = 0; | 61 | AbstractMail*it = 0; |
60 | folderStat currentStat; | 62 | folderStat currentStat; |
61 | currentPop3Stat.message_recent = 0; | 63 | currentPop3Stat.message_recent = 0; |
62 | currentPop3Stat.message_count = 0; | 64 | currentPop3Stat.message_count = 0; |
63 | currentPop3Stat.message_unseen = 0; | 65 | currentPop3Stat.message_unseen = 0; |
64 | currentImapStat = currentPop3Stat; | 66 | currentImapStat = currentPop3Stat; |
65 | for ( it = connectionList.first(); it; it = connectionList.next() ) { | 67 | for ( it = connectionList.first(); it; it = connectionList.next() ) { |
66 | it->statusFolder(currentStat); | 68 | it->statusFolder(currentStat); |
67 | it->logout(); | 69 | it->logout(); |
68 | if (it->getType().lower()=="imap") { | 70 | if (it->getType().lower()=="imap") { |
69 | currentImapStat.message_unseen+=currentStat.message_unseen; | 71 | currentImapStat.message_unseen+=currentStat.message_unseen; |
70 | currentImapStat.message_recent+=currentStat.message_recent; | 72 | currentImapStat.message_recent+=currentStat.message_recent; |
71 | currentImapStat.message_count+=currentStat.message_count; | 73 | currentImapStat.message_count+=currentStat.message_count; |
72 | } else if (it->getType().lower()=="pop3") { | 74 | } else if (it->getType().lower()=="pop3") { |
73 | currentPop3Stat.message_count+=currentStat.message_count; | 75 | currentPop3Stat.message_count+=currentStat.message_count; |
74 | qDebug("Pop3 count: %i",currentPop3Stat.message_count); | 76 | qDebug("Pop3 count: %i",currentPop3Stat.message_count); |
75 | } | 77 | } |
76 | } | 78 | } |
77 | qDebug("Pop3 last: %i",lastPop3Stat.message_count); | 79 | qDebug("Pop3 last: %i",lastPop3Stat.message_count); |
78 | if (currentPop3Stat.message_count > lastPop3Stat.message_count) { | 80 | if (currentPop3Stat.message_count > lastPop3Stat.message_count) { |
79 | currentPop3Stat.message_recent = currentPop3Stat.message_count - lastPop3Stat.message_count; | 81 | currentPop3Stat.message_recent = currentPop3Stat.message_count - lastPop3Stat.message_count; |
80 | currentPop3Stat.message_unseen = currentPop3Stat.message_recent; | 82 | currentPop3Stat.message_unseen = currentPop3Stat.message_recent; |
81 | } else { | 83 | } else { |
82 | lastPop3Stat.message_count = currentPop3Stat.message_count; | 84 | lastPop3Stat.message_count = currentPop3Stat.message_count; |
83 | currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0; | 85 | currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0; |
84 | } | 86 | } |
85 | targetStat = currentImapStat; | 87 | targetStat = currentImapStat; |
86 | targetStat.message_unseen+=currentPop3Stat.message_unseen; | 88 | targetStat.message_unseen+=currentPop3Stat.message_unseen; |
87 | targetStat.message_recent+=currentPop3Stat.message_recent; | 89 | targetStat.message_recent+=currentPop3Stat.message_recent; |
88 | targetStat.message_count+=currentPop3Stat.message_count; | 90 | targetStat.message_count+=currentPop3Stat.message_count; |
89 | } | 91 | } |
diff --git a/noncore/net/mail/taskbarapplet/mailapplet.cpp b/noncore/net/mail/taskbarapplet/mailapplet.cpp index 991b5fb..6078013 100644 --- a/noncore/net/mail/taskbarapplet/mailapplet.cpp +++ b/noncore/net/mail/taskbarapplet/mailapplet.cpp | |||
@@ -1,139 +1,139 @@ | |||
1 | #include <qpainter.h> | 1 | #include <qpainter.h> |
2 | #include <qtimer.h> | 2 | #include <qtimer.h> |
3 | 3 | ||
4 | #include <qpe/qcopenvelope_qws.h> | 4 | #include <qpe/qcopenvelope_qws.h> |
5 | #include <qpe/resource.h> | 5 | #include <qpe/resource.h> |
6 | #include <qpe/config.h> | 6 | #include <qpe/config.h> |
7 | #include <qpe/applnk.h> | 7 | #include <qpe/applnk.h> |
8 | 8 | ||
9 | #include <opie/odevice.h> | 9 | #include <opie/odevice.h> |
10 | 10 | ||
11 | #include <libmailwrapper/settings.h> | 11 | #include <libmailwrapper/settings.h> |
12 | 12 | ||
13 | #include "mailapplet.h" | 13 | #include "mailapplet.h" |
14 | 14 | ||
15 | using namespace Opie; | 15 | using namespace Opie; |
16 | 16 | ||
17 | MailApplet::MailApplet( QWidget *parent ) | 17 | MailApplet::MailApplet( QWidget *parent ) |
18 | : QWidget( parent ) { | 18 | : QWidget( parent ) { |
19 | 19 | ||
20 | m_config = new Config( "mail" ); | 20 | m_config = new Config( "mail" ); |
21 | m_config->setGroup( "Applet" ); | 21 | m_config->setGroup( "Applet" ); |
22 | 22 | ||
23 | setFixedWidth( AppLnk::smallIconSize() ); | 23 | setFixedWidth( AppLnk::smallIconSize() ); |
24 | setFixedHeight( AppLnk::smallIconSize() ); | 24 | setFixedHeight( AppLnk::smallIconSize() ); |
25 | 25 | ||
26 | hide(); | 26 | hide(); |
27 | 27 | ||
28 | m_newMails = 0; | 28 | m_newMails = 0; |
29 | m_statusMail = 0l; | 29 | m_statusMail = 0l; |
30 | 30 | ||
31 | if ( !m_config->readBoolEntry( "Disabled", false ) ) { | 31 | if ( !m_config->readBoolEntry( "Disabled", false ) ) { |
32 | // delay 5 sec until the whole mail backend gets started .-) | 32 | // delay 5 sec until the whole mail backend gets started .-) |
33 | QTimer::singleShot( 5000, this, SLOT( startup() ) ); | 33 | QTimer::singleShot( 5000, this, SLOT( startup() ) ); |
34 | } | 34 | } |
35 | repaint( true ); | 35 | repaint( true ); |
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | ||
39 | MailApplet::~MailApplet() { | 39 | MailApplet::~MailApplet() { |
40 | if ( m_statusMail ) | 40 | if ( m_statusMail ) |
41 | delete m_statusMail; | 41 | delete m_statusMail; |
42 | if ( m_config ) | 42 | if ( m_config ) |
43 | delete m_config; | 43 | delete m_config; |
44 | } | 44 | } |
45 | 45 | ||
46 | void MailApplet::paintEvent( QPaintEvent* ) { | 46 | void MailApplet::paintEvent( QPaintEvent* ) { |
47 | QPainter p( this ); | 47 | QPainter p( this ); |
48 | p.drawPixmap( 0, 0, Resource::loadPixmap( "mail/inbox" ) ); | 48 | p.drawPixmap( 0, 0, Resource::loadPixmap( "mail/inbox" ) ); |
49 | QFont f( "vera", AppLnk::smallIconSize() ); | 49 | QFont f( "vera", AppLnk::smallIconSize() ); |
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 | // m_statusMails->reset_status(); | 73 | if (m_statusMail) m_statusMail->reset_status(); |
74 | } | 74 | } |
75 | 75 | ||
76 | void MailApplet::startup() { | 76 | void MailApplet::startup() { |
77 | Settings *settings = new Settings(); | 77 | Settings *settings = new Settings(); |
78 | QList<Account> ma = settings->getAccounts(); | 78 | QList<Account> ma = settings->getAccounts(); |
79 | m_statusMail = new StatusMail( ma ); | 79 | m_statusMail = new StatusMail( ma ); |
80 | delete settings; | 80 | delete settings; |
81 | 81 | ||
82 | m_intervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; | 82 | m_intervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; |
83 | m_intervalTimer = new QTimer(); | 83 | m_intervalTimer = new QTimer(); |
84 | m_intervalTimer->start( m_intervalMs ); | 84 | m_intervalTimer->start( m_intervalMs ); |
85 | connect( m_intervalTimer, SIGNAL( timeout() ), this, SLOT( slotCheck() ) ); | 85 | connect( m_intervalTimer, SIGNAL( timeout() ), this, SLOT( slotCheck() ) ); |
86 | } | 86 | } |
87 | 87 | ||
88 | void MailApplet::slotCheck() { | 88 | void MailApplet::slotCheck() { |
89 | // Check wether the check interval has been changed. | 89 | // Check wether the check interval has been changed. |
90 | int newIntervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; | 90 | int newIntervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; |
91 | if ( newIntervalMs != m_intervalMs ) { | 91 | if ( newIntervalMs != m_intervalMs ) { |
92 | m_intervalTimer->changeInterval( newIntervalMs ); | 92 | m_intervalTimer->changeInterval( newIntervalMs ); |
93 | m_intervalMs = newIntervalMs; | 93 | m_intervalMs = newIntervalMs; |
94 | } | 94 | } |
95 | 95 | ||
96 | if (m_statusMail == 0) { | 96 | if (m_statusMail == 0) { |
97 | return; | 97 | return; |
98 | } | 98 | } |
99 | 99 | ||
100 | folderStat stat; | 100 | folderStat stat; |
101 | m_statusMail->check_current_stat( stat ); | 101 | m_statusMail->check_current_stat( stat ); |
102 | m_newMails = stat.message_unseen; | 102 | m_newMails = stat.message_unseen; |
103 | qDebug( QString( "test %1" ).arg( m_newMails ) ); | 103 | qDebug( QString( "test %1" ).arg( m_newMails ) ); |
104 | if ( m_newMails > 0 ) { | 104 | if ( m_newMails > 0 ) { |
105 | ODevice *device = ODevice::inst(); | 105 | ODevice *device = ODevice::inst(); |
106 | if ( isHidden() ) | 106 | if ( isHidden() ) |
107 | show(); | 107 | show(); |
108 | if ( m_config->readBoolEntry( "BlinkLed", true ) ) { | 108 | if ( m_config->readBoolEntry( "BlinkLed", true ) ) { |
109 | if ( !device->ledList().isEmpty() ) { | 109 | if ( !device->ledList().isEmpty() ) { |
110 | OLed led = ( device->ledList().contains( Led_Mail ) ) ? Led_Mail : device->ledList()[0]; | 110 | OLed led = ( device->ledList().contains( Led_Mail ) ) ? Led_Mail : device->ledList()[0]; |
111 | device->setLedState( led, device->ledStateList( led ).contains( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On ); | 111 | device->setLedState( led, device->ledStateList( led ).contains( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On ); |
112 | } | 112 | } |
113 | } | 113 | } |
114 | if ( m_config->readBoolEntry( "PlaySound", false ) ) | 114 | if ( m_config->readBoolEntry( "PlaySound", false ) ) |
115 | device->alarmSound(); | 115 | device->alarmSound(); |
116 | 116 | ||
117 | Config cfg( "mail" ); | 117 | Config cfg( "mail" ); |
118 | cfg.setGroup( "Status" ); | 118 | cfg.setGroup( "Status" ); |
119 | cfg.writeEntry( "newMails", m_newMails ); | 119 | cfg.writeEntry( "newMails", m_newMails ); |
120 | QCopEnvelope env( "QPE/Pim", "newMails(int)" ); | 120 | QCopEnvelope env( "QPE/Pim", "newMails(int)" ); |
121 | env << m_newMails; | 121 | env << m_newMails; |
122 | repaint( true ); | 122 | repaint( true ); |
123 | 123 | ||
124 | } else { | 124 | } else { |
125 | ODevice *device = ODevice::inst(); | 125 | ODevice *device = ODevice::inst(); |
126 | if ( !isHidden() ) | 126 | if ( !isHidden() ) |
127 | hide(); | 127 | hide(); |
128 | if ( !device->ledList().isEmpty() ) { | 128 | if ( !device->ledList().isEmpty() ) { |
129 | OLed led = ( device->ledList().contains( Led_Mail ) ) ? Led_Mail : device->ledList()[0]; | 129 | OLed led = ( device->ledList().contains( Led_Mail ) ) ? Led_Mail : device->ledList()[0]; |
130 | device->setLedState( led, Led_Off ); | 130 | device->setLedState( led, Led_Off ); |
131 | } | 131 | } |
132 | 132 | ||
133 | Config cfg( "mail" ); | 133 | Config cfg( "mail" ); |
134 | cfg.setGroup( "Status" ); | 134 | cfg.setGroup( "Status" ); |
135 | cfg.writeEntry( "newMails", m_newMails ); | 135 | cfg.writeEntry( "newMails", m_newMails ); |
136 | QCopEnvelope env( "QPE/Pim", "newMails(int)" ); | 136 | QCopEnvelope env( "QPE/Pim", "newMails(int)" ); |
137 | env << m_newMails; | 137 | env << m_newMails; |
138 | } | 138 | } |
139 | } | 139 | } |