summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/abstractmail.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/libmailwrapper/abstractmail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/abstractmail.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp
index 8f67566..88545f8 100644
--- a/kmicromail/libmailwrapper/abstractmail.cpp
+++ b/kmicromail/libmailwrapper/abstractmail.cpp
@@ -159,96 +159,97 @@ void AbstractMail::deleteMailList(const QValueList<RecMailP>&target)
RecMailP mail = (*target.at( iii ));
deleteMail(mail);
++iii;
}
}
void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targetMail )
{
//qDebug("AbstractMail::downloadNewMails %s ", fromFolder->getName().latin1());
// get local folder
Account * acc = getAccount();
if ( !acc ) return;
QString lfName = acc->getLocalFolder();
if ( lfName.isEmpty() )
lfName = acc->getAccountName();
// create local folder
if ( !targetMail->createMbox(lfName))
{
QMessageBox::critical(0,tr("Error creating new Folder"),
tr("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName));
return;
}
QValueList<RecMailP> t;
listMessages(fromFolder->getName(),t,acc->getMaxMailSize() );
if ( t.count() == 0 ) {
Global::statusMessage(tr("There are no new messages"));
return;
}
QValueList<RecMailP> e;
targetMail->listMessages(lfName,e,acc->getMaxMailSize() );
//qDebug("target has mails %d ", e.count());
QValueList<RecMailP> n;
int iii = 0;
int count = t.count();
while (iii < count ) {
RecMailP r = (*t.at( iii ));
bool found = false;
int jjj = 0;
int countE = e.count();
while (jjj < countE ) {
RecMailP re = (*e.at( jjj ));
if ( re->isEqual(r) ) {
found = true;
break;
}
++jjj;
}
if ( !found ) {
+ //qDebug("AAAdate *%s* ", r->isodate.latin1() );
n.append( r );
}
++iii;
}
if ( n.count() == 0 ) {
Global::statusMessage(tr("There are no new messages"));
return;
}
mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer());
Global::statusMessage(tr("Downloaded %1 messages").arg(n.count()));
#if 0
QValueList<RecMailP> t;
listMessages(fromFolder->getName(),t, maxSizeInKb);
mvcpMailList( t,targetFolder,targetWrapper,moveit);
#endif
}
void AbstractMail::mvcpAllMails(const FolderP&fromFolder,
const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb)
{
QValueList<RecMailP> t;
listMessages(fromFolder->getName(),t, maxSizeInKb);
mvcpMailList( t,targetFolder,targetWrapper,moveit);
}
void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t,
const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
{
encodedString*st = 0;
int iii = 0;
int count = t.count();
if ( count == 0 )
return;
// wel, processevents is qite strange, we need a widget for getting
// Global::statusMessage(tr("Copy2 message %1").arg(iii)); displaye
QProgressBar wid ( count );
wid.setCaption( tr("Copying ..."));
wid.show();
while (iii < count ) {
Global::statusMessage(tr("Copy message %1 of %2").arg(iii).arg(count));
wid.setProgress( iii );
wid.raise();
qApp->processEvents();
RecMailP r = (*t.at( iii ));
st = fetchRawBody(r);
if (st) {