summaryrefslogtreecommitdiff
Unidiff
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
@@ -235,33 +235,33 @@ void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target)
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;
@@ -278,33 +278,33 @@ int MBOXwrapper::deleteAllMail(const Folder*tfolder)
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);