-rw-r--r-- | kmicromail/accountview.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index 4ead545..85523b1 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp @@ -118,48 +118,75 @@ RecBodyP AccountView::fetchBody(const RecMailP&aMail) if (!item) return new RecBody(); AccountViewItem *view = static_cast<AccountViewItem *>(item); return view->fetchBody(aMail); } void AccountView::setupFolderselect(Selectstore*sels) { sels->showMaximized(); QStringList sFolders; unsigned int i = 0; for (i=0; i < mhAccounts.count();++i) { mhAccounts[i]->refresh(false); sFolders = mhAccounts[i]->subFolders(); sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); } for (i=0; i < imapAccounts.count();++i) { if (imapAccounts[i]->offline()) continue; imapAccounts[i]->refreshFolders(false); sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders()); } } +void AccountView::downloadMailsInbox(const FolderP&fromFolder,AbstractMail*fromWrapper) +{ + AbstractMail*targetMail = 0; + QString targetFolder = ""; + Selectstore sels; + setupFolderselect(&sels); + if (!sels.exec()) return; + targetMail = sels.currentMail(); + targetFolder = sels.currentFolder(); + if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || + targetFolder.isEmpty()) + { + return; + } + if (sels.newFolder() && !targetMail->createMbox(targetFolder)) + { + QMessageBox::critical(0,tr("Error creating new Folder"), + tr("<center>Error while creating<br>new folder - breaking.</center>")); + return; + } + int maxsize = 0; + if ( sels.useSize->isChecked()) + maxsize = sels.sizeSpinBox->value(); + + fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails(), maxsize); + refreshCurrent(); +} void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper) { AbstractMail*targetMail = 0; QString targetFolder = ""; Selectstore sels; setupFolderselect(&sels); if (!sels.exec()) return; targetMail = sels.currentMail(); targetFolder = sels.currentFolder(); if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || targetFolder.isEmpty()) { return; } if (sels.newFolder() && !targetMail->createMbox(targetFolder)) { QMessageBox::critical(0,tr("Error creating new Folder"), tr("<center>Error while creating<br>new folder - breaking.</center>")); return; } int maxsize = 0; if ( sels.useSize->isChecked()) maxsize = sels.sizeSpinBox->value(); |