-rw-r--r-- | kmicromail/libmailwrapper/abstractmail.cpp | 13 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 5 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/pop3wrapper.cpp | 12 |
3 files changed, 23 insertions, 7 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp index 44878e0..8f67566 100644 --- a/kmicromail/libmailwrapper/abstractmail.cpp +++ b/kmicromail/libmailwrapper/abstractmail.cpp | |||
@@ -119,68 +119,70 @@ QString AbstractMail::gen_attachment_id() | |||
119 | 119 | ||
120 | return "{" + stream.read().stripWhiteSpace() + "}"; | 120 | return "{" + stream.read().stripWhiteSpace() + "}"; |
121 | } | 121 | } |
122 | 122 | ||
123 | int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool) | 123 | int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool) |
124 | { | 124 | { |
125 | return 0; | 125 | return 0; |
126 | } | 126 | } |
127 | 127 | ||
128 | QString AbstractMail::defaultLocalfolder() | 128 | QString AbstractMail::defaultLocalfolder() |
129 | { | 129 | { |
130 | // QString f = getenv( "HOME" ); | 130 | // QString f = getenv( "HOME" ); |
131 | QString f = locateLocal( "data", "kopiemail/localmail"); | 131 | QString f = locateLocal( "data", "kopiemail/localmail"); |
132 | // f += "/Applications/opiemail/localmail"; | 132 | // f += "/Applications/opiemail/localmail"; |
133 | return f; | 133 | return f; |
134 | } | 134 | } |
135 | 135 | ||
136 | QString AbstractMail::draftFolder() | 136 | QString AbstractMail::draftFolder() |
137 | { | 137 | { |
138 | return QString("Drafts"); | 138 | return QString("Drafts"); |
139 | } | 139 | } |
140 | 140 | ||
141 | /* temporary - will be removed when implemented in all classes */ | 141 | /* temporary - will be removed when implemented in all classes */ |
142 | void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &) | 142 | void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &) |
143 | { | 143 | { |
144 | } | 144 | } |
145 | void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) | 145 | void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) |
146 | { | 146 | { |
147 | //qDebug("AbstractMail::deleteMailList:: Please reimplement! "); | 147 | //qDebug("AbstractMail::deleteMailList:: Please reimplement! "); |
148 | // this is currently re-implemented in pop3wrapper and imapwrapper | 148 | // this is currently re-implemented in pop3wrapper and imapwrapper |
149 | int iii = 0; | 149 | int iii = 0; |
150 | int count = target.count(); | 150 | int count = target.count(); |
151 | QWidget wid; | 151 | QProgressBar wid ( count ); |
152 | wid.setCaption( tr("Deleting ...")); | ||
152 | wid.show(); | 153 | wid.show(); |
153 | while (iii < count ) { | 154 | while (iii < count ) { |
154 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); | 155 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); |
156 | wid.setProgress( iii ); | ||
155 | wid.raise(); | 157 | wid.raise(); |
156 | qApp->processEvents(); | 158 | qApp->processEvents(); |
157 | RecMailP mail = (*target.at( iii )); | 159 | RecMailP mail = (*target.at( iii )); |
158 | deleteMail(mail); | 160 | deleteMail(mail); |
159 | ++iii; | 161 | ++iii; |
160 | } | 162 | } |
161 | } | 163 | } |
162 | 164 | ||
163 | void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targetMail ) | 165 | void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targetMail ) |
164 | { | 166 | { |
165 | //qDebug("AbstractMail::downloadNewMails %s ", fromFolder->getName().latin1()); | 167 | //qDebug("AbstractMail::downloadNewMails %s ", fromFolder->getName().latin1()); |
166 | // get local folder | 168 | // get local folder |
167 | Account * acc = getAccount(); | 169 | Account * acc = getAccount(); |
168 | if ( !acc ) return; | 170 | if ( !acc ) return; |
169 | QString lfName = acc->getLocalFolder(); | 171 | QString lfName = acc->getLocalFolder(); |
170 | if ( lfName.isEmpty() ) | 172 | if ( lfName.isEmpty() ) |
171 | lfName = acc->getAccountName(); | 173 | lfName = acc->getAccountName(); |
172 | // create local folder | 174 | // create local folder |
173 | if ( !targetMail->createMbox(lfName)) | 175 | if ( !targetMail->createMbox(lfName)) |
174 | { | 176 | { |
175 | QMessageBox::critical(0,tr("Error creating new Folder"), | 177 | QMessageBox::critical(0,tr("Error creating new Folder"), |
176 | tr("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); | 178 | tr("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); |
177 | return; | 179 | return; |
178 | } | 180 | } |
179 | QValueList<RecMailP> t; | 181 | QValueList<RecMailP> t; |
180 | listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); | 182 | listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); |
181 | if ( t.count() == 0 ) { | 183 | if ( t.count() == 0 ) { |
182 | Global::statusMessage(tr("There are no new messages")); | 184 | Global::statusMessage(tr("There are no new messages")); |
183 | return; | 185 | return; |
184 | } | 186 | } |
185 | QValueList<RecMailP> e; | 187 | QValueList<RecMailP> e; |
186 | targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); | 188 | targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); |
@@ -208,65 +210,68 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe | |||
208 | } | 210 | } |
209 | if ( n.count() == 0 ) { | 211 | if ( n.count() == 0 ) { |
210 | Global::statusMessage(tr("There are no new messages")); | 212 | Global::statusMessage(tr("There are no new messages")); |
211 | return; | 213 | return; |
212 | } | 214 | } |
213 | mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer()); | 215 | mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer()); |
214 | Global::statusMessage(tr("Downloaded %1 messages").arg(n.count())); | 216 | Global::statusMessage(tr("Downloaded %1 messages").arg(n.count())); |
215 | 217 | ||
216 | #if 0 | 218 | #if 0 |
217 | QValueList<RecMailP> t; | 219 | QValueList<RecMailP> t; |
218 | listMessages(fromFolder->getName(),t, maxSizeInKb); | 220 | listMessages(fromFolder->getName(),t, maxSizeInKb); |
219 | mvcpMailList( t,targetFolder,targetWrapper,moveit); | 221 | mvcpMailList( t,targetFolder,targetWrapper,moveit); |
220 | #endif | 222 | #endif |
221 | 223 | ||
222 | } | 224 | } |
223 | void AbstractMail::mvcpAllMails(const FolderP&fromFolder, | 225 | void AbstractMail::mvcpAllMails(const FolderP&fromFolder, |
224 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) | 226 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) |
225 | { | 227 | { |
226 | QValueList<RecMailP> t; | 228 | QValueList<RecMailP> t; |
227 | listMessages(fromFolder->getName(),t, maxSizeInKb); | 229 | listMessages(fromFolder->getName(),t, maxSizeInKb); |
228 | mvcpMailList( t,targetFolder,targetWrapper,moveit); | 230 | mvcpMailList( t,targetFolder,targetWrapper,moveit); |
229 | 231 | ||
230 | } | 232 | } |
231 | void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, | 233 | void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, |
232 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 234 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) |
233 | { | 235 | { |
234 | encodedString*st = 0; | 236 | encodedString*st = 0; |
235 | int iii = 0; | 237 | int iii = 0; |
236 | int count = t.count(); | 238 | int count = t.count(); |
237 | if ( count == 0 ) | 239 | if ( count == 0 ) |
238 | return; | 240 | return; |
239 | // wel, processevents is qite strange, we need a widget for getting | 241 | // wel, processevents is qite strange, we need a widget for getting |
240 | // Global::statusMessage(tr("Copy2 message %1").arg(iii)); displayed | 242 | // Global::statusMessage(tr("Copy2 message %1").arg(iii)); displaye |
241 | QWidget wid; | 243 | |
244 | QProgressBar wid ( count ); | ||
245 | wid.setCaption( tr("Copying ...")); | ||
242 | wid.show(); | 246 | wid.show(); |
243 | while (iii < count ) { | 247 | while (iii < count ) { |
244 | Global::statusMessage(tr("Copy message %1 of %2").arg(iii).arg(count)); | 248 | Global::statusMessage(tr("Copy message %1 of %2").arg(iii).arg(count)); |
249 | wid.setProgress( iii ); | ||
245 | wid.raise(); | 250 | wid.raise(); |
246 | qApp->processEvents(); | 251 | qApp->processEvents(); |
247 | RecMailP r = (*t.at( iii )); | 252 | RecMailP r = (*t.at( iii )); |
248 | st = fetchRawBody(r); | 253 | st = fetchRawBody(r); |
249 | if (st) { | 254 | if (st) { |
250 | targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); | 255 | targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); |
251 | delete st; | 256 | delete st; |
252 | } | 257 | } |
253 | ++iii; | 258 | ++iii; |
254 | } | 259 | } |
255 | if (moveit) { | 260 | if (moveit) { |
256 | deleteMailList( t ); | 261 | deleteMailList( t ); |
257 | //deleteAllMail(fromFolder); | 262 | //deleteAllMail(fromFolder); |
258 | } | 263 | } |
259 | } | 264 | } |
260 | 265 | ||
261 | void AbstractMail::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 266 | void AbstractMail::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) |
262 | { | 267 | { |
263 | encodedString*st = 0; | 268 | encodedString*st = 0; |
264 | st = fetchRawBody(mail); | 269 | st = fetchRawBody(mail); |
265 | if (st) { | 270 | if (st) { |
266 | targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); | 271 | targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); |
267 | delete st; | 272 | delete st; |
268 | } | 273 | } |
269 | if (moveit) { | 274 | if (moveit) { |
270 | deleteMail(mail); | 275 | deleteMail(mail); |
271 | } | 276 | } |
272 | } | 277 | } |
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 91332c3..d79df4f 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -915,68 +915,71 @@ void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which | |||
915 | if (enc->enc_value) { | 915 | if (enc->enc_value) { |
916 | char*t=enc->enc_value; | 916 | char*t=enc->enc_value; |
917 | encoding=QString(enc->enc_value); | 917 | encoding=QString(enc->enc_value); |
918 | enc->enc_value=0L; | 918 | enc->enc_value=0L; |
919 | free(t); | 919 | free(t); |
920 | } | 920 | } |
921 | } | 921 | } |
922 | if (which->bd_description) { | 922 | if (which->bd_description) { |
923 | target_part->setDescription(QString(which->bd_description)); | 923 | target_part->setDescription(QString(which->bd_description)); |
924 | } | 924 | } |
925 | target_part->setEncoding(encoding); | 925 | target_part->setEncoding(encoding); |
926 | target_part->setSize(which->bd_size); | 926 | target_part->setSize(which->bd_size); |
927 | } | 927 | } |
928 | void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) | 928 | void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) |
929 | { | 929 | { |
930 | //#if 0 | 930 | //#if 0 |
931 | mailimap_flag_list*flist; | 931 | mailimap_flag_list*flist; |
932 | mailimap_set *set; | 932 | mailimap_set *set; |
933 | mailimap_store_att_flags * store_flags; | 933 | mailimap_store_att_flags * store_flags; |
934 | int err; | 934 | int err; |
935 | login(); | 935 | login(); |
936 | //#endif | 936 | //#endif |
937 | if (!m_imap) { | 937 | if (!m_imap) { |
938 | return; | 938 | return; |
939 | } | 939 | } |
940 | int iii = 0; | 940 | int iii = 0; |
941 | int count = target.count(); | 941 | int count = target.count(); |
942 | // qDebug("imap remove count %d ", count); | 942 | // qDebug("imap remove count %d ", count); |
943 | 943 | ||
944 | 944 | ||
945 | mMax = count; | 945 | mMax = count; |
946 | //progress( tr("Delete")); | 946 | //progress( tr("Delete")); |
947 | QWidget wid; | 947 | |
948 | QProgressBar wid ( count ); | ||
949 | wid.setCaption( tr("Deleting ...")); | ||
948 | wid.show(); | 950 | wid.show(); |
949 | while (iii < count ) { | 951 | while (iii < count ) { |
950 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); | 952 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); |
953 | wid.setProgress( iii ); | ||
951 | wid.raise(); | 954 | wid.raise(); |
952 | qApp->processEvents(); | 955 | qApp->processEvents(); |
953 | RecMailP mail = (*target.at( iii )); | 956 | RecMailP mail = (*target.at( iii )); |
954 | //#if 0 | 957 | //#if 0 |
955 | //qDebug("IMAP remove %d %d ", iii, mail->getNumber() ); | 958 | //qDebug("IMAP remove %d %d ", iii, mail->getNumber() ); |
956 | err = selectMbox(mail->getMbox()); | 959 | err = selectMbox(mail->getMbox()); |
957 | if ( err != MAILIMAP_NO_ERROR ) { | 960 | if ( err != MAILIMAP_NO_ERROR ) { |
958 | return; | 961 | return; |
959 | } | 962 | } |
960 | flist = mailimap_flag_list_new_empty(); | 963 | flist = mailimap_flag_list_new_empty(); |
961 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); | 964 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); |
962 | store_flags = mailimap_store_att_flags_new_set_flags(flist); | 965 | store_flags = mailimap_store_att_flags_new_set_flags(flist); |
963 | set = mailimap_set_new_single(mail->getNumber()); | 966 | set = mailimap_set_new_single(mail->getNumber()); |
964 | err = mailimap_store(m_imap,set,store_flags); | 967 | err = mailimap_store(m_imap,set,store_flags); |
965 | mailimap_set_free( set ); | 968 | mailimap_set_free( set ); |
966 | mailimap_store_att_flags_free(store_flags); | 969 | mailimap_store_att_flags_free(store_flags); |
967 | 970 | ||
968 | if (err != MAILIMAP_NO_ERROR) { | 971 | if (err != MAILIMAP_NO_ERROR) { |
969 | // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; | 972 | // odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; |
970 | return; | 973 | return; |
971 | } | 974 | } |
972 | // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; | 975 | // odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; |
973 | /* should we realy do that at this moment? */ | 976 | /* should we realy do that at this moment? */ |
974 | 977 | ||
975 | // err = mailimap_expunge(m_imap); | 978 | // err = mailimap_expunge(m_imap); |
976 | //if (err != MAILIMAP_NO_ERROR) { | 979 | //if (err != MAILIMAP_NO_ERROR) { |
977 | // Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response)); | 980 | // Global::statusMessage(tr("Error deleting mails: %s").arg(m_imap->imap_response)); |
978 | // } | 981 | // } |
979 | //#endif | 982 | //#endif |
980 | //deleteMail( mail); | 983 | //deleteMail( mail); |
981 | ++iii; | 984 | ++iii; |
982 | } | 985 | } |
diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp index 1edec9e..9d52f52 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.cpp +++ b/kmicromail/libmailwrapper/pop3wrapper.cpp | |||
@@ -171,107 +171,115 @@ void POP3wrapper::login() | |||
171 | } else { | 171 | } else { |
172 | mailsession * session = m_pop3->sto_session; | 172 | mailsession * session = m_pop3->sto_session; |
173 | mailpop3 * mail = ( ( pop3_session_state_data * )session->sess_data )->pop3_session; | 173 | mailpop3 * mail = ( ( pop3_session_state_data * )session->sess_data )->pop3_session; |
174 | if (mail) { | 174 | if (mail) { |
175 | mail->pop3_progr_fun = &pop3_progress; | 175 | mail->pop3_progr_fun = &pop3_progress; |
176 | } | 176 | } |
177 | } | 177 | } |
178 | } | 178 | } |
179 | 179 | ||
180 | void POP3wrapper::logout() | 180 | void POP3wrapper::logout() |
181 | { | 181 | { |
182 | if ( m_pop3 == NULL ) | 182 | if ( m_pop3 == NULL ) |
183 | return; | 183 | return; |
184 | mailstorage_free(m_pop3); | 184 | mailstorage_free(m_pop3); |
185 | m_pop3 = 0; | 185 | m_pop3 = 0; |
186 | } | 186 | } |
187 | 187 | ||
188 | 188 | ||
189 | QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { | 189 | QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { |
190 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<FolderP>(); | 190 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<FolderP>(); |
191 | FolderP inb=new Folder("INBOX","/"); | 191 | FolderP inb=new Folder("INBOX","/"); |
192 | folders->append(inb); | 192 | folders->append(inb); |
193 | return folders; | 193 | return folders; |
194 | } | 194 | } |
195 | 195 | ||
196 | void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) | 196 | void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) |
197 | { | 197 | { |
198 | login(); | 198 | login(); |
199 | if (!m_pop3) | 199 | if (!m_pop3) |
200 | return; | 200 | return; |
201 | int iii = 0; | 201 | int iii = 0; |
202 | int count = target.count(); | 202 | int count = target.count(); |
203 | QWidget wid; | 203 | |
204 | QProgressBar wid ( count ); | ||
205 | wid.setCaption( tr("Deleting ...")); | ||
204 | wid.show(); | 206 | wid.show(); |
205 | while (iii < count ) { | 207 | while (iii < count ) { |
206 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); | 208 | Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); |
209 | wid.setProgress( iii ); | ||
207 | wid.raise(); | 210 | wid.raise(); |
208 | qApp->processEvents(); | 211 | qApp->processEvents(); |
209 | //qDebug("delete "); | 212 | //qDebug("delete "); |
210 | RecMailP mail = (*target.at( iii )); | 213 | RecMailP mail = (*target.at( iii )); |
211 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); | 214 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); |
212 | if (err != MAIL_NO_ERROR) { | 215 | if (err != MAIL_NO_ERROR) { |
213 | Global::statusMessage(tr("Error deleting mail")); | 216 | Global::statusMessage(tr("Error deleting mail")); |
214 | } | 217 | } |
215 | ++iii; | 218 | ++iii; |
216 | } | 219 | } |
217 | } | 220 | } |
218 | void POP3wrapper::deleteMail(const RecMailP&mail) { | 221 | void POP3wrapper::deleteMail(const RecMailP&mail) { |
219 | login(); | 222 | login(); |
220 | if (!m_pop3) | 223 | if (!m_pop3) |
221 | return; | 224 | return; |
222 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); | 225 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); |
223 | if (err != MAIL_NO_ERROR) { | 226 | if (err != MAIL_NO_ERROR) { |
224 | Global::statusMessage(tr("error deleting mail")); | 227 | Global::statusMessage(tr("error deleting mail")); |
225 | } | 228 | } |
226 | } | 229 | } |
227 | 230 | ||
228 | void POP3wrapper::answeredMail(const RecMailP&) {} | 231 | void POP3wrapper::answeredMail(const RecMailP&) {} |
229 | 232 | ||
230 | int POP3wrapper::deleteAllMail(const FolderP&) { | 233 | int POP3wrapper::deleteAllMail(const FolderP&) { |
231 | login(); | 234 | login(); |
232 | if (!m_pop3) | 235 | if (!m_pop3) |
233 | return 0; | 236 | return 0; |
234 | int res = 1; | 237 | int res = 1; |
235 | 238 | ||
236 | uint32_t result = 0; | 239 | uint32_t result = 0; |
237 | int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result); | 240 | int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result); |
238 | if (err != MAIL_NO_ERROR) { | 241 | if (err != MAIL_NO_ERROR) { |
239 | Global::statusMessage(tr("Error getting folder info")); | 242 | Global::statusMessage(tr("Error getting folder info")); |
240 | return 0; | 243 | return 0; |
241 | } | 244 | } |
242 | QWidget wid; | 245 | |
246 | |||
247 | |||
248 | QProgressBar wid ( result ); | ||
249 | wid.setCaption( tr("Deleting ...")); | ||
243 | wid.show(); | 250 | wid.show(); |
244 | for (unsigned int i = 0; i < result; ++i) { | 251 | for (unsigned int i = 0; i < result; ++i) { |
245 | Global::statusMessage(tr("Delete message %1 of %2").arg(i).arg(result)); | 252 | Global::statusMessage(tr("Delete message %1 of %2").arg(i).arg(result)); |
253 | wid.setProgress( i ); | ||
246 | wid.raise(); | 254 | wid.raise(); |
247 | qApp->processEvents(); | 255 | qApp->processEvents(); |
248 | 256 | ||
249 | err = mailsession_remove_message(m_pop3->sto_session,i+1); | 257 | err = mailsession_remove_message(m_pop3->sto_session,i+1); |
250 | if (err != MAIL_NO_ERROR) { | 258 | if (err != MAIL_NO_ERROR) { |
251 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); | 259 | Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); |
252 | res=0; | 260 | res=0; |
253 | } | 261 | } |
254 | break; | 262 | break; |
255 | } | 263 | } |
256 | return res; | 264 | return res; |
257 | } | 265 | } |
258 | 266 | ||
259 | void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) { | 267 | void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) { |
260 | login(); | 268 | login(); |
261 | target_stat.message_count = 0; | 269 | target_stat.message_count = 0; |
262 | target_stat.message_unseen = 0; | 270 | target_stat.message_unseen = 0; |
263 | target_stat.message_recent = 0; | 271 | target_stat.message_recent = 0; |
264 | if (!m_pop3) | 272 | if (!m_pop3) |
265 | return; | 273 | return; |
266 | int r = mailsession_status_folder(m_pop3->sto_session,0,&target_stat.message_count, | 274 | int r = mailsession_status_folder(m_pop3->sto_session,0,&target_stat.message_count, |
267 | &target_stat.message_recent,&target_stat.message_unseen); | 275 | &target_stat.message_recent,&target_stat.message_unseen); |
268 | if (r != MAIL_NO_ERROR) { | 276 | if (r != MAIL_NO_ERROR) { |
269 | ; // odebug << "error getting folter status." << oendl; | 277 | ; // odebug << "error getting folter status." << oendl; |
270 | } | 278 | } |
271 | } | 279 | } |
272 | 280 | ||
273 | encodedString* POP3wrapper::fetchRawBody(const RecMailP&mail) { | 281 | encodedString* POP3wrapper::fetchRawBody(const RecMailP&mail) { |
274 | char*target=0; | 282 | char*target=0; |
275 | size_t length=0; | 283 | size_t length=0; |
276 | encodedString*res = 0; | 284 | encodedString*res = 0; |
277 | mailmessage * mailmsg = 0; | 285 | mailmessage * mailmsg = 0; |