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 | |||
@@ -111,7 +111,7 @@ QString AbstractMail::gen_attachment_id() | |||
111 | return "{" + stream.read().stripWhiteSpace() + "}"; | 111 | return "{" + stream.read().stripWhiteSpace() + "}"; |
112 | } | 112 | } |
113 | 113 | ||
114 | int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool) | 114 | int AbstractMail::createMbox(const QString&,const FolderP&,const QString& delemiter,bool) |
115 | { | 115 | { |
116 | return 0; | 116 | return 0; |
117 | } | 117 | } |
@@ -133,7 +133,8 @@ void AbstractMail::deleteMails(const QString &,QList<RecMail> &) | |||
133 | { | 133 | { |
134 | } | 134 | } |
135 | 135 | ||
136 | void AbstractMail::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 136 | void AbstractMail::mvcpAllMails(const FolderP&fromFolder, |
137 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | ||
137 | { | 138 | { |
138 | QList<RecMail> t; | 139 | QList<RecMail> t; |
139 | listMessages(fromFolder->getName(),t); | 140 | listMessages(fromFolder->getName(),t); |
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 | |||
@@ -3,9 +3,11 @@ | |||
3 | 3 | ||
4 | #include "maildefines.h" | 4 | #include "maildefines.h" |
5 | 5 | ||
6 | #include <qobject.h> | ||
7 | #include "settings.h" | 6 | #include "settings.h" |
8 | 7 | ||
8 | #include <qobject.h> | ||
9 | #include <opie2/osmart_pointer.h> | ||
10 | |||
9 | class RecMail; | 11 | class RecMail; |
10 | class RecBody; | 12 | class RecBody; |
11 | class RecPart; | 13 | class RecPart; |
@@ -21,7 +23,7 @@ class AbstractMail:public QObject | |||
21 | public: | 23 | public: |
22 | AbstractMail(){}; | 24 | AbstractMail(){}; |
23 | virtual ~AbstractMail(){} | 25 | virtual ~AbstractMail(){} |
24 | virtual QList<Folder>* listFolders()=0; | 26 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders()=0; |
25 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; | 27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; |
26 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; | 28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; |
27 | virtual RecBody fetchBody(const RecMail&mail)=0; | 29 | virtual RecBody fetchBody(const RecMail&mail)=0; |
@@ -32,12 +34,13 @@ public: | |||
32 | 34 | ||
33 | virtual void deleteMail(const RecMail&mail)=0; | 35 | virtual void deleteMail(const RecMail&mail)=0; |
34 | virtual void answeredMail(const RecMail&mail)=0; | 36 | virtual void answeredMail(const RecMail&mail)=0; |
35 | virtual int deleteAllMail(const Folder*)=0; | 37 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&)=0; |
36 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); | 38 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); |
37 | virtual int deleteMbox(const Folder*)=0; | 39 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&)=0; |
38 | virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; | 40 | virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; |
39 | 41 | ||
40 | virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 42 | virtual void mvcpAllMails(const Opie::osmart_pointer<Folder>&fromFolder, |
43 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | ||
41 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 44 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
42 | 45 | ||
43 | virtual void cleanMimeCache(){}; | 46 | virtual void cleanMimeCache(){}; |
@@ -46,7 +49,8 @@ public: | |||
46 | * if the implementing subclass has prefixes, | 49 | * if the implementing subclass has prefixes, |
47 | * them has to be appended automatic. | 50 | * them has to be appended automatic. |
48 | */ | 51 | */ |
49 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); | 52 | virtual int createMbox(const QString&,const Opie::osmart_pointer<Folder>&parentfolder=0, |
53 | const QString& delemiter="/",bool getsubfolder=false); | ||
50 | virtual void logout()=0; | 54 | virtual void logout()=0; |
51 | 55 | ||
52 | static AbstractMail* getWrapper(IMAPaccount *a); | 56 | static AbstractMail* getWrapper(IMAPaccount *a); |
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 | |||
@@ -38,7 +38,7 @@ public: | |||
38 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part); | 38 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part); |
39 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part); | 39 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part); |
40 | virtual void cleanMimeCache(); | 40 | virtual void cleanMimeCache(); |
41 | virtual int deleteMbox(const Folder*){return 1;} | 41 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&){return 1;} |
42 | virtual void logout(){}; | 42 | virtual void logout(){}; |
43 | virtual void storeMessage(const char*msg,size_t length, const QString&folder){}; | 43 | virtual void storeMessage(const char*msg,size_t length, const QString&folder){}; |
44 | 44 | ||
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 | |||
@@ -266,7 +266,7 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
266 | if (result) mailimap_fetch_list_free(result); | 266 | if (result) mailimap_fetch_list_free(result); |
267 | } | 267 | } |
268 | 268 | ||
269 | QList<Folder>* IMAPwrapper::listFolders() | 269 | QValueList<Opie::osmart_pointer<Folder> >* IMAPwrapper::listFolders() |
270 | { | 270 | { |
271 | const char *path, *mask; | 271 | const char *path, *mask; |
272 | int err = MAILIMAP_NO_ERROR; | 272 | int err = MAILIMAP_NO_ERROR; |
@@ -275,8 +275,7 @@ QList<Folder>* IMAPwrapper::listFolders() | |||
275 | clistcell*cur_flag = 0; | 275 | clistcell*cur_flag = 0; |
276 | mailimap_mbx_list_flags*bflags = 0; | 276 | mailimap_mbx_list_flags*bflags = 0; |
277 | 277 | ||
278 | QList<Folder> * folders = new QList<Folder>(); | 278 | QValueList<FolderP>* folders = new QValueList<FolderP>(); |
279 | folders->setAutoDelete( false ); | ||
280 | login(); | 279 | login(); |
281 | if (!m_imap) { | 280 | if (!m_imap) { |
282 | return folders; | 281 | return folders; |
@@ -966,7 +965,7 @@ encodedString* IMAPwrapper::fetchRawPart(const RecMail&mail,const RecPart&part) | |||
966 | return fetchRawPart(mail,part.Positionlist(),false); | 965 | return fetchRawPart(mail,part.Positionlist(),false); |
967 | } | 966 | } |
968 | 967 | ||
969 | int IMAPwrapper::deleteAllMail(const Folder*folder) | 968 | int IMAPwrapper::deleteAllMail(const FolderP&folder) |
970 | { | 969 | { |
971 | login(); | 970 | login(); |
972 | if (!m_imap) { | 971 | if (!m_imap) { |
@@ -1007,7 +1006,7 @@ int IMAPwrapper::deleteAllMail(const Folder*folder) | |||
1007 | return 1; | 1006 | return 1; |
1008 | } | 1007 | } |
1009 | 1008 | ||
1010 | int IMAPwrapper::createMbox(const QString&folder,const Folder*parentfolder,const QString& delemiter,bool getsubfolder) | 1009 | int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder) |
1011 | { | 1010 | { |
1012 | if (folder.length()==0) return 0; | 1011 | if (folder.length()==0) return 0; |
1013 | login(); | 1012 | login(); |
@@ -1037,7 +1036,7 @@ int IMAPwrapper::createMbox(const QString&folder,const Folder*parentfolder,const | |||
1037 | return 1; | 1036 | return 1; |
1038 | } | 1037 | } |
1039 | 1038 | ||
1040 | int IMAPwrapper::deleteMbox(const Folder*folder) | 1039 | int IMAPwrapper::deleteMbox(const FolderP&folder) |
1041 | { | 1040 | { |
1042 | if (!folder) return 0; | 1041 | if (!folder) return 0; |
1043 | login(); | 1042 | login(); |
@@ -1123,7 +1122,8 @@ encodedString* IMAPwrapper::fetchRawBody(const RecMail&mail) | |||
1123 | return fetchRawPart(mail,path,false); | 1122 | return fetchRawPart(mail,path,false); |
1124 | } | 1123 | } |
1125 | 1124 | ||
1126 | void IMAPwrapper::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 1125 | void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, |
1126 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | ||
1127 | { | 1127 | { |
1128 | if (targetWrapper != this) { | 1128 | if (targetWrapper != this) { |
1129 | AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); | 1129 | AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,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 | |||
@@ -23,15 +23,16 @@ class IMAPwrapper : public AbstractMail | |||
23 | public: | 23 | public: |
24 | IMAPwrapper( IMAPaccount *a ); | 24 | IMAPwrapper( IMAPaccount *a ); |
25 | virtual ~IMAPwrapper(); | 25 | virtual ~IMAPwrapper(); |
26 | virtual QList<Folder>* listFolders(); | 26 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); |
27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); | 27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); |
28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
29 | 29 | ||
30 | virtual void deleteMail(const RecMail&mail); | 30 | virtual void deleteMail(const RecMail&mail); |
31 | virtual void answeredMail(const RecMail&mail); | 31 | virtual void answeredMail(const RecMail&mail); |
32 | virtual int deleteAllMail(const Folder*folder); | 32 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&folder); |
33 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 33 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
34 | virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 34 | virtual void mvcpAllMails(const Opie::osmart_pointer<Folder>&fromFolder, |
35 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | ||
35 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 36 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
36 | 37 | ||
37 | virtual RecBody fetchBody(const RecMail&mail); | 38 | virtual RecBody fetchBody(const RecMail&mail); |
@@ -40,11 +41,12 @@ public: | |||
40 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part); | 41 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part); |
41 | virtual encodedString* fetchRawBody(const RecMail&mail); | 42 | virtual encodedString* fetchRawBody(const RecMail&mail); |
42 | 43 | ||
43 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); | 44 | virtual int createMbox(const QString&,const Opie::osmart_pointer<Folder>&parentfolder=0, |
44 | virtual int deleteMbox(const Folder*folder); | 45 | const QString& delemiter="/",bool getsubfolder=false); |
45 | 46 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&folder); | |
47 | |||
46 | static void imap_progress( size_t current, size_t maximum ); | 48 | static void imap_progress( size_t current, size_t maximum ); |
47 | 49 | ||
48 | virtual void logout(); | 50 | virtual void logout(); |
49 | virtual MAILLIB::ATYPE getType()const; | 51 | virtual MAILLIB::ATYPE getType()const; |
50 | virtual const QString&getName()const; | 52 | virtual const QString&getName()const; |
@@ -64,7 +66,7 @@ protected: | |||
64 | void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which); | 66 | void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which); |
65 | void fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which); | 67 | void fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which); |
66 | void traverseBody(const RecMail&mail,mailimap_body*body,RecBody&target_body,int current_recursion,QValueList<int>recList,int current_count=1); | 68 | void traverseBody(const RecMail&mail,mailimap_body*body,RecBody&target_body,int current_recursion,QValueList<int>recList,int current_count=1); |
67 | 69 | ||
68 | /* just helpers */ | 70 | /* just helpers */ |
69 | static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which); | 71 | static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which); |
70 | static QStringList address_list_to_stringlist(clist*list); | 72 | static QStringList address_list_to_stringlist(clist*list); |
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 | |||
@@ -8,7 +8,6 @@ | |||
8 | #define FLAG_DRAFT 4 | 8 | #define FLAG_DRAFT 4 |
9 | #define FLAG_RECENT 5 | 9 | #define FLAG_RECENT 5 |
10 | 10 | ||
11 | #include <qlist.h> | ||
12 | #include <qbitarray.h> | 11 | #include <qbitarray.h> |
13 | #include <qstring.h> | 12 | #include <qstring.h> |
14 | #include <qstringlist.h> | 13 | #include <qstringlist.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 | |||
@@ -35,6 +35,10 @@ Folder::Folder(const QString&tmp_name, const QString&sep ) | |||
35 | prefix = ""; | 35 | prefix = ""; |
36 | } | 36 | } |
37 | 37 | ||
38 | Folder::~Folder() | ||
39 | { | ||
40 | } | ||
41 | |||
38 | const QString& Folder::Separator()const | 42 | const QString& Folder::Separator()const |
39 | { | 43 | { |
40 | return separator; | 44 | return separator; |
@@ -57,6 +61,10 @@ IMAPFolder::IMAPFolder(const QString&name,const QString&sep, bool select,bool no | |||
57 | } | 61 | } |
58 | } | 62 | } |
59 | 63 | ||
64 | IMAPFolder::~IMAPFolder() | ||
65 | { | ||
66 | } | ||
67 | |||
60 | static unsigned char base64chars[] = | 68 | static unsigned char base64chars[] = |
61 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,"; | 69 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,"; |
62 | 70 | ||
@@ -164,3 +172,7 @@ MHFolder::MHFolder(const QString&disp_name,const QString&mbox) | |||
164 | } | 172 | } |
165 | prefix = mbox; | 173 | prefix = mbox; |
166 | } | 174 | } |
175 | |||
176 | MHFolder::~MHFolder() | ||
177 | { | ||
178 | } | ||
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 | |||
@@ -13,7 +13,7 @@ | |||
13 | class Attachment | 13 | class Attachment |
14 | { | 14 | { |
15 | public: | 15 | public: |
16 | Attachment( DocLnk lnk ); | 16 | Attachment( DocLnk lnk ); |
17 | virtual ~Attachment(){} | 17 | virtual ~Attachment(){} |
18 | const QString getFileName()const{ return doc.file(); } | 18 | const QString getFileName()const{ return doc.file(); } |
19 | const QString getName()const{ return doc.name(); } | 19 | const QString getName()const{ return doc.name(); } |
@@ -21,7 +21,7 @@ public: | |||
21 | const QPixmap getPixmap()const{ return doc.pixmap(); } | 21 | const QPixmap getPixmap()const{ return doc.pixmap(); } |
22 | const int getSize()const { return size; } | 22 | const int getSize()const { return size; } |
23 | DocLnk getDocLnk() { return doc; } | 23 | DocLnk getDocLnk() { return doc; } |
24 | 24 | ||
25 | protected: | 25 | protected: |
26 | DocLnk doc; | 26 | DocLnk doc; |
27 | int size; | 27 | int size; |
@@ -40,7 +40,7 @@ public: | |||
40 | virtual ~Mail(){} | 40 | virtual ~Mail(){} |
41 | void addAttachment( Attachment *att ) { attList.append( att ); } | 41 | void addAttachment( Attachment *att ) { attList.append( att ); } |
42 | const QList<Attachment>& getAttachments()const { return attList; } | 42 | const QList<Attachment>& getAttachments()const { return attList; } |
43 | void removeAttachment( Attachment *att ) { attList.remove( att ); } | 43 | void removeAttachment( Attachment *att ) { attList.remove( att ); } |
44 | const QString&getName()const { return name; } | 44 | const QString&getName()const { return name; } |
45 | void setName( QString s ) { name = s; } | 45 | void setName( QString s ) { name = s; } |
46 | const QString&getMail()const{ return mail; } | 46 | const QString&getMail()const{ return mail; } |
@@ -66,12 +66,11 @@ private: | |||
66 | QStringList m_in_reply_to; | 66 | QStringList m_in_reply_to; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | class Folder : public QObject | 69 | class Folder:public Opie::oref_count |
70 | { | 70 | { |
71 | Q_OBJECT | ||
72 | |||
73 | public: | 71 | public: |
74 | Folder( const QString&init_name,const QString&sep ); | 72 | Folder( const QString&init_name,const QString&sep ); |
73 | virtual ~Folder(); | ||
75 | const QString&getDisplayName()const { return nameDisplay; } | 74 | const QString&getDisplayName()const { return nameDisplay; } |
76 | const QString&getName()const { return name; } | 75 | const QString&getName()const { return name; } |
77 | const QString&getPrefix()const{return prefix; } | 76 | const QString&getPrefix()const{return prefix; } |
@@ -83,17 +82,20 @@ protected: | |||
83 | QString nameDisplay, name, separator,prefix; | 82 | QString nameDisplay, name, separator,prefix; |
84 | }; | 83 | }; |
85 | 84 | ||
85 | typedef Opie::osmart_pointer<Folder> FolderP; | ||
86 | |||
86 | class MHFolder : public Folder | 87 | class MHFolder : public Folder |
87 | { | 88 | { |
88 | Q_OBJECT | ||
89 | public: | 89 | public: |
90 | MHFolder(const QString&disp_name,const QString&mbox); | 90 | MHFolder(const QString&disp_name,const QString&mbox); |
91 | virtual ~MHFolder(); | ||
91 | }; | 92 | }; |
92 | 93 | ||
93 | class IMAPFolder : public Folder | 94 | class IMAPFolder : public Folder |
94 | { | 95 | { |
95 | public: | 96 | public: |
96 | IMAPFolder(const QString&name, const QString&sep, bool select=true,bool noinf=false,const QString&prefix="" ); | 97 | IMAPFolder(const QString&name, const QString&sep, bool select=true,bool noinf=false,const QString&prefix="" ); |
98 | virtual ~IMAPFolder(); | ||
97 | virtual bool may_select()const{return m_MaySelect;} | 99 | virtual bool may_select()const{return m_MaySelect;} |
98 | virtual bool no_inferior()const{return m_NoInferior;} | 100 | virtual bool no_inferior()const{return m_NoInferior;} |
99 | private: | 101 | private: |
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 | |||
@@ -14,7 +14,7 @@ MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) | |||
14 | dir.mkdir(MBOXPath); | 14 | dir.mkdir(MBOXPath); |
15 | } | 15 | } |
16 | } | 16 | } |
17 | 17 | ||
18 | MBOXwrapper::~MBOXwrapper() | 18 | MBOXwrapper::~MBOXwrapper() |
19 | { | 19 | { |
20 | } | 20 | } |
@@ -24,10 +24,10 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
24 | mailstorage*storage = mailstorage_new(NULL); | 24 | mailstorage*storage = mailstorage_new(NULL); |
25 | QString p = MBOXPath+"/"; | 25 | QString p = MBOXPath+"/"; |
26 | p+=mailbox; | 26 | p+=mailbox; |
27 | 27 | ||
28 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 28 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
29 | mailfolder*folder; | 29 | mailfolder*folder; |
30 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 30 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
31 | r = mailfolder_connect(folder); | 31 | r = mailfolder_connect(folder); |
32 | if (r != MAIL_NO_ERROR) { | 32 | if (r != MAIL_NO_ERROR) { |
33 | qDebug("Error initializing mbox"); | 33 | qDebug("Error initializing mbox"); |
@@ -35,26 +35,25 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
35 | mailstorage_free(storage); | 35 | mailstorage_free(storage); |
36 | return; | 36 | return; |
37 | } | 37 | } |
38 | 38 | ||
39 | parseList(target,folder->fld_session,mailbox); | 39 | parseList(target,folder->fld_session,mailbox); |
40 | 40 | ||
41 | mailfolder_disconnect(folder); | 41 | mailfolder_disconnect(folder); |
42 | mailfolder_free(folder); | 42 | mailfolder_free(folder); |
43 | mailstorage_free(storage); | 43 | mailstorage_free(storage); |
44 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); | 44 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); |
45 | } | 45 | } |
46 | 46 | ||
47 | QList<Folder>* MBOXwrapper::listFolders() | 47 | QValueList<Opie::osmart_pointer<Folder> >* MBOXwrapper::listFolders() |
48 | { | 48 | { |
49 | QList<Folder> * folders = new QList<Folder>(); | 49 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); |
50 | folders->setAutoDelete( false ); | ||
51 | QDir dir(MBOXPath); | 50 | QDir dir(MBOXPath); |
52 | if (!dir.exists()) return folders; | 51 | if (!dir.exists()) return folders; |
53 | dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); | 52 | dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); |
54 | QStringList entries = dir.entryList(); | 53 | QStringList entries = dir.entryList(); |
55 | QStringList::ConstIterator it = entries.begin(); | 54 | QStringList::ConstIterator it = entries.begin(); |
56 | for (;it!=entries.end();++it) { | 55 | for (;it!=entries.end();++it) { |
57 | Folder*inb=new Folder(*it,"/"); | 56 | FolderP inb=new Folder(*it,"/"); |
58 | folders->append(inb); | 57 | folders->append(inb); |
59 | } | 58 | } |
60 | return folders; | 59 | return folders; |
@@ -67,7 +66,7 @@ void MBOXwrapper::deleteMail(const RecMail&mail) | |||
67 | p+=mail.getMbox(); | 66 | p+=mail.getMbox(); |
68 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 67 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
69 | mailfolder*folder; | 68 | mailfolder*folder; |
70 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 69 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
71 | r = mailfolder_connect(folder); | 70 | r = mailfolder_connect(folder); |
72 | if (r != MAIL_NO_ERROR) { | 71 | if (r != MAIL_NO_ERROR) { |
73 | qDebug("Error initializing mbox"); | 72 | qDebug("Error initializing mbox"); |
@@ -99,7 +98,7 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) | |||
99 | 98 | ||
100 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 99 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
101 | mailfolder*folder; | 100 | mailfolder*folder; |
102 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 101 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
103 | r = mailfolder_connect(folder); | 102 | r = mailfolder_connect(folder); |
104 | if (r != MAIL_NO_ERROR) { | 103 | if (r != MAIL_NO_ERROR) { |
105 | qDebug("Error initializing mbox"); | 104 | qDebug("Error initializing mbox"); |
@@ -122,11 +121,11 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) | |||
122 | mailmessage_free(msg); | 121 | mailmessage_free(msg); |
123 | return body; | 122 | return body; |
124 | } | 123 | } |
125 | body = parseMail(msg); | 124 | body = parseMail(msg); |
126 | mailmessage_fetch_result_free(msg,data); | 125 | mailmessage_fetch_result_free(msg,data); |
127 | mailfolder_free(folder); | 126 | mailfolder_free(folder); |
128 | mailstorage_free(storage); | 127 | mailstorage_free(storage); |
129 | 128 | ||
130 | return body; | 129 | return body; |
131 | } | 130 | } |
132 | 131 | ||
@@ -135,7 +134,7 @@ void MBOXwrapper::mbox_progress( size_t current, size_t maximum ) | |||
135 | qDebug("MBOX %i von %i",current,maximum); | 134 | qDebug("MBOX %i von %i",current,maximum); |
136 | } | 135 | } |
137 | 136 | ||
138 | int MBOXwrapper::createMbox(const QString&folder,const Folder*,const QString&,bool ) | 137 | int MBOXwrapper::createMbox(const QString&folder,const FolderP&,const QString&,bool ) |
139 | { | 138 | { |
140 | QString p = MBOXPath+"/"; | 139 | QString p = MBOXPath+"/"; |
141 | p+=folder; | 140 | p+=folder; |
@@ -182,7 +181,7 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) | |||
182 | 181 | ||
183 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 182 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
184 | mailfolder*folder; | 183 | mailfolder*folder; |
185 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 184 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
186 | r = mailfolder_connect(folder); | 185 | r = mailfolder_connect(folder); |
187 | if (r != MAIL_NO_ERROR) { | 186 | if (r != MAIL_NO_ERROR) { |
188 | Global::statusMessage(tr("Error initializing mbox")); | 187 | Global::statusMessage(tr("Error initializing mbox")); |
@@ -243,12 +242,12 @@ void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target) | |||
243 | } | 242 | } |
244 | } | 243 | } |
245 | 244 | ||
246 | int MBOXwrapper::deleteAllMail(const Folder*tfolder) | 245 | int MBOXwrapper::deleteAllMail(const FolderP&tfolder) |
247 | { | 246 | { |
248 | if (!tfolder) return 0; | 247 | if (!tfolder) return 0; |
249 | QString p = MBOXPath+"/"+tfolder->getDisplayName(); | 248 | QString p = MBOXPath+"/"+tfolder->getDisplayName(); |
250 | int res = 1; | 249 | int res = 1; |
251 | 250 | ||
252 | mailfolder*folder = 0; | 251 | mailfolder*folder = 0; |
253 | mailmessage_list*l=0; | 252 | mailmessage_list*l=0; |
254 | mailstorage*storage = mailstorage_new(NULL); | 253 | mailstorage*storage = mailstorage_new(NULL); |
@@ -258,7 +257,7 @@ int MBOXwrapper::deleteAllMail(const Folder*tfolder) | |||
258 | res = 0; | 257 | res = 0; |
259 | } | 258 | } |
260 | if (res) { | 259 | if (res) { |
261 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 260 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
262 | r = mailfolder_connect(folder); | 261 | r = mailfolder_connect(folder); |
263 | if (r != MAIL_NO_ERROR) { | 262 | if (r != MAIL_NO_ERROR) { |
264 | Global::statusMessage(tr("Error initializing mbox")); | 263 | Global::statusMessage(tr("Error initializing mbox")); |
@@ -286,7 +285,7 @@ int MBOXwrapper::deleteAllMail(const Folder*tfolder) | |||
286 | return res; | 285 | return res; |
287 | } | 286 | } |
288 | 287 | ||
289 | int MBOXwrapper::deleteMbox(const Folder*tfolder) | 288 | int MBOXwrapper::deleteMbox(const FolderP&tfolder) |
290 | { | 289 | { |
291 | if (!tfolder) return 0; | 290 | if (!tfolder) return 0; |
292 | QString p = MBOXPath+"/"+tfolder->getDisplayName(); | 291 | QString p = MBOXPath+"/"+tfolder->getDisplayName(); |
@@ -316,7 +315,7 @@ void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | |||
316 | return; | 315 | return; |
317 | } | 316 | } |
318 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 317 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
319 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 318 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
320 | r = mailfolder_connect(folder); | 319 | r = mailfolder_connect(folder); |
321 | r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, | 320 | r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, |
322 | &target_stat.message_recent,&target_stat.message_unseen); | 321 | &target_stat.message_recent,&target_stat.message_unseen); |
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 | |||
@@ -16,16 +16,17 @@ class MBOXwrapper : public Genericwrapper | |||
16 | public: | 16 | public: |
17 | MBOXwrapper(const QString & dir,const QString&name); | 17 | MBOXwrapper(const QString & dir,const QString&name); |
18 | virtual ~MBOXwrapper(); | 18 | virtual ~MBOXwrapper(); |
19 | 19 | ||
20 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 20 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
21 | virtual QList<Folder>* listFolders(); | 21 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); |
22 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 22 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
23 | 23 | ||
24 | virtual void deleteMail(const RecMail&mail); | 24 | virtual void deleteMail(const RecMail&mail); |
25 | virtual void answeredMail(const RecMail&mail); | 25 | virtual void answeredMail(const RecMail&mail); |
26 | 26 | ||
27 | virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); | 27 | virtual int createMbox(const QString&folder,const Opie::osmart_pointer<Folder>&f=0, |
28 | virtual int deleteMbox(const Folder*); | 28 | const QString&d="",bool s=false); |
29 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&); | ||
29 | 30 | ||
30 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 31 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
31 | 32 | ||
@@ -34,7 +35,7 @@ public: | |||
34 | 35 | ||
35 | virtual encodedString* fetchRawBody(const RecMail&mail); | 36 | virtual encodedString* fetchRawBody(const RecMail&mail); |
36 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); | 37 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); |
37 | virtual int deleteAllMail(const Folder*); | 38 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); |
38 | virtual MAILLIB::ATYPE getType()const; | 39 | virtual MAILLIB::ATYPE getType()const; |
39 | virtual const QString&getName()const; | 40 | virtual const QString&getName()const; |
40 | 41 | ||
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 | |||
@@ -76,10 +76,9 @@ void MHwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
76 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); | 76 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); |
77 | } | 77 | } |
78 | 78 | ||
79 | QList<Folder>* MHwrapper::listFolders() | 79 | QValueList<Opie::osmart_pointer<Folder> >* MHwrapper::listFolders() |
80 | { | 80 | { |
81 | QList<Folder> * folders = new QList<Folder>(); | 81 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); |
82 | folders->setAutoDelete( false ); | ||
83 | /* this is needed! */ | 82 | /* this is needed! */ |
84 | if (m_storage) mailstorage_disconnect(m_storage); | 83 | if (m_storage) mailstorage_disconnect(m_storage); |
85 | init_storage(); | 84 | init_storage(); |
@@ -144,7 +143,7 @@ RecBody MHwrapper::fetchBody( const RecMail &mail ) | |||
144 | qDebug("Error fetching mail %i",mail.getNumber()); | 143 | qDebug("Error fetching mail %i",mail.getNumber()); |
145 | return body; | 144 | return body; |
146 | } | 145 | } |
147 | body = parseMail(msg); | 146 | body = parseMail(msg); |
148 | mailmessage_fetch_result_free(msg,data); | 147 | mailmessage_fetch_result_free(msg,data); |
149 | return body; | 148 | return body; |
150 | } | 149 | } |
@@ -169,7 +168,7 @@ QString MHwrapper::buildPath(const QString&p) | |||
169 | return f; | 168 | return f; |
170 | } | 169 | } |
171 | 170 | ||
172 | int MHwrapper::createMbox(const QString&folder,const Folder*pfolder,const QString&,bool ) | 171 | int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QString&,bool ) |
173 | { | 172 | { |
174 | init_storage(); | 173 | init_storage(); |
175 | if (!m_storage) { | 174 | if (!m_storage) { |
@@ -263,7 +262,7 @@ void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) | |||
263 | } | 262 | } |
264 | } | 263 | } |
265 | 264 | ||
266 | int MHwrapper::deleteAllMail(const Folder*tfolder) | 265 | int MHwrapper::deleteAllMail(const FolderP&tfolder) |
267 | { | 266 | { |
268 | init_storage(); | 267 | init_storage(); |
269 | if (!m_storage) { | 268 | if (!m_storage) { |
@@ -298,7 +297,7 @@ int MHwrapper::deleteAllMail(const Folder*tfolder) | |||
298 | return res; | 297 | return res; |
299 | } | 298 | } |
300 | 299 | ||
301 | int MHwrapper::deleteMbox(const Folder*tfolder) | 300 | int MHwrapper::deleteMbox(const FolderP&tfolder) |
302 | { | 301 | { |
303 | init_storage(); | 302 | init_storage(); |
304 | if (!m_storage) { | 303 | if (!m_storage) { |
@@ -306,9 +305,9 @@ int MHwrapper::deleteMbox(const Folder*tfolder) | |||
306 | } | 305 | } |
307 | if (!tfolder) return 0; | 306 | if (!tfolder) return 0; |
308 | if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; | 307 | if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; |
309 | 308 | ||
310 | int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); | 309 | int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); |
311 | 310 | ||
312 | if (r != MAIL_NO_ERROR) { | 311 | if (r != MAIL_NO_ERROR) { |
313 | qDebug("error deleting mail box"); | 312 | qDebug("error deleting mail box"); |
314 | return 0; | 313 | return 0; |
@@ -319,7 +318,7 @@ int MHwrapper::deleteMbox(const Folder*tfolder) | |||
319 | command << "-c"; | 318 | command << "-c"; |
320 | command << cmd.latin1(); | 319 | command << cmd.latin1(); |
321 | OProcess *process = new OProcess(); | 320 | OProcess *process = new OProcess(); |
322 | 321 | ||
323 | connect(process, SIGNAL(processExited(OProcess*)), | 322 | connect(process, SIGNAL(processExited(OProcess*)), |
324 | this, SLOT( processEnded(OProcess*))); | 323 | this, SLOT( processEnded(OProcess*))); |
325 | connect(process, SIGNAL( receivedStderr(OProcess*,char*,int)), | 324 | connect(process, SIGNAL( receivedStderr(OProcess*,char*,int)), |
@@ -386,7 +385,7 @@ void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractM | |||
386 | } | 385 | } |
387 | qDebug("Using internal routines for move/copy"); | 386 | qDebug("Using internal routines for move/copy"); |
388 | QString tf = buildPath(targetFolder); | 387 | QString tf = buildPath(targetFolder); |
389 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); | 388 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); |
390 | if (r != MAIL_NO_ERROR) { | 389 | if (r != MAIL_NO_ERROR) { |
391 | qDebug("Error selecting source mailbox"); | 390 | qDebug("Error selecting source mailbox"); |
392 | return; | 391 | return; |
@@ -401,7 +400,8 @@ void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractM | |||
401 | } | 400 | } |
402 | } | 401 | } |
403 | 402 | ||
404 | void MHwrapper::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 403 | void MHwrapper::mvcpAllMails(const FolderP&fromFolder, |
404 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | ||
405 | { | 405 | { |
406 | init_storage(); | 406 | init_storage(); |
407 | if (!m_storage) { | 407 | if (!m_storage) { |
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 | |||
@@ -18,18 +18,20 @@ class MHwrapper : public Genericwrapper | |||
18 | public: | 18 | public: |
19 | MHwrapper(const QString & dir,const QString&name); | 19 | MHwrapper(const QString & dir,const QString&name); |
20 | virtual ~MHwrapper(); | 20 | virtual ~MHwrapper(); |
21 | 21 | ||
22 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 22 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
23 | virtual QList<Folder>* listFolders(); | 23 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); |
24 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 24 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
25 | 25 | ||
26 | virtual void deleteMail(const RecMail&mail); | 26 | virtual void deleteMail(const RecMail&mail); |
27 | virtual void answeredMail(const RecMail&mail); | 27 | virtual void answeredMail(const RecMail&mail); |
28 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 28 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
29 | virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 29 | virtual void mvcpAllMails(const Opie::osmart_pointer<Folder>&fromFolder, |
30 | 30 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | |
31 | virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); | 31 | |
32 | virtual int deleteMbox(const Folder*); | 32 | virtual int createMbox(const QString&folder,const Opie::osmart_pointer<Folder>&f=0, |
33 | const QString&d="",bool s=false); | ||
34 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&); | ||
33 | 35 | ||
34 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 36 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
35 | 37 | ||
@@ -38,7 +40,7 @@ public: | |||
38 | 40 | ||
39 | virtual encodedString* fetchRawBody(const RecMail&mail); | 41 | virtual encodedString* fetchRawBody(const RecMail&mail); |
40 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); | 42 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); |
41 | virtual int deleteAllMail(const Folder*); | 43 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); |
42 | virtual MAILLIB::ATYPE getType()const; | 44 | virtual MAILLIB::ATYPE getType()const; |
43 | virtual const QString&getName()const; | 45 | virtual const QString&getName()const; |
44 | 46 | ||
@@ -50,10 +52,10 @@ protected: | |||
50 | QString buildPath(const QString&p); | 52 | QString buildPath(const QString&p); |
51 | QString MHPath; | 53 | QString MHPath; |
52 | QString MHName; | 54 | QString MHName; |
53 | 55 | ||
54 | void init_storage(); | 56 | void init_storage(); |
55 | void clean_storage(); | 57 | void clean_storage(); |
56 | 58 | ||
57 | bool removeMboxfailed; | 59 | bool removeMboxfailed; |
58 | }; | 60 | }; |
59 | 61 | ||
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 | |||
@@ -188,10 +188,9 @@ void NNTPwrapper::logout() | |||
188 | m_nntp = 0; | 188 | m_nntp = 0; |
189 | } | 189 | } |
190 | 190 | ||
191 | QList<Folder>* NNTPwrapper::listFolders() { | 191 | QValueList<Opie::osmart_pointer<Folder> >* NNTPwrapper::listFolders() { |
192 | 192 | ||
193 | QList<Folder> * folders = new QList<Folder>(); | 193 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); |
194 | folders->setAutoDelete( false ); | ||
195 | QStringList groups; | 194 | QStringList groups; |
196 | if (account) { | 195 | if (account) { |
197 | groups = account->getGroups(); | 196 | groups = account->getGroups(); |
@@ -204,7 +203,7 @@ QList<Folder>* NNTPwrapper::listFolders() { | |||
204 | 203 | ||
205 | /* we made this method in raw nntp access of etpan and not via generic interface | 204 | /* we made this method in raw nntp access of etpan and not via generic interface |
206 | * 'cause in that case there will be doubled copy operations. eg. the etpan would | 205 | * 'cause in that case there will be doubled copy operations. eg. the etpan would |
207 | * copy that stuff into its own structures and we must copy it into useable c++ | 206 | * copy that stuff into its own structures and we must copy it into useable c++ |
208 | * structures for our frontend. this would not make sense, so it is better to reimplement | 207 | * structures for our frontend. this would not make sense, so it is better to reimplement |
209 | * the stuff from generic interface of etpan but copy it direct to qt classes. | 208 | * the stuff from generic interface of etpan but copy it direct to qt classes. |
210 | */ | 209 | */ |
@@ -280,5 +279,5 @@ const QString&NNTPwrapper::getName()const{ | |||
280 | void NNTPwrapper::deleteMail(const RecMail&) { | 279 | void NNTPwrapper::deleteMail(const RecMail&) { |
281 | } | 280 | } |
282 | 281 | ||
283 | int NNTPwrapper::deleteAllMail(const Folder*) { | 282 | int NNTPwrapper::deleteAllMail(const FolderP&) { |
284 | } | 283 | } |
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 | |||
@@ -22,13 +22,13 @@ public: | |||
22 | /* mailbox will be ignored */ | 22 | /* mailbox will be ignored */ |
23 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 23 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
24 | /* should only get the subscribed one */ | 24 | /* should only get the subscribed one */ |
25 | virtual QList<Folder>* listFolders(); | 25 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); |
26 | /* mailbox will be ignored */ | 26 | /* mailbox will be ignored */ |
27 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 27 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
28 | QStringList listAllNewsgroups(const QString&mask = QString::null); | 28 | QStringList listAllNewsgroups(const QString&mask = QString::null); |
29 | virtual void deleteMail(const RecMail&mail); | 29 | virtual void deleteMail(const RecMail&mail); |
30 | virtual void answeredMail(const RecMail&mail); | 30 | virtual void answeredMail(const RecMail&mail); |
31 | virtual int deleteAllMail(const Folder*); | 31 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); |
32 | 32 | ||
33 | virtual RecBody fetchBody( const RecMail &mail ); | 33 | virtual RecBody fetchBody( const RecMail &mail ); |
34 | virtual encodedString* fetchRawBody(const RecMail&mail); | 34 | virtual encodedString* fetchRawBody(const RecMail&mail); |
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 | |||
@@ -177,10 +177,9 @@ void POP3wrapper::logout() | |||
177 | } | 177 | } |
178 | 178 | ||
179 | 179 | ||
180 | QList<Folder>* POP3wrapper::listFolders() { | 180 | QValueList<Opie::osmart_pointer<Folder> >* POP3wrapper::listFolders() { |
181 | QList<Folder> * folders = new QList<Folder>(); | 181 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<FolderP>(); |
182 | folders->setAutoDelete( false ); | 182 | FolderP inb=new Folder("INBOX","/"); |
183 | Folder*inb=new Folder("INBOX","/"); | ||
184 | folders->append(inb); | 183 | folders->append(inb); |
185 | return folders; | 184 | return folders; |
186 | } | 185 | } |
@@ -197,7 +196,7 @@ void POP3wrapper::deleteMail(const RecMail&mail) { | |||
197 | 196 | ||
198 | void POP3wrapper::answeredMail(const RecMail&) {} | 197 | void POP3wrapper::answeredMail(const RecMail&) {} |
199 | 198 | ||
200 | int POP3wrapper::deleteAllMail(const Folder*) { | 199 | int POP3wrapper::deleteAllMail(const FolderP&) { |
201 | login(); | 200 | login(); |
202 | if (!m_pop3) | 201 | if (!m_pop3) |
203 | return 0; | 202 | return 0; |
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 | |||
@@ -18,13 +18,13 @@ public: | |||
18 | virtual ~POP3wrapper(); | 18 | virtual ~POP3wrapper(); |
19 | /* mailbox will be ignored */ | 19 | /* mailbox will be ignored */ |
20 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 20 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
21 | virtual QList<Folder>* listFolders(); | 21 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); |
22 | /* mailbox will be ignored */ | 22 | /* mailbox will be ignored */ |
23 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 23 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
24 | 24 | ||
25 | virtual void deleteMail(const RecMail&mail); | 25 | virtual void deleteMail(const RecMail&mail); |
26 | virtual void answeredMail(const RecMail&mail); | 26 | virtual void answeredMail(const RecMail&mail); |
27 | virtual int deleteAllMail(const Folder*); | 27 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); |
28 | 28 | ||
29 | virtual RecBody fetchBody( const RecMail &mail ); | 29 | virtual RecBody fetchBody( const RecMail &mail ); |
30 | virtual encodedString* fetchRawBody(const RecMail&mail); | 30 | virtual encodedString* fetchRawBody(const RecMail&mail); |