Diffstat (limited to 'noncore/net/mail/libmailwrapper/mboxwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index abe4bb6..9ff3de2 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp @@ -15,5 +15,5 @@ MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) } } - + MBOXwrapper::~MBOXwrapper() { @@ -25,8 +25,8 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) QString p = MBOXPath+"/"; p+=mailbox; - + int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); mailfolder*folder; - folder = mailfolder_new( storage,(char*)p.latin1(),NULL); + folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); if (r != MAIL_NO_ERROR) { @@ -36,7 +36,7 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) return; } - + parseList(target,folder->fld_session,mailbox); - + mailfolder_disconnect(folder); mailfolder_free(folder); @@ -45,8 +45,7 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) } -QList<Folder>* MBOXwrapper::listFolders() +QValueList<Opie::osmart_pointer<Folder> >* MBOXwrapper::listFolders() { - QList<Folder> * folders = new QList<Folder>(); - folders->setAutoDelete( false ); + QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); QDir dir(MBOXPath); if (!dir.exists()) return folders; @@ -55,5 +54,5 @@ QList<Folder>* MBOXwrapper::listFolders() QStringList::ConstIterator it = entries.begin(); for (;it!=entries.end();++it) { - Folder*inb=new Folder(*it,"/"); + FolderP inb=new Folder(*it,"/"); folders->append(inb); } @@ -68,5 +67,5 @@ void MBOXwrapper::deleteMail(const RecMail&mail) int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); mailfolder*folder; - folder = mailfolder_new( storage,(char*)p.latin1(),NULL); + folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); if (r != MAIL_NO_ERROR) { @@ -100,5 +99,5 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); mailfolder*folder; - folder = mailfolder_new( storage,(char*)p.latin1(),NULL); + folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); if (r != MAIL_NO_ERROR) { @@ -123,9 +122,9 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) return body; } - body = parseMail(msg); + body = parseMail(msg); mailmessage_fetch_result_free(msg,data); mailfolder_free(folder); mailstorage_free(storage); - + return body; } @@ -136,5 +135,5 @@ void MBOXwrapper::mbox_progress( size_t current, size_t maximum ) } -int MBOXwrapper::createMbox(const QString&folder,const Folder*,const QString&,bool ) +int MBOXwrapper::createMbox(const QString&folder,const FolderP&,const QString&,bool ) { QString p = MBOXPath+"/"; @@ -183,5 +182,5 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); mailfolder*folder; - folder = mailfolder_new( storage,(char*)p.latin1(),NULL); + folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); if (r != MAIL_NO_ERROR) { @@ -244,10 +243,10 @@ void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target) } -int MBOXwrapper::deleteAllMail(const Folder*tfolder) +int MBOXwrapper::deleteAllMail(const FolderP&tfolder) { if (!tfolder) return 0; QString p = MBOXPath+"/"+tfolder->getDisplayName(); int res = 1; - + mailfolder*folder = 0; mailmessage_list*l=0; @@ -259,5 +258,5 @@ int MBOXwrapper::deleteAllMail(const Folder*tfolder) } if (res) { - folder = mailfolder_new( storage,(char*)p.latin1(),NULL); + folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); if (r != MAIL_NO_ERROR) { @@ -287,5 +286,5 @@ int MBOXwrapper::deleteAllMail(const Folder*tfolder) } -int MBOXwrapper::deleteMbox(const Folder*tfolder) +int MBOXwrapper::deleteMbox(const FolderP&tfolder) { if (!tfolder) return 0; @@ -317,5 +316,5 @@ void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) } int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); - folder = mailfolder_new( storage,(char*)p.latin1(),NULL); + folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, |