summaryrefslogtreecommitdiff
authoralwin <alwin>2004-01-06 22:26:57 (UTC)
committer alwin <alwin>2004-01-06 22:26:57 (UTC)
commita24b39a49ac49d2d3b0f2ff53f0f3b7839447d6e (patch) (unidiff)
treed03a60b7e53389607a692b0784c8f5292e168920
parenta513de3ae1549428595db1b6c70e4203b0a3dedd (diff)
downloadopie-a24b39a49ac49d2d3b0f2ff53f0f3b7839447d6e.zip
opie-a24b39a49ac49d2d3b0f2ff53f0f3b7839447d6e.tar.gz
opie-a24b39a49ac49d2d3b0f2ff53f0f3b7839447d6e.tar.bz2
bugfix while building mbox path
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/mboxwrapper.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
index 3a0b30a..bc496f7 100644
--- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
@@ -227,92 +227,92 @@ void MBOXwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target)
227 } 227 }
228 deleteMails(f,target); 228 deleteMails(f,target);
229 mailmbox_done(f); 229 mailmbox_done(f);
230} 230}
231 231
232void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target) 232void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target)
233{ 233{
234 if (!f) return; 234 if (!f) return;
235 int r; 235 int r;
236 for (unsigned int i=0; i < target.count();++i) { 236 for (unsigned int i=0; i < target.count();++i) {
237 r = mailmbox_delete_msg(f,target.at(i)->getNumber()); 237 r = mailmbox_delete_msg(f,target.at(i)->getNumber());
238 if (r!=MAILMBOX_NO_ERROR) { 238 if (r!=MAILMBOX_NO_ERROR) {
239 qDebug("error delete mail"); 239 qDebug("error delete mail");
240 } 240 }
241 } 241 }
242 r = mailmbox_expunge(f); 242 r = mailmbox_expunge(f);
243 if (r != MAILMBOX_NO_ERROR) { 243 if (r != MAILMBOX_NO_ERROR) {
244 qDebug("error expunge mailbox"); 244 qDebug("error expunge mailbox");
245 } 245 }
246} 246}
247 247
248int MBOXwrapper::deleteAllMail(const Folder*tfolder) 248int MBOXwrapper::deleteAllMail(const Folder*tfolder)
249{ 249{
250 if (!tfolder) return 0; 250 if (!tfolder) return 0;
251 QString p = MBOXPath+tfolder->getDisplayName(); 251 QString p = MBOXPath+"/"+tfolder->getDisplayName();
252 int res = 1; 252 int res = 1;
253 253
254 mailfolder*folder = 0; 254 mailfolder*folder = 0;
255 mailmessage_list*l=0; 255 mailmessage_list*l=0;
256 mailstorage*storage = mailstorage_new(NULL); 256 mailstorage*storage = mailstorage_new(NULL);
257 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); 257 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
258 if (r != MAIL_NO_ERROR) { 258 if (r != MAIL_NO_ERROR) {
259 Global::statusMessage(tr("Error initializing mbox")); 259 Global::statusMessage(tr("Error initializing mbox"));
260 res = 0; 260 res = 0;
261 } 261 }
262 if (res) { 262 if (res) {
263 folder = mailfolder_new( storage,(char*)p.latin1(),NULL); 263 folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
264 r = mailfolder_connect(folder); 264 r = mailfolder_connect(folder);
265 if (r != MAIL_NO_ERROR) { 265 if (r != MAIL_NO_ERROR) {
266 Global::statusMessage(tr("Error initializing mbox")); 266 Global::statusMessage(tr("Error initializing mbox"));
267 res = 0; 267 res = 0;
268 } 268 }
269 } 269 }
270 if (res) { 270 if (res) {
271 r = mailsession_get_messages_list(folder->fld_session,&l); 271 r = mailsession_get_messages_list(folder->fld_session,&l);
272 if (r != MAIL_NO_ERROR) { 272 if (r != MAIL_NO_ERROR) {
273 qDebug("Error message list"); 273 qDebug("Error message list");
274 res=0; 274 res=0;
275 } 275 }
276 } 276 }
277 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { 277 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) {
278 r = mailsession_remove_message(folder->fld_session,i+1); 278 r = mailsession_remove_message(folder->fld_session,i+1);
279 if (r != MAIL_NO_ERROR) { 279 if (r != MAIL_NO_ERROR) {
280 Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); 280 Global::statusMessage(tr("Error deleting mail %1").arg(i+1));
281 res = 0; 281 res = 0;
282 break; 282 break;
283 } 283 }
284 } 284 }
285 if (l) mailmessage_list_free(l); 285 if (l) mailmessage_list_free(l);
286 if (folder) mailfolder_free(folder); 286 if (folder) mailfolder_free(folder);
287 if (storage) mailstorage_free(storage); 287 if (storage) mailstorage_free(storage);
288 return res; 288 return res;
289} 289}
290 290
291int MBOXwrapper::deleteMbox(const Folder*tfolder) 291int MBOXwrapper::deleteMbox(const Folder*tfolder)
292{ 292{
293 if (!tfolder) return 0; 293 if (!tfolder) return 0;
294 QString p = MBOXPath+tfolder->getDisplayName(); 294 QString p = MBOXPath+"/"+tfolder->getDisplayName();
295 QFile fi(p); 295 QFile fi(p);
296 if (!fi.exists()) { 296 if (!fi.exists()) {
297 Global::statusMessage(tr("Mailbox doesn't exist.")); 297 Global::statusMessage(tr("Mailbox doesn't exist."));
298 return 0; 298 return 0;
299 } 299 }
300 if (!fi.remove()) { 300 if (!fi.remove()) {
301 Global::statusMessage(tr("Error deleting Mailbox.")); 301 Global::statusMessage(tr("Error deleting Mailbox."));
302 return 0; 302 return 0;
303 } 303 }
304 return 1; 304 return 1;
305} 305}
306 306
307void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) 307void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
308{ 308{
309 mailfolder*folder = 0; 309 mailfolder*folder = 0;
310 mailstorage*storage = mailstorage_new(NULL); 310 mailstorage*storage = mailstorage_new(NULL);
311 target_stat.message_count = 0; 311 target_stat.message_count = 0;
312 target_stat.message_unseen = 0; 312 target_stat.message_unseen = 0;
313 target_stat.message_recent = 0; 313 target_stat.message_recent = 0;
314 QString p = MBOXPath+"/"+mailbox; 314 QString p = MBOXPath+"/"+mailbox;
315 QFile fi(p); 315 QFile fi(p);
316 if (!fi.exists()) { 316 if (!fi.exists()) {
317 Global::statusMessage(tr("Mailbox doesn't exist.")); 317 Global::statusMessage(tr("Mailbox doesn't exist."));
318 return; 318 return;