summaryrefslogtreecommitdiff
authoralwin <alwin>2004-01-06 22:26:57 (UTC)
committer alwin <alwin>2004-01-06 22:26:57 (UTC)
commita24b39a49ac49d2d3b0f2ff53f0f3b7839447d6e (patch) (side-by-side diff)
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)
}
deleteMails(f,target);
mailmbox_done(f);
}
void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target)
{
if (!f) return;
int r;
for (unsigned int i=0; i < target.count();++i) {
r = mailmbox_delete_msg(f,target.at(i)->getNumber());
if (r!=MAILMBOX_NO_ERROR) {
qDebug("error delete mail");
}
}
r = mailmbox_expunge(f);
if (r != MAILMBOX_NO_ERROR) {
qDebug("error expunge mailbox");
}
}
int MBOXwrapper::deleteAllMail(const Folder*tfolder)
{
if (!tfolder) return 0;
- QString p = MBOXPath+tfolder->getDisplayName();
+ QString p = MBOXPath+"/"+tfolder->getDisplayName();
int res = 1;
mailfolder*folder = 0;
mailmessage_list*l=0;
mailstorage*storage = mailstorage_new(NULL);
int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
if (r != MAIL_NO_ERROR) {
Global::statusMessage(tr("Error initializing mbox"));
res = 0;
}
if (res) {
folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
r = mailfolder_connect(folder);
if (r != MAIL_NO_ERROR) {
Global::statusMessage(tr("Error initializing mbox"));
res = 0;
}
}
if (res) {
r = mailsession_get_messages_list(folder->fld_session,&l);
if (r != MAIL_NO_ERROR) {
qDebug("Error message list");
res=0;
}
}
for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) {
r = mailsession_remove_message(folder->fld_session,i+1);
if (r != MAIL_NO_ERROR) {
Global::statusMessage(tr("Error deleting mail %1").arg(i+1));
res = 0;
break;
}
}
if (l) mailmessage_list_free(l);
if (folder) mailfolder_free(folder);
if (storage) mailstorage_free(storage);
return res;
}
int MBOXwrapper::deleteMbox(const Folder*tfolder)
{
if (!tfolder) return 0;
- QString p = MBOXPath+tfolder->getDisplayName();
+ QString p = MBOXPath+"/"+tfolder->getDisplayName();
QFile fi(p);
if (!fi.exists()) {
Global::statusMessage(tr("Mailbox doesn't exist."));
return 0;
}
if (!fi.remove()) {
Global::statusMessage(tr("Error deleting Mailbox."));
return 0;
}
return 1;
}
void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
{
mailfolder*folder = 0;
mailstorage*storage = mailstorage_new(NULL);
target_stat.message_count = 0;
target_stat.message_unseen = 0;
target_stat.message_recent = 0;
QString p = MBOXPath+"/"+mailbox;
QFile fi(p);
if (!fi.exists()) {
Global::statusMessage(tr("Mailbox doesn't exist."));
return;