Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.h | 16 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/genericwrapper.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 14 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.h | 20 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.h | 16 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 39 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.h | 13 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mhwrapper.cpp | 24 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mhwrapper.h | 20 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.cpp | 9 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.h | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 9 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.h | 4 |
16 files changed, 114 insertions, 94 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index ac6f380..7e6d383 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp @@ -113,3 +113,3 @@ QString AbstractMail::gen_attachment_id() -int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool) +int AbstractMail::createMbox(const QString&,const FolderP&,const QString& delemiter,bool) { @@ -135,3 +135,4 @@ void AbstractMail::deleteMails(const QString &,QList<RecMail> &) -void AbstractMail::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) +void AbstractMail::mvcpAllMails(const FolderP&fromFolder, + const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) { diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h index d377452..d911468 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.h +++ b/noncore/net/mail/libmailwrapper/abstractmail.h @@ -5,5 +5,7 @@ -#include <qobject.h> #include "settings.h" +#include <qobject.h> +#include <opie2/osmart_pointer.h> + class RecMail; @@ -23,3 +25,3 @@ public: virtual ~AbstractMail(){} - virtual QList<Folder>* listFolders()=0; + virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders()=0; virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; @@ -34,8 +36,9 @@ public: virtual void answeredMail(const RecMail&mail)=0; - virtual int deleteAllMail(const Folder*)=0; + virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&)=0; virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); - virtual int deleteMbox(const Folder*)=0; + virtual int deleteMbox(const Opie::osmart_pointer<Folder>&)=0; virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; - virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); + virtual void mvcpAllMails(const Opie::osmart_pointer<Folder>&fromFolder, + const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); @@ -48,3 +51,4 @@ public: */ - virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); + virtual int createMbox(const QString&,const Opie::osmart_pointer<Folder>&parentfolder=0, + const QString& delemiter="/",bool getsubfolder=false); virtual void logout()=0; diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.h b/noncore/net/mail/libmailwrapper/genericwrapper.h index b3cd4fe..d0db45a 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.h +++ b/noncore/net/mail/libmailwrapper/genericwrapper.h @@ -40,3 +40,3 @@ public: virtual void cleanMimeCache(); - virtual int deleteMbox(const Folder*){return 1;} + virtual int deleteMbox(const Opie::osmart_pointer<Folder>&){return 1;} virtual void logout(){}; diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index e29a0a0..3b3be0f 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp @@ -268,3 +268,3 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) -QList<Folder>* IMAPwrapper::listFolders() +QValueList<Opie::osmart_pointer<Folder> >* IMAPwrapper::listFolders() { @@ -277,4 +277,3 @@ QList<Folder>* IMAPwrapper::listFolders() - QList<Folder> * folders = new QList<Folder>(); - folders->setAutoDelete( false ); + QValueList<FolderP>* folders = new QValueList<FolderP>(); login(); @@ -968,3 +967,3 @@ encodedString* IMAPwrapper::fetchRawPart(const RecMail&mail,const RecPart&part) -int IMAPwrapper::deleteAllMail(const Folder*folder) +int IMAPwrapper::deleteAllMail(const FolderP&folder) { @@ -1009,3 +1008,3 @@ int IMAPwrapper::deleteAllMail(const Folder*folder) -int IMAPwrapper::createMbox(const QString&folder,const Folder*parentfolder,const QString& delemiter,bool getsubfolder) +int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder) { @@ -1039,3 +1038,3 @@ int IMAPwrapper::createMbox(const QString&folder,const Folder*parentfolder,const -int IMAPwrapper::deleteMbox(const Folder*folder) +int IMAPwrapper::deleteMbox(const FolderP&folder) { @@ -1125,3 +1124,4 @@ encodedString* IMAPwrapper::fetchRawBody(const RecMail&mail) -void IMAPwrapper::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) +void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, + const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) { diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h index 2623725..15f049f 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.h +++ b/noncore/net/mail/libmailwrapper/imapwrapper.h @@ -25,11 +25,12 @@ public: virtual ~IMAPwrapper(); - virtual QList<Folder>* listFolders(); + virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); - + virtual void deleteMail(const RecMail&mail); virtual void answeredMail(const RecMail&mail); - virtual int deleteAllMail(const Folder*folder); + virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&folder); virtual void storeMessage(const char*msg,size_t length, const QString&folder); - virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); + virtual void mvcpAllMails(const Opie::osmart_pointer<Folder>&fromFolder, + const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); @@ -42,7 +43,8 @@ public: - virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); - virtual int deleteMbox(const Folder*folder); - + virtual int createMbox(const QString&,const Opie::osmart_pointer<Folder>&parentfolder=0, + const QString& delemiter="/",bool getsubfolder=false); + virtual int deleteMbox(const Opie::osmart_pointer<Folder>&folder); + static void imap_progress( size_t current, size_t maximum ); - + virtual void logout(); @@ -66,3 +68,3 @@ protected: void traverseBody(const RecMail&mail,mailimap_body*body,RecBody&target_body,int current_recursion,QValueList<int>recList,int current_count=1); - + /* just helpers */ diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h index 17c6db9..10d367f 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.h +++ b/noncore/net/mail/libmailwrapper/mailtypes.h @@ -10,3 +10,2 @@ -#include <qlist.h> #include <qbitarray.h> diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp index 6bd98f6..c71d69f 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp @@ -37,2 +37,6 @@ Folder::Folder(const QString&tmp_name, const QString&sep ) +Folder::~Folder() +{ +} + const QString& Folder::Separator()const @@ -59,2 +63,6 @@ IMAPFolder::IMAPFolder(const QString&name,const QString&sep, bool select,bool no +IMAPFolder::~IMAPFolder() +{ +} + static unsigned char base64chars[] = @@ -166 +174,5 @@ MHFolder::MHFolder(const QString&disp_name,const QString&mbox) } + +MHFolder::~MHFolder() +{ +} diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.h b/noncore/net/mail/libmailwrapper/mailwrapper.h index c66572c..3b3bb32 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.h +++ b/noncore/net/mail/libmailwrapper/mailwrapper.h @@ -15,3 +15,3 @@ class Attachment public: - Attachment( DocLnk lnk ); + Attachment( DocLnk lnk ); virtual ~Attachment(){} @@ -23,3 +23,3 @@ public: DocLnk getDocLnk() { return doc; } - + protected: @@ -42,3 +42,3 @@ public: const QList<Attachment>& getAttachments()const { return attList; } - void removeAttachment( Attachment *att ) { attList.remove( att ); } + void removeAttachment( Attachment *att ) { attList.remove( att ); } const QString&getName()const { return name; } @@ -68,8 +68,7 @@ private: -class Folder : public QObject +class Folder:public Opie::oref_count { - Q_OBJECT - public: Folder( const QString&init_name,const QString&sep ); + virtual ~Folder(); const QString&getDisplayName()const { return nameDisplay; } @@ -85,7 +84,9 @@ protected: +typedef Opie::osmart_pointer<Folder> FolderP; + class MHFolder : public Folder { - Q_OBJECT public: MHFolder(const QString&disp_name,const QString&mbox); + virtual ~MHFolder(); }; @@ -96,2 +97,3 @@ class IMAPFolder : public Folder IMAPFolder(const QString&name, const QString&sep, bool select=true,bool noinf=false,const QString&prefix="" ); + virtual ~IMAPFolder(); virtual bool may_select()const{return m_MaySelect;} 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 @@ -16,3 +16,3 @@ MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) } - + MBOXwrapper::~MBOXwrapper() @@ -26,6 +26,6 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) 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); @@ -37,5 +37,5 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) } - + parseList(target,folder->fld_session,mailbox); - + mailfolder_disconnect(folder); @@ -46,6 +46,5 @@ 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); @@ -56,3 +55,3 @@ QList<Folder>* MBOXwrapper::listFolders() for (;it!=entries.end();++it) { - Folder*inb=new Folder(*it,"/"); + FolderP inb=new Folder(*it,"/"); folders->append(inb); @@ -69,3 +68,3 @@ void MBOXwrapper::deleteMail(const RecMail&mail) mailfolder*folder; - folder = mailfolder_new( storage,(char*)p.latin1(),NULL); + folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); @@ -101,3 +100,3 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) mailfolder*folder; - folder = mailfolder_new( storage,(char*)p.latin1(),NULL); + folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); @@ -124,3 +123,3 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) } - body = parseMail(msg); + body = parseMail(msg); mailmessage_fetch_result_free(msg,data); @@ -128,3 +127,3 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) mailstorage_free(storage); - + return body; @@ -137,3 +136,3 @@ 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 ) { @@ -184,3 +183,3 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) mailfolder*folder; - folder = mailfolder_new( storage,(char*)p.latin1(),NULL); + folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); @@ -245,3 +244,3 @@ void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target) -int MBOXwrapper::deleteAllMail(const Folder*tfolder) +int MBOXwrapper::deleteAllMail(const FolderP&tfolder) { @@ -250,3 +249,3 @@ int MBOXwrapper::deleteAllMail(const Folder*tfolder) int res = 1; - + mailfolder*folder = 0; @@ -260,3 +259,3 @@ 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); @@ -288,3 +287,3 @@ int MBOXwrapper::deleteAllMail(const Folder*tfolder) -int MBOXwrapper::deleteMbox(const Folder*tfolder) +int MBOXwrapper::deleteMbox(const FolderP&tfolder) { @@ -318,3 +317,3 @@ 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); diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.h b/noncore/net/mail/libmailwrapper/mboxwrapper.h index 7e7f359..c3d9b50 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.h +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.h @@ -18,5 +18,5 @@ public: virtual ~MBOXwrapper(); - + virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); - virtual QList<Folder>* listFolders(); + virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); @@ -25,5 +25,6 @@ public: virtual void answeredMail(const RecMail&mail); - - virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); - virtual int deleteMbox(const Folder*); + + virtual int createMbox(const QString&folder,const Opie::osmart_pointer<Folder>&f=0, + const QString&d="",bool s=false); + virtual int deleteMbox(const Opie::osmart_pointer<Folder>&); @@ -36,3 +37,3 @@ public: virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); - virtual int deleteAllMail(const Folder*); + virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); virtual MAILLIB::ATYPE getType()const; diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp index 560eab0..aaaa20a 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp @@ -78,6 +78,5 @@ void MHwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) -QList<Folder>* MHwrapper::listFolders() +QValueList<Opie::osmart_pointer<Folder> >* MHwrapper::listFolders() { - QList<Folder> * folders = new QList<Folder>(); - folders->setAutoDelete( false ); + QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); /* this is needed! */ @@ -146,3 +145,3 @@ RecBody MHwrapper::fetchBody( const RecMail &mail ) } - body = parseMail(msg); + body = parseMail(msg); mailmessage_fetch_result_free(msg,data); @@ -171,3 +170,3 @@ QString MHwrapper::buildPath(const QString&p) -int MHwrapper::createMbox(const QString&folder,const Folder*pfolder,const QString&,bool ) +int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QString&,bool ) { @@ -265,3 +264,3 @@ void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) -int MHwrapper::deleteAllMail(const Folder*tfolder) +int MHwrapper::deleteAllMail(const FolderP&tfolder) { @@ -300,3 +299,3 @@ int MHwrapper::deleteAllMail(const Folder*tfolder) -int MHwrapper::deleteMbox(const Folder*tfolder) +int MHwrapper::deleteMbox(const FolderP&tfolder) { @@ -308,5 +307,5 @@ int MHwrapper::deleteMbox(const Folder*tfolder) if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; - + int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); - + if (r != MAIL_NO_ERROR) { @@ -321,3 +320,3 @@ int MHwrapper::deleteMbox(const Folder*tfolder) OProcess *process = new OProcess(); - + connect(process, SIGNAL(processExited(OProcess*)), @@ -388,3 +387,3 @@ void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractM QString tf = buildPath(targetFolder); - int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); + int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); if (r != MAIL_NO_ERROR) { @@ -403,3 +402,4 @@ void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractM -void MHwrapper::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) +void MHwrapper::mvcpAllMails(const FolderP&fromFolder, + const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) { diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.h b/noncore/net/mail/libmailwrapper/mhwrapper.h index b7c23af..c7c8183 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.h +++ b/noncore/net/mail/libmailwrapper/mhwrapper.h @@ -20,5 +20,5 @@ public: virtual ~MHwrapper(); - + virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); - virtual QList<Folder>* listFolders(); + virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); @@ -28,6 +28,8 @@ public: virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); - virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); - - virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); - virtual int deleteMbox(const Folder*); + virtual void mvcpAllMails(const Opie::osmart_pointer<Folder>&fromFolder, + const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); + + virtual int createMbox(const QString&folder,const Opie::osmart_pointer<Folder>&f=0, + const QString&d="",bool s=false); + virtual int deleteMbox(const Opie::osmart_pointer<Folder>&); @@ -40,3 +42,3 @@ public: virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); - virtual int deleteAllMail(const Folder*); + virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); virtual MAILLIB::ATYPE getType()const; @@ -52,6 +54,6 @@ protected: QString MHName; - + void init_storage(); void clean_storage(); - + bool removeMboxfailed; diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp index 1956c61..2ec052c 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp @@ -190,6 +190,5 @@ void NNTPwrapper::logout() -QList<Folder>* NNTPwrapper::listFolders() { +QValueList<Opie::osmart_pointer<Folder> >* NNTPwrapper::listFolders() { - QList<Folder> * folders = new QList<Folder>(); - folders->setAutoDelete( false ); + QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); QStringList groups; @@ -206,3 +205,3 @@ QList<Folder>* NNTPwrapper::listFolders() { * 'cause in that case there will be doubled copy operations. eg. the etpan would - * copy that stuff into its own structures and we must copy it into useable c++ + * copy that stuff into its own structures and we must copy it into useable c++ * structures for our frontend. this would not make sense, so it is better to reimplement @@ -282,3 +281,3 @@ void NNTPwrapper::deleteMail(const RecMail&) { -int NNTPwrapper::deleteAllMail(const Folder*) { +int NNTPwrapper::deleteAllMail(const FolderP&) { } diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.h b/noncore/net/mail/libmailwrapper/nntpwrapper.h index 955b9f1..d3a384a 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.h +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.h @@ -24,3 +24,3 @@ public: /* should only get the subscribed one */ - virtual QList<Folder>* listFolders(); + virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); /* mailbox will be ignored */ @@ -30,3 +30,3 @@ public: virtual void answeredMail(const RecMail&mail); - virtual int deleteAllMail(const Folder*); + virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 0939b22..7bf7ed2 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp @@ -179,6 +179,5 @@ void POP3wrapper::logout() -QList<Folder>* POP3wrapper::listFolders() { - QList<Folder> * folders = new QList<Folder>(); - folders->setAutoDelete( false ); - Folder*inb=new Folder("INBOX","/"); +QValueList<Opie::osmart_pointer<Folder> >* POP3wrapper::listFolders() { + QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<FolderP>(); + FolderP inb=new Folder("INBOX","/"); folders->append(inb); @@ -199,3 +198,3 @@ void POP3wrapper::answeredMail(const RecMail&) {} -int POP3wrapper::deleteAllMail(const Folder*) { +int POP3wrapper::deleteAllMail(const FolderP&) { login(); diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h index 391c841..e4afb94 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.h +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h @@ -20,3 +20,3 @@ public: virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); - virtual QList<Folder>* listFolders(); + virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); /* mailbox will be ignored */ @@ -26,3 +26,3 @@ public: virtual void answeredMail(const RecMail&mail); - virtual int deleteAllMail(const Folder*); + virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); |