-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index a6688ed..8150453 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -56,33 +56,33 @@ void IMAPwrapper::imap_progress( size_t current, size_t maximum ) | |||
56 | last = current; | 56 | last = current; |
57 | } | 57 | } |
58 | void IMAPwrapper::progress( QString m ) | 58 | void IMAPwrapper::progress( QString m ) |
59 | { | 59 | { |
60 | 60 | ||
61 | static QString mProgrMess; | 61 | static QString mProgrMess; |
62 | if ( m != QString::null ) { | 62 | if ( m != QString::null ) { |
63 | mProgrMess = m; | 63 | mProgrMess = m; |
64 | mCurrent = 1; | 64 | mCurrent = 1; |
65 | return; | 65 | return; |
66 | } | 66 | } |
67 | QString mess; | 67 | QString mess; |
68 | //qDebug("progress "); | 68 | //qDebug("progress "); |
69 | if ( mMax ) mess = mProgrMess +tr(" message %1 of %2").arg( mCurrent++).arg(mMax); | 69 | if ( mMax ) mess = mProgrMess +tr(" message %1 of %2").arg( mCurrent++).arg(mMax); |
70 | else mess = mProgrMess +tr(" message %1").arg( mCurrent++); | 70 | else mess = mProgrMess +tr(" message %1").arg( mCurrent++); |
71 | Global::statusMessage(mess); | 71 | Global::statusMessage(mess); |
72 | qDebug("Progress %s %s", mess.latin1(), m.latin1()); | 72 | //qDebug("Progress %s %s", mess.latin1(), m.latin1()); |
73 | qApp->processEvents(); | 73 | qApp->processEvents(); |
74 | } | 74 | } |
75 | bool IMAPwrapper::start_tls(bool force_tls) | 75 | bool IMAPwrapper::start_tls(bool force_tls) |
76 | { | 76 | { |
77 | int err; | 77 | int err; |
78 | bool try_tls; | 78 | bool try_tls; |
79 | mailimap_capability_data * cap_data = 0; | 79 | mailimap_capability_data * cap_data = 0; |
80 | 80 | ||
81 | err = mailimap_capability(m_imap,&cap_data); | 81 | err = mailimap_capability(m_imap,&cap_data); |
82 | if (err != MAILIMAP_NO_ERROR) { | 82 | if (err != MAILIMAP_NO_ERROR) { |
83 | Global::statusMessage("error getting capabilities!"); | 83 | Global::statusMessage("error getting capabilities!"); |
84 | return false; | 84 | return false; |
85 | } | 85 | } |
86 | clistiter * cur; | 86 | clistiter * cur; |
87 | for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) { | 87 | for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) { |
88 | struct mailimap_capability * cap; | 88 | struct mailimap_capability * cap; |
@@ -254,33 +254,33 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma | |||
254 | } | 254 | } |
255 | 255 | ||
256 | int last = m_imap->imap_selection_info->sel_exists; | 256 | int last = m_imap->imap_selection_info->sel_exists; |
257 | 257 | ||
258 | if (last == 0) { | 258 | if (last == 0) { |
259 | Global::statusMessage(tr("Mailbox has no mails")); | 259 | Global::statusMessage(tr("Mailbox has no mails")); |
260 | return; | 260 | return; |
261 | } else { | 261 | } else { |
262 | } | 262 | } |
263 | progress( tr("Fetch ")); | 263 | progress( tr("Fetch ")); |
264 | mMax = last; | 264 | mMax = last; |
265 | //qDebug("last %d ", last); | 265 | //qDebug("last %d ", last); |
266 | Global::statusMessage(tr("Fetching header list")); | 266 | Global::statusMessage(tr("Fetching header list")); |
267 | qApp->processEvents(); | 267 | qApp->processEvents(); |
268 | /* the range has to start at 1!!! not with 0!!!! */ | 268 | /* the range has to start at 1!!! not with 0!!!! */ |
269 | //LR the access to web.de imap server is no working with value 1 | 269 | //LR the access to web.de imap server is no working with value 1 |
270 | qDebug("interval %d - %d ", tryAgain, last-1+tryAgain ); | 270 | //qDebug("interval %d - %d ", tryAgain, last-1+tryAgain ); |
271 | set = mailimap_set_new_interval( tryAgain, last ); | 271 | set = mailimap_set_new_interval( tryAgain, last ); |
272 | fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); | 272 | fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); |
273 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope()); | 273 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope()); |
274 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags()); | 274 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags()); |
275 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate()); | 275 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate()); |
276 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size()); | 276 | mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size()); |
277 | 277 | ||
278 | err = mailimap_fetch( m_imap, set, fetchType, &result ); | 278 | err = mailimap_fetch( m_imap, set, fetchType, &result ); |
279 | mailimap_set_free( set ); | 279 | mailimap_set_free( set ); |
280 | mailimap_fetch_type_free( fetchType ); | 280 | mailimap_fetch_type_free( fetchType ); |
281 | 281 | ||
282 | QString date,subject,from; | 282 | QString date,subject,from; |
283 | 283 | ||
284 | if ( err == MAILIMAP_NO_ERROR ) { | 284 | if ( err == MAILIMAP_NO_ERROR ) { |
285 | tryAgain = -1; | 285 | tryAgain = -1; |
286 | mailimap_msg_att * msg_att; | 286 | mailimap_msg_att * msg_att; |
@@ -289,33 +289,33 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma | |||
289 | ++i; | 289 | ++i; |
290 | //qDebug("iii %d ",i); | 290 | //qDebug("iii %d ",i); |
291 | msg_att = (mailimap_msg_att*)current->data; | 291 | msg_att = (mailimap_msg_att*)current->data; |
292 | RecMail*m = parse_list_result(msg_att); | 292 | RecMail*m = parse_list_result(msg_att); |
293 | if (m) { | 293 | if (m) { |
294 | if ( maxSizeInKb == 0 || m->Msgsize()<=maxSizeInKb*1024 ) { | 294 | if ( maxSizeInKb == 0 || m->Msgsize()<=maxSizeInKb*1024 ) { |
295 | m->setNumber(i); | 295 | m->setNumber(i); |
296 | m->setMbox(mailbox); | 296 | m->setMbox(mailbox); |
297 | m->setWrapper(this); | 297 | m->setWrapper(this); |
298 | target.append(m); | 298 | target.append(m); |
299 | } | 299 | } |
300 | } | 300 | } |
301 | } | 301 | } |
302 | Global::statusMessage(tr("Mailbox has %1 mails").arg(target.count())); | 302 | Global::statusMessage(tr("Mailbox has %1 mails").arg(target.count())); |
303 | } else { | 303 | } else { |
304 | --tryAgain; | 304 | --tryAgain; |
305 | --tryAgain; | 305 | --tryAgain;//disabled tryagain by adding this line |
306 | if ( tryAgain < 0 ) | 306 | if ( tryAgain < 0 ) |
307 | Global::statusMessage(tr("Error fetching headers: %1").arg(m_imap->imap_response)); | 307 | Global::statusMessage(tr("Error fetching headers: %1").arg(m_imap->imap_response)); |
308 | else | 308 | else |
309 | qDebug("try again... "); | 309 | qDebug("try again... "); |
310 | } | 310 | } |
311 | 311 | ||
312 | if (result) mailimap_fetch_list_free(result); | 312 | if (result) mailimap_fetch_list_free(result); |
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() | 316 | QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() |
317 | { | 317 | { |
318 | const char *path, *mask; | 318 | const char *path, *mask; |
319 | int err = MAILIMAP_NO_ERROR; | 319 | int err = MAILIMAP_NO_ERROR; |
320 | clist *result = 0; | 320 | clist *result = 0; |
321 | clistcell *current = 0; | 321 | clistcell *current = 0; |