Diffstat (limited to 'noncore/net/mail/libmailwrapper/mboxwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index 11ffd92..abe4bb6 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |||
@@ -1,34 +1,32 @@ | |||
1 | #include "mboxwrapper.h" | 1 | #include "mboxwrapper.h" |
2 | #include "mailtypes.h" | 2 | #include "mailtypes.h" |
3 | #include "mailwrapper.h" | 3 | #include "mailwrapper.h" |
4 | #include <libetpan/libetpan.h> | 4 | #include <libetpan/libetpan.h> |
5 | #include <qdir.h> | 5 | #include <qdir.h> |
6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
7 | #include <qpe/global.h> | 7 | #include <qpe/global.h> |
8 | 8 | ||
9 | const MAILLIB::ATYPE MBOXwrapper::wrapperType=MAILLIB::MBOX; | ||
10 | |||
11 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) | 9 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) |
12 | : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name) | 10 | : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name) |
13 | { | 11 | { |
14 | QDir dir(MBOXPath); | 12 | QDir dir(MBOXPath); |
15 | if (!dir.exists()) { | 13 | if (!dir.exists()) { |
16 | dir.mkdir(MBOXPath); | 14 | dir.mkdir(MBOXPath); |
17 | } | 15 | } |
18 | } | 16 | } |
19 | 17 | ||
20 | MBOXwrapper::~MBOXwrapper() | 18 | MBOXwrapper::~MBOXwrapper() |
21 | { | 19 | { |
22 | } | 20 | } |
23 | 21 | ||
24 | void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | 22 | void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) |
25 | { | 23 | { |
26 | mailstorage*storage = mailstorage_new(NULL); | 24 | mailstorage*storage = mailstorage_new(NULL); |
27 | QString p = MBOXPath+"/"; | 25 | QString p = MBOXPath+"/"; |
28 | p+=mailbox; | 26 | p+=mailbox; |
29 | 27 | ||
30 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 28 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
31 | mailfolder*folder; | 29 | mailfolder*folder; |
32 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 30 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
33 | r = mailfolder_connect(folder); | 31 | r = mailfolder_connect(folder); |
34 | if (r != MAIL_NO_ERROR) { | 32 | if (r != MAIL_NO_ERROR) { |
@@ -307,31 +305,31 @@ int MBOXwrapper::deleteMbox(const Folder*tfolder) | |||
307 | void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | 305 | void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) |
308 | { | 306 | { |
309 | mailfolder*folder = 0; | 307 | mailfolder*folder = 0; |
310 | mailstorage*storage = mailstorage_new(NULL); | 308 | mailstorage*storage = mailstorage_new(NULL); |
311 | target_stat.message_count = 0; | 309 | target_stat.message_count = 0; |
312 | target_stat.message_unseen = 0; | 310 | target_stat.message_unseen = 0; |
313 | target_stat.message_recent = 0; | 311 | target_stat.message_recent = 0; |
314 | QString p = MBOXPath+"/"+mailbox; | 312 | QString p = MBOXPath+"/"+mailbox; |
315 | QFile fi(p); | 313 | QFile fi(p); |
316 | if (!fi.exists()) { | 314 | if (!fi.exists()) { |
317 | Global::statusMessage(tr("Mailbox doesn't exist.")); | 315 | Global::statusMessage(tr("Mailbox doesn't exist.")); |
318 | return; | 316 | return; |
319 | } | 317 | } |
320 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 318 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
321 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 319 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
322 | r = mailfolder_connect(folder); | 320 | r = mailfolder_connect(folder); |
323 | r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, | 321 | r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, |
324 | &target_stat.message_recent,&target_stat.message_unseen); | 322 | &target_stat.message_recent,&target_stat.message_unseen); |
325 | if (folder) mailfolder_free(folder); | 323 | if (folder) mailfolder_free(folder); |
326 | if (storage) mailstorage_free(storage); | 324 | if (storage) mailstorage_free(storage); |
327 | } | 325 | } |
328 | 326 | ||
329 | MAILLIB::ATYPE MBOXwrapper::getType()const | 327 | MAILLIB::ATYPE MBOXwrapper::getType()const |
330 | { | 328 | { |
331 | return wrapperType; | 329 | return MAILLIB::A_MBOX; |
332 | } | 330 | } |
333 | 331 | ||
334 | const QString&MBOXwrapper::getName()const | 332 | const QString&MBOXwrapper::getName()const |
335 | { | 333 | { |
336 | return MBOXName; | 334 | return MBOXName; |
337 | } | 335 | } |