summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/abstractmail.cpp
Unidiff
Diffstat (limited to 'kmicromail/libmailwrapper/abstractmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/abstractmail.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp
index ed5c898..870985e 100644
--- a/kmicromail/libmailwrapper/abstractmail.cpp
+++ b/kmicromail/libmailwrapper/abstractmail.cpp
@@ -163,48 +163,51 @@ void AbstractMail::deleteMailList(const QValueList<RecMailP>&target)
163 163
164void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targetMail ) 164void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targetMail )
165{ 165{
166 //qDebug("AbstractMail::downloadNewMails %s ", fromFolder->getName().latin1()); 166 //qDebug("AbstractMail::downloadNewMails %s ", fromFolder->getName().latin1());
167 // get local folder 167 // get local folder
168 Account * acc = getAccount(); 168 Account * acc = getAccount();
169 if ( !acc ) return; 169 if ( !acc ) return;
170 QString lfName = acc->getLocalFolder(); 170 QString lfName = acc->getLocalFolder();
171 if ( lfName.isEmpty() ) 171 if ( lfName.isEmpty() )
172 lfName = acc->getAccountName(); 172 lfName = acc->getAccountName();
173 // create local folder 173 // create local folder
174 if ( !targetMail->createMbox(lfName)) 174 if ( !targetMail->createMbox(lfName))
175 { 175 {
176 QMessageBox::critical(0,i18n("Error creating new Folder"), 176 QMessageBox::critical(0,i18n("Error creating new Folder"),
177 i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); 177 i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName));
178 return; 178 return;
179 } 179 }
180 QValueList<RecMailP> t; 180 QValueList<RecMailP> t;
181 listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); 181 listMessages(fromFolder->getName(),t,acc->getMaxMailSize() );
182 if ( t.count() == 0 ) { 182 if ( t.count() == 0 ) {
183 qDebug("There are no new messages %s", fromFolder->getName().latin1()); 183 qDebug("There are no new messages %s", fromFolder->getName().latin1());
184 Global::statusMessage(i18n("There are no new messages")); 184 Global::statusMessage(i18n("There are no new messages"));
185 return; 185 return;
186 } 186 }
187 Global::statusMessage(i18n("%1 :Downloading mails..."). arg(acc->getAccountName()));
188 qDebug(i18n("%1 :Downloading mails..."). arg(acc->getAccountName()));
189 qApp->processEvents();
187 QValueList<RecMailP> e; 190 QValueList<RecMailP> e;
188 targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); 191 targetMail->listMessages(lfName,e,acc->getMaxMailSize() );
189 //qDebug("target has mails %d ", e.count()); 192 //qDebug("target has mails %d ", e.count());
190 QValueList<RecMailP> n; 193 QValueList<RecMailP> n;
191 int iii = 0; 194 int iii = 0;
192 int count = t.count(); 195 int count = t.count();
193 while (iii < count ) { 196 while (iii < count ) {
194 RecMailP r = (*t.at( iii )); 197 RecMailP r = (*t.at( iii ));
195 bool found = false; 198 bool found = false;
196 int jjj = 0; 199 int jjj = 0;
197 int countE = e.count(); 200 int countE = e.count();
198 while (jjj < countE ) { 201 while (jjj < countE ) {
199 RecMailP re = (*e.at( jjj )); 202 RecMailP re = (*e.at( jjj ));
200 if ( re->isEqual(r) ) { 203 if ( re->isEqual(r) ) {
201 found = true; 204 found = true;
202 break; 205 break;
203 } 206 }
204 ++jjj; 207 ++jjj;
205 } 208 }
206 if ( !found ) { 209 if ( !found ) {
207 //qDebug("AAAdate *%s* ", r->isodate.latin1() ); 210 //qDebug("AAAdate *%s* ", r->isodate.latin1() );
208 n.append( r ); 211 n.append( r );
209 } 212 }
210 ++iii; 213 ++iii;