author | alwin <alwin> | 2004-01-03 18:39:24 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-01-03 18:39:24 (UTC) |
commit | 8dd96feb25472a8c4f8e6b3f9b0553f83c6e3000 (patch) (unidiff) | |
tree | f4f6b9eee00e1b687bfb90bd58949319cf46ec88 /noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |
parent | 27b84ed363fd7fc52092e3c2d1e49dca079b7ffd (diff) | |
download | opie-8dd96feb25472a8c4f8e6b3f9b0553f83c6e3000.zip opie-8dd96feb25472a8c4f8e6b3f9b0553f83c6e3000.tar.gz opie-8dd96feb25472a8c4f8e6b3f9b0553f83c6e3000.tar.bz2 |
status methods for mailfolder implemented
Diffstat (limited to 'noncore/net/mail/libmailwrapper/mboxwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index 0aa33dd..540a971 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |||
@@ -298,6 +298,27 @@ int MBOXwrapper::deleteMbox(const Folder*tfolder) | |||
298 | Global::statusMessage(tr("Error deleting Mailbox.")); | 298 | Global::statusMessage(tr("Error deleting Mailbox.")); |
299 | return 0; | 299 | return 0; |
300 | } | 300 | } |
301 | return 1; | 301 | return 1; |
302 | } | 302 | } |
303 | 303 | ||
304 | void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | ||
305 | { | ||
306 | mailfolder*folder = 0; | ||
307 | mailstorage*storage = mailstorage_new(NULL); | ||
308 | target_stat.message_count = 0; | ||
309 | target_stat.message_unseen = 0; | ||
310 | target_stat.message_recent = 0; | ||
311 | QString p = MBOXPath+"/"+mailbox; | ||
312 | QFile fi(p); | ||
313 | if (!fi.exists()) { | ||
314 | Global::statusMessage(tr("Mailbox doesn't exist.")); | ||
315 | return; | ||
316 | } | ||
317 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | ||
318 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | ||
319 | r = mailfolder_connect(folder); | ||
320 | r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, | ||
321 | &target_stat.message_recent,&target_stat.message_unseen); | ||
322 | if (folder) mailfolder_free(folder); | ||
323 | if (storage) mailstorage_free(storage); | ||
324 | } | ||