author | zautrix <zautrix> | 2005-01-24 18:05:48 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-24 18:05:48 (UTC) |
commit | 77f93c632b66b5c8d92e4c63330362272ca1fc40 (patch) (unidiff) | |
tree | 31f28656062c899b5368f13ab594ff6fa5c657fa /kmicromail/opiemail.cpp | |
parent | 6c89efd80c1e94a0c070025d07c7a4c656f2a81e (diff) | |
download | kdepimpi-77f93c632b66b5c8d92e4c63330362272ca1fc40.zip kdepimpi-77f93c632b66b5c8d92e4c63330362272ca1fc40.tar.gz kdepimpi-77f93c632b66b5c8d92e4c63330362272ca1fc40.tar.bz2 |
mail fixes
-rw-r--r-- | kmicromail/opiemail.cpp | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 6e54bf4..760e3b0 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -20,8 +20,9 @@ | |||
20 | #include "viewmail.h" | 20 | #include "viewmail.h" |
21 | #include "selectstore.h" | 21 | #include "selectstore.h" |
22 | #include "selectsmtp.h" | 22 | #include "selectsmtp.h" |
23 | #include "accountitem.h" | 23 | #include "accountitem.h" |
24 | #include "accountview.h" | ||
24 | #include "klocale.h" | 25 | #include "klocale.h" |
25 | 26 | ||
26 | #include <qmessagebox.h> | 27 | #include <qmessagebox.h> |
27 | #include <qtimer.h> | 28 | #include <qtimer.h> |
@@ -312,9 +313,44 @@ void OpieMail::closeViewMail(ViewMail * vm) | |||
312 | } | 313 | } |
313 | 314 | ||
314 | void OpieMail::slotDownloadMail( ) | 315 | void OpieMail::slotDownloadMail( ) |
315 | { | 316 | { |
316 | qDebug("slotDownloadMail( ) "); | 317 | QListViewItem*item = mailView->currentItem(); |
318 | if (!item ) { | ||
319 | Global::statusMessage("Error: No item slected!"); | ||
320 | return; | ||
321 | } | ||
322 | RecMailP mail = ((MailListViewItem*)item)->data(); | ||
323 | Account * acc = mail->Wrapper()->getAccount(); | ||
324 | if ( !acc ) { | ||
325 | Global::statusMessage("Mail is already stored locally!"); | ||
326 | return; | ||
327 | } | ||
328 | QString lfName = acc->getLocalFolder(); | ||
329 | //qDebug("local folder " + lfName ); | ||
330 | if ( lfName.isEmpty() ) | ||
331 | lfName = acc->getAccountName(); | ||
332 | AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper(); | ||
333 | //qDebug("target %d %d ",targetMail,mail->Wrapper() ); | ||
334 | if ( targetMail == mail->Wrapper() ) { | ||
335 | Global::statusMessage("Mail is already locally stored!"); | ||
336 | return; | ||
337 | } | ||
338 | if ( !targetMail->createMbox(lfName)) { | ||
339 | Global::statusMessage("Error creating folder!"); | ||
340 | return; | ||
341 | } | ||
342 | Global::statusMessage("Fetching mail...please wait!"); | ||
343 | qApp->processEvents(); | ||
344 | encodedString*st = 0; | ||
345 | st = mail->Wrapper()->fetchRawBody(mail); | ||
346 | if ( st ) { | ||
347 | targetMail->storeMessage(st->Content(),st->Length(),lfName); | ||
348 | Global::statusMessage("Mail stored in "+ lfName); | ||
349 | delete st; | ||
350 | } else { | ||
351 | Global::statusMessage("Error: Cannot fetch mail!"); | ||
352 | } | ||
317 | } | 353 | } |
318 | 354 | ||
319 | 355 | ||
320 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) | 356 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) |