Diffstat (limited to 'noncore/net/mail/accountview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.cpp | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index eea021f..b7de7b9 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -8,4 +8,5 @@ | |||
8 | #include <qpopupmenu.h> | 8 | #include <qpopupmenu.h> |
9 | 9 | ||
10 | #define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} | ||
10 | /** | 11 | /** |
11 | * POP3 Account stuff | 12 | * POP3 Account stuff |
@@ -16,5 +17,12 @@ POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent ) | |||
16 | account = a; | 17 | account = a; |
17 | wrapper = AbstractMail::getWrapper( account ); | 18 | wrapper = AbstractMail::getWrapper( account ); |
18 | setPixmap( 0, PIXMAP_POP3FOLDER ); | 19 | SETPIX(PIXMAP_POP3FOLDER); |
20 | #if 0 | ||
21 | if (!account->getOffline()) { | ||
22 | setPixmap( 0, ); | ||
23 | } else { | ||
24 | setPixmap( 0, PIXMAP_OFFLINE ); | ||
25 | } | ||
26 | #endif | ||
19 | setText( 0, account->getAccountName() ); | 27 | setText( 0, account->getAccountName() ); |
20 | setOpen( true ); | 28 | setOpen( true ); |
@@ -33,4 +41,9 @@ AbstractMail *POP3viewItem::getWrapper() | |||
33 | void POP3viewItem::refresh( QList<RecMail> & ) | 41 | void POP3viewItem::refresh( QList<RecMail> & ) |
34 | { | 42 | { |
43 | refresh(); | ||
44 | } | ||
45 | |||
46 | void POP3viewItem::refresh() | ||
47 | { | ||
35 | if (account->getOffline()) return; | 48 | if (account->getOffline()) return; |
36 | QList<Folder> *folders = wrapper->listFolders(); | 49 | QList<Folder> *folders = wrapper->listFolders(); |
@@ -90,4 +103,6 @@ void POP3viewItem::setOnOffline() | |||
90 | account->setOffline(!account->getOffline()); | 103 | account->setOffline(!account->getOffline()); |
91 | account->save(); | 104 | account->save(); |
105 | SETPIX(PIXMAP_POP3FOLDER); | ||
106 | refresh(); | ||
92 | } | 107 | } |
93 | 108 | ||
@@ -179,5 +194,5 @@ IMAPviewItem::IMAPviewItem( IMAPaccount *a, AccountView *parent ) | |||
179 | account = a; | 194 | account = a; |
180 | wrapper = AbstractMail::getWrapper( account ); | 195 | wrapper = AbstractMail::getWrapper( account ); |
181 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 196 | SETPIX(PIXMAP_IMAPFOLDER); |
182 | setText( 0, account->getAccountName() ); | 197 | setText( 0, account->getAccountName() ); |
183 | setOpen( true ); | 198 | setOpen( true ); |
@@ -338,4 +353,5 @@ void IMAPviewItem::contextMenuSelected(int id) | |||
338 | account->setOffline(!account->getOffline()); | 353 | account->setOffline(!account->getOffline()); |
339 | account->save(); | 354 | account->save(); |
355 | SETPIX(PIXMAP_IMAPFOLDER); | ||
340 | refreshFolders(false); | 356 | refreshFolders(false); |
341 | break; | 357 | break; |
@@ -666,5 +682,4 @@ void AccountView::setupFolderselect(Selectstore*sels) | |||
666 | void AccountView::downloadMails(Folder*fromFolder,AbstractMail*fromWrapper) | 682 | void AccountView::downloadMails(Folder*fromFolder,AbstractMail*fromWrapper) |
667 | { | 683 | { |
668 | unsigned int i = 0; | ||
669 | AbstractMail*targetMail = 0; | 684 | AbstractMail*targetMail = 0; |
670 | QString targetFolder = ""; | 685 | QString targetFolder = ""; |
@@ -678,16 +693,13 @@ void AccountView::downloadMails(Folder*fromFolder,AbstractMail*fromWrapper) | |||
678 | return; | 693 | return; |
679 | } | 694 | } |
680 | 695 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) { | |
681 | QList<RecMail> t; | 696 | QMessageBox::critical(0,tr("Error creating new Folder"), |
682 | fromWrapper->listMessages(fromFolder->getName(),t); | 697 | tr("<center>Error while creating<br>new folder - breaking.</center>")); |
683 | encodedString*st = 0; | 698 | return; |
684 | for (i = 0; i < t.count();++i) { | ||
685 | RecMail*r = t.at(i); | ||
686 | st = fromWrapper->fetchRawBody(*r); | ||
687 | if (st) { | ||
688 | targetMail->storeMessage(st->Content(),st->Length(),targetFolder); | ||
689 | delete st; | ||
690 | } | ||
691 | } | 699 | } |
700 | qDebug("Targetfolder: %s",targetFolder.latin1()); | ||
701 | qDebug("Fromfolder: %s",fromFolder->getName().latin1()); | ||
702 | fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails()); | ||
703 | refreshCurrent(); | ||
692 | } | 704 | } |
693 | 705 | ||