author | alwin <alwin> | 2004-03-12 19:24:38 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-12 19:24:38 (UTC) |
commit | b600871ce93553a116a66fd80acd6dfc1cc46829 (patch) (unidiff) | |
tree | b361346a49e09d9f0220993583bf183cf29bd974 /noncore | |
parent | 874d5a34eca296263dcd1adf857aebe9981825a1 (diff) | |
download | opie-b600871ce93553a116a66fd80acd6dfc1cc46829.zip opie-b600871ce93553a116a66fd80acd6dfc1cc46829.tar.gz opie-b600871ce93553a116a66fd80acd6dfc1cc46829.tar.bz2 |
some more smart-pointers
some bugfixes
some renaming of internals
38 files changed, 347 insertions, 345 deletions
diff --git a/noncore/net/mail/accountitem.cpp b/noncore/net/mail/accountitem.cpp index 3e12563..9a09c18 100644 --- a/noncore/net/mail/accountitem.cpp +++ b/noncore/net/mail/accountitem.cpp | |||
@@ -51,3 +51,3 @@ AbstractMail *POP3viewItem::getWrapper() | |||
51 | 51 | ||
52 | void POP3viewItem::refresh( QList<RecMail> & ) | 52 | void POP3viewItem::refresh(QValueList<Opie::OSmartPointer<RecMail> > & ) |
53 | { | 53 | { |
@@ -77,3 +77,3 @@ void POP3viewItem::refresh() | |||
77 | 77 | ||
78 | RecBody POP3viewItem::fetchBody( const RecMail &mail ) | 78 | RecBody POP3viewItem::fetchBody( const RecMailP &mail ) |
79 | { | 79 | { |
@@ -156,3 +156,3 @@ POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , | |||
156 | 156 | ||
157 | void POP3folderItem::refresh(QList<RecMail>&target) | 157 | void POP3folderItem::refresh(QValueList<RecMailP>&target) |
158 | { | 158 | { |
@@ -162,3 +162,3 @@ void POP3folderItem::refresh(QList<RecMail>&target) | |||
162 | 162 | ||
163 | RecBody POP3folderItem::fetchBody(const RecMail&aMail) | 163 | RecBody POP3folderItem::fetchBody(const RecMailP&aMail) |
164 | { | 164 | { |
@@ -241,3 +241,3 @@ AbstractMail *NNTPviewItem::getWrapper() | |||
241 | 241 | ||
242 | void NNTPviewItem::refresh( QList<RecMail> & ) | 242 | void NNTPviewItem::refresh( QValueList<RecMailP> & ) |
243 | { | 243 | { |
@@ -268,3 +268,3 @@ void NNTPviewItem::refresh() | |||
268 | 268 | ||
269 | RecBody NNTPviewItem::fetchBody( const RecMail &mail ) | 269 | RecBody NNTPviewItem::fetchBody( const RecMailP &mail ) |
270 | { | 270 | { |
@@ -360,3 +360,3 @@ NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent | |||
360 | 360 | ||
361 | void NNTPfolderItem::refresh(QList<RecMail>&target) | 361 | void NNTPfolderItem::refresh(QValueList<RecMailP>&target) |
362 | { | 362 | { |
@@ -366,3 +366,3 @@ void NNTPfolderItem::refresh(QList<RecMail>&target) | |||
366 | 366 | ||
367 | RecBody NNTPfolderItem::fetchBody(const RecMail&aMail) | 367 | RecBody NNTPfolderItem::fetchBody(const RecMailP&aMail) |
368 | { | 368 | { |
@@ -430,3 +430,3 @@ AbstractMail *IMAPviewItem::getWrapper() | |||
430 | 430 | ||
431 | void IMAPviewItem::refresh(QList<RecMail>&) | 431 | void IMAPviewItem::refresh(QValueList<RecMailP>&) |
432 | { | 432 | { |
@@ -563,3 +563,3 @@ void IMAPviewItem::contextMenuSelected(int id) | |||
563 | 563 | ||
564 | RecBody IMAPviewItem::fetchBody(const RecMail&) | 564 | RecBody IMAPviewItem::fetchBody(const RecMailP&) |
565 | { | 565 | { |
@@ -611,3 +611,3 @@ const QString& IMAPfolderItem::Delemiter()const | |||
611 | 611 | ||
612 | void IMAPfolderItem::refresh(QList<RecMail>&target) | 612 | void IMAPfolderItem::refresh(QValueList<RecMailP>&target) |
613 | { | 613 | { |
@@ -623,3 +623,3 @@ void IMAPfolderItem::refresh(QList<RecMail>&target) | |||
623 | 623 | ||
624 | RecBody IMAPfolderItem::fetchBody(const RecMail&aMail) | 624 | RecBody IMAPfolderItem::fetchBody(const RecMailP&aMail) |
625 | { | 625 | { |
@@ -750,3 +750,3 @@ AbstractMail *MHviewItem::getWrapper() | |||
750 | 750 | ||
751 | void MHviewItem::refresh( QList<RecMail> & target) | 751 | void MHviewItem::refresh( QValueList<RecMailP> & target) |
752 | { | 752 | { |
@@ -801,3 +801,3 @@ void MHviewItem::refresh(bool force) | |||
801 | 801 | ||
802 | RecBody MHviewItem::fetchBody( const RecMail &mail ) | 802 | RecBody MHviewItem::fetchBody( const RecMailP &mail ) |
803 | { | 803 | { |
@@ -916,3 +916,3 @@ const FolderP&MHfolderItem::getFolder()const | |||
916 | 916 | ||
917 | void MHfolderItem::refresh(QList<RecMail>&target) | 917 | void MHfolderItem::refresh(QValueList<RecMailP>&target) |
918 | { | 918 | { |
@@ -922,3 +922,3 @@ void MHfolderItem::refresh(QList<RecMail>&target) | |||
922 | 922 | ||
923 | RecBody MHfolderItem::fetchBody(const RecMail&aMail) | 923 | RecBody MHfolderItem::fetchBody(const RecMailP&aMail) |
924 | { | 924 | { |
@@ -1044,3 +1044,3 @@ AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after ) | |||
1044 | 1044 | ||
1045 | AccountViewItem::AccountViewItem( const Opie::osmart_pointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ) | 1045 | AccountViewItem::AccountViewItem( const Opie::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ) |
1046 | :QListViewItem( parent,after ),folder(folderInit) | 1046 | :QListViewItem( parent,after ),folder(folderInit) |
diff --git a/noncore/net/mail/accountitem.h b/noncore/net/mail/accountitem.h index 8f712f5..276eae0 100644 --- a/noncore/net/mail/accountitem.h +++ b/noncore/net/mail/accountitem.h | |||
@@ -5,3 +5,3 @@ | |||
5 | #include <qlist.h> | 5 | #include <qlist.h> |
6 | #include <opie2/osmart_pointer.h> | 6 | #include <opie2/osmartpointer.h> |
7 | 7 | ||
@@ -26,7 +26,7 @@ public: | |||
26 | AccountViewItem( QListViewItem *parent , QListViewItem*after ); | 26 | AccountViewItem( QListViewItem *parent , QListViewItem*after ); |
27 | AccountViewItem( const Opie::osmart_pointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ); | 27 | AccountViewItem( const Opie::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ); |
28 | 28 | ||
29 | virtual ~AccountViewItem(); | 29 | virtual ~AccountViewItem(); |
30 | virtual void refresh(QList<RecMail>&)=0; | 30 | virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&)=0; |
31 | virtual RecBody fetchBody(const RecMail&)=0; | 31 | virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&)=0; |
32 | virtual QPopupMenu * getContextMenu(){return 0;}; | 32 | virtual QPopupMenu * getContextMenu(){return 0;}; |
@@ -41,6 +41,6 @@ protected: | |||
41 | virtual void removeChilds(); | 41 | virtual void removeChilds(); |
42 | virtual void deleteAllMail(AbstractMail*wrapper,const Opie::osmart_pointer<Folder>&f); | 42 | virtual void deleteAllMail(AbstractMail*wrapper,const Opie::OSmartPointer<Folder>&f); |
43 | static const QString contextName; | 43 | static const QString contextName; |
44 | AccountView*m_Backlink; | 44 | AccountView*m_Backlink; |
45 | Opie::osmart_pointer<Folder> folder; | 45 | Opie::OSmartPointer<Folder> folder; |
46 | }; | 46 | }; |
@@ -53,4 +53,4 @@ public: | |||
53 | virtual ~POP3viewItem(); | 53 | virtual ~POP3viewItem(); |
54 | virtual void refresh( QList<RecMail> &target ); | 54 | virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&target ); |
55 | virtual RecBody fetchBody( const RecMail &mail ); | 55 | virtual RecBody fetchBody( const Opie::OSmartPointer<RecMail> &mail ); |
56 | AbstractMail *getWrapper(); | 56 | AbstractMail *getWrapper(); |
@@ -71,6 +71,6 @@ class POP3folderItem : public AccountViewItem | |||
71 | public: | 71 | public: |
72 | POP3folderItem( const Opie::osmart_pointer<Folder>&folder, POP3viewItem *parent , QListViewItem*after ); | 72 | POP3folderItem( const Opie::OSmartPointer<Folder>&folder, POP3viewItem *parent , QListViewItem*after ); |
73 | virtual ~POP3folderItem(); | 73 | virtual ~POP3folderItem(); |
74 | virtual void refresh(QList<RecMail>&); | 74 | virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&); |
75 | virtual RecBody fetchBody(const RecMail&); | 75 | virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&); |
76 | virtual QPopupMenu * getContextMenu(); | 76 | virtual QPopupMenu * getContextMenu(); |
@@ -90,4 +90,4 @@ public: | |||
90 | virtual ~NNTPviewItem(); | 90 | virtual ~NNTPviewItem(); |
91 | virtual void refresh( QList<RecMail> &target ); | 91 | virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&target ); |
92 | virtual RecBody fetchBody( const RecMail &mail ); | 92 | virtual RecBody fetchBody( const Opie::OSmartPointer<RecMail> &mail ); |
93 | AbstractMail *getWrapper(); | 93 | AbstractMail *getWrapper(); |
@@ -109,6 +109,6 @@ class NNTPfolderItem : public AccountViewItem | |||
109 | public: | 109 | public: |
110 | NNTPfolderItem(const Opie::osmart_pointer<Folder>&folder, NNTPviewItem *parent , QListViewItem*after ); | 110 | NNTPfolderItem(const Opie::OSmartPointer<Folder>&folder, NNTPviewItem *parent , QListViewItem*after ); |
111 | virtual ~NNTPfolderItem(); | 111 | virtual ~NNTPfolderItem(); |
112 | virtual void refresh(QList<RecMail>&); | 112 | virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&); |
113 | virtual RecBody fetchBody(const RecMail&); | 113 | virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&); |
114 | virtual QPopupMenu * getContextMenu(); | 114 | virtual QPopupMenu * getContextMenu(); |
@@ -129,4 +129,4 @@ public: | |||
129 | virtual ~IMAPviewItem(); | 129 | virtual ~IMAPviewItem(); |
130 | virtual void refresh(QList<RecMail>&); | 130 | virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&); |
131 | virtual RecBody fetchBody(const RecMail&); | 131 | virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&); |
132 | AbstractMail *getWrapper(); | 132 | AbstractMail *getWrapper(); |
@@ -149,7 +149,7 @@ class IMAPfolderItem : public AccountViewItem | |||
149 | public: | 149 | public: |
150 | IMAPfolderItem( const Opie::osmart_pointer<Folder>&folder, IMAPviewItem *parent , QListViewItem*after ); | 150 | IMAPfolderItem( const Opie::OSmartPointer<Folder>&folder, IMAPviewItem *parent , QListViewItem*after ); |
151 | IMAPfolderItem( const Opie::osmart_pointer<Folder>&folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); | 151 | IMAPfolderItem( const Opie::OSmartPointer<Folder>&folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); |
152 | virtual ~IMAPfolderItem(); | 152 | virtual ~IMAPfolderItem(); |
153 | virtual void refresh(QList<RecMail>&); | 153 | virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&); |
154 | virtual RecBody fetchBody(const RecMail&); | 154 | virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&); |
155 | virtual QPopupMenu * getContextMenu(); | 155 | virtual QPopupMenu * getContextMenu(); |
@@ -171,4 +171,4 @@ public: | |||
171 | virtual ~MHviewItem(); | 171 | virtual ~MHviewItem(); |
172 | virtual void refresh( QList<RecMail> &target ); | 172 | virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&target ); |
173 | virtual RecBody fetchBody( const RecMail &mail ); | 173 | virtual RecBody fetchBody( const Opie::OSmartPointer<RecMail> &mail ); |
174 | AbstractMail *getWrapper(); | 174 | AbstractMail *getWrapper(); |
@@ -191,10 +191,10 @@ class MHfolderItem : public AccountViewItem | |||
191 | public: | 191 | public: |
192 | MHfolderItem( const Opie::osmart_pointer<Folder>&folder, MHviewItem *parent , QListViewItem*after ); | 192 | MHfolderItem( const Opie::OSmartPointer<Folder>&folder, MHviewItem *parent , QListViewItem*after ); |
193 | MHfolderItem( const Opie::osmart_pointer<Folder>&folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master); | 193 | MHfolderItem( const Opie::OSmartPointer<Folder>&folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master); |
194 | virtual ~MHfolderItem(); | 194 | virtual ~MHfolderItem(); |
195 | virtual void refresh(QList<RecMail>&); | 195 | virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&); |
196 | virtual RecBody fetchBody(const RecMail&); | 196 | virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&); |
197 | virtual QPopupMenu * getContextMenu(); | 197 | virtual QPopupMenu * getContextMenu(); |
198 | virtual void contextMenuSelected(int); | 198 | virtual void contextMenuSelected(int); |
199 | virtual const Opie::osmart_pointer<Folder>&getFolder()const; | 199 | virtual const Opie::OSmartPointer<Folder>&getFolder()const; |
200 | virtual bool isDraftfolder(); | 200 | virtual bool isDraftfolder(); |
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index 297f553..26107ff 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -94,7 +94,6 @@ void AccountView::refresh(QListViewItem *item) | |||
94 | m_currentItem = item; | 94 | m_currentItem = item; |
95 | QList<RecMail> headerlist; | 95 | QValueList<RecMailP> headerlist; |
96 | headerlist.setAutoDelete(true); | ||
97 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 96 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
98 | view->refresh(headerlist); | 97 | view->refresh(headerlist); |
99 | emit refreshMailview(&headerlist); | 98 | emit refreshMailview(headerlist); |
100 | } | 99 | } |
@@ -106,7 +105,6 @@ void AccountView::refreshCurrent() | |||
106 | if ( !m_currentItem ) return; | 105 | if ( !m_currentItem ) return; |
107 | QList<RecMail> headerlist; | 106 | QValueList<RecMailP> headerlist; |
108 | headerlist.setAutoDelete(true); | ||
109 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | 107 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); |
110 | view->refresh(headerlist); | 108 | view->refresh(headerlist); |
111 | emit refreshMailview(&headerlist); | 109 | emit refreshMailview(headerlist); |
112 | } | 110 | } |
@@ -117,3 +115,3 @@ void AccountView::refreshAll() | |||
117 | 115 | ||
118 | RecBody AccountView::fetchBody(const RecMail&aMail) | 116 | RecBody AccountView::fetchBody(const RecMailP&aMail) |
119 | { | 117 | { |
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h index 3478c0b..d236058 100644 --- a/noncore/net/mail/accountview.h +++ b/noncore/net/mail/accountview.h | |||
@@ -5,7 +5,6 @@ | |||
5 | #include <qlist.h> | 5 | #include <qlist.h> |
6 | #include <opie2/osmart_pointer.h> | 6 | #include <opie2/osmartpointer.h> |
7 | #include <libmailwrapper/mailtypes.h> | ||
7 | 8 | ||
8 | class Selectstore; | 9 | class Selectstore; |
9 | class RecMail; | ||
10 | class RecBody; | ||
11 | class Folder; | 10 | class Folder; |
@@ -24,4 +23,4 @@ public: | |||
24 | virtual void populate( QList<Account> list ); | 23 | virtual void populate( QList<Account> list ); |
25 | virtual RecBody fetchBody(const RecMail&aMail); | 24 | virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&aMail); |
26 | virtual void downloadMails(const Opie::osmart_pointer<Folder>&fromFolder,AbstractMail*fromWrapper); | 25 | virtual void downloadMails(const Opie::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); |
27 | virtual bool currentisDraft(); | 26 | virtual bool currentisDraft(); |
@@ -37,3 +36,3 @@ public slots: | |||
37 | signals: | 36 | signals: |
38 | void refreshMailview(QList<RecMail>*); | 37 | void refreshMailview(const QValueList<RecMailP>& ); |
39 | 38 | ||
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp index 445cc5e..74ccc7b 100644 --- a/noncore/net/mail/composemail.cpp +++ b/noncore/net/mail/composemail.cpp | |||
@@ -190,3 +190,3 @@ void ComposeMail::accept() | |||
190 | #endif | 190 | #endif |
191 | Opie::osmart_pointer<Mail> mail=new Mail; | 191 | Opie::OSmartPointer<Mail> mail=new Mail; |
192 | 192 | ||
@@ -238,3 +238,3 @@ void ComposeMail::reject() | |||
238 | if (yesno == 0) { | 238 | if (yesno == 0) { |
239 | Opie::osmart_pointer<Mail> mail=new Mail(); | 239 | Opie::OSmartPointer<Mail> mail=new Mail(); |
240 | mail->setMail(fromBox->currentText()); | 240 | mail->setMail(fromBox->currentText()); |
@@ -277,11 +277,11 @@ ComposeMail::~ComposeMail() | |||
277 | 277 | ||
278 | void ComposeMail::reEditMail(const RecMail¤t) | 278 | void ComposeMail::reEditMail(const RecMailP¤t) |
279 | { | 279 | { |
280 | RecMail data = current; | 280 | RecMailP data = current; |
281 | message->setText(data.Wrapper()->fetchBody(current).Bodytext()); | 281 | message->setText(data->Wrapper()->fetchBody(current).Bodytext()); |
282 | subjectLine->setText( data.getSubject()); | 282 | subjectLine->setText( data->getSubject()); |
283 | toLine->setText(data.To().join(",")); | 283 | toLine->setText(data->To().join(",")); |
284 | ccLine->setText(data.CC().join(",")); | 284 | ccLine->setText(data->CC().join(",")); |
285 | bccLine->setText(data.Bcc().join(",")); | 285 | bccLine->setText(data->Bcc().join(",")); |
286 | replyLine->setText(data.Replyto()); | 286 | replyLine->setText(data->Replyto()); |
287 | } | 287 | } |
diff --git a/noncore/net/mail/composemail.h b/noncore/net/mail/composemail.h index 1b9fc79..c12eb30 100644 --- a/noncore/net/mail/composemail.h +++ b/noncore/net/mail/composemail.h | |||
@@ -11,3 +11,5 @@ | |||
11 | 11 | ||
12 | class RecMail; | ||
12 | 13 | ||
14 | #include <opie2/osmartpointer.h> | ||
13 | 15 | ||
@@ -37,3 +39,3 @@ public: | |||
37 | 39 | ||
38 | void reEditMail(const RecMail¤t); | 40 | void reEditMail(const Opie::OSmartPointer<RecMail>¤t); |
39 | 41 | ||
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index 7e6d383..68a7a4d 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp | |||
@@ -83,3 +83,3 @@ QString AbstractMail::convert_String(const char*text) | |||
83 | { | 83 | { |
84 | size_t index = 0; | 84 | //size_t index = 0; |
85 | char*res = 0; | 85 | char*res = 0; |
@@ -113,3 +113,3 @@ QString AbstractMail::gen_attachment_id() | |||
113 | 113 | ||
114 | int AbstractMail::createMbox(const QString&,const FolderP&,const QString& delemiter,bool) | 114 | int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool) |
115 | { | 115 | { |
@@ -131,3 +131,3 @@ QString AbstractMail::draftFolder() | |||
131 | /* temporary - will be removed when implemented in all classes */ | 131 | /* temporary - will be removed when implemented in all classes */ |
132 | void AbstractMail::deleteMails(const QString &,QList<RecMail> &) | 132 | void AbstractMail::deleteMails(const QString &,const QValueList<Opie::OSmartPointer<RecMail> > &) |
133 | { | 133 | { |
@@ -138,3 +138,3 @@ void AbstractMail::mvcpAllMails(const FolderP&fromFolder, | |||
138 | { | 138 | { |
139 | QList<RecMail> t; | 139 | QValueList<RecMailP> t; |
140 | listMessages(fromFolder->getName(),t); | 140 | listMessages(fromFolder->getName(),t); |
@@ -142,4 +142,4 @@ void AbstractMail::mvcpAllMails(const FolderP&fromFolder, | |||
142 | while (t.count()>0) { | 142 | while (t.count()>0) { |
143 | RecMail*r = t.at(0); | 143 | RecMailP r = (*t.begin()); |
144 | st = fetchRawBody(*r); | 144 | st = fetchRawBody(r); |
145 | if (st) { | 145 | if (st) { |
@@ -148,3 +148,3 @@ void AbstractMail::mvcpAllMails(const FolderP&fromFolder, | |||
148 | } | 148 | } |
149 | t.removeFirst(); | 149 | t.remove(t.begin()); |
150 | } | 150 | } |
@@ -155,3 +155,3 @@ void AbstractMail::mvcpAllMails(const FolderP&fromFolder, | |||
155 | 155 | ||
156 | void AbstractMail::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 156 | void AbstractMail::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) |
157 | { | 157 | { |
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h index d911468..b03d757 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.h +++ b/noncore/net/mail/libmailwrapper/abstractmail.h | |||
@@ -8,7 +8,5 @@ | |||
8 | #include <qobject.h> | 8 | #include <qobject.h> |
9 | #include <opie2/osmart_pointer.h> | 9 | #include <opie2/osmartpointer.h> |
10 | #include "mailtypes.h" | ||
10 | 11 | ||
11 | class RecMail; | ||
12 | class RecBody; | ||
13 | class RecPart; | ||
14 | class IMAPwrapper; | 12 | class IMAPwrapper; |
@@ -25,21 +23,21 @@ public: | |||
25 | virtual ~AbstractMail(){} | 23 | virtual ~AbstractMail(){} |
26 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders()=0; | 24 | virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders()=0; |
27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; | 25 | virtual void listMessages(const QString & mailbox,QValueList<RecMailP>&target )=0; |
28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; | 26 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; |
29 | virtual RecBody fetchBody(const RecMail&mail)=0; | 27 | virtual RecBody fetchBody(const RecMailP&mail)=0; |
30 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part)=0; | 28 | virtual QString fetchTextPart(const RecMailP&mail,const RecPart&part)=0; |
31 | virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part)=0; | 29 | virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPart&part)=0; |
32 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part)=0; | 30 | virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPart&part)=0; |
33 | virtual encodedString* fetchRawBody(const RecMail&mail)=0; | 31 | virtual encodedString* fetchRawBody(const RecMailP&mail)=0; |
34 | 32 | ||
35 | virtual void deleteMail(const RecMail&mail)=0; | 33 | virtual void deleteMail(const RecMailP&mail)=0; |
36 | virtual void answeredMail(const RecMail&mail)=0; | 34 | virtual void answeredMail(const RecMailP&mail)=0; |
37 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&)=0; | 35 | virtual int deleteAllMail(const Opie::OSmartPointer<Folder>&)=0; |
38 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); | 36 | virtual void deleteMails(const QString & FolderName,const QValueList<Opie::OSmartPointer<RecMail> >&target); |
39 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&)=0; | 37 | virtual int deleteMbox(const Opie::OSmartPointer<Folder>&)=0; |
40 | virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; | 38 | virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; |
41 | 39 | ||
42 | virtual void mvcpAllMails(const Opie::osmart_pointer<Folder>&fromFolder, | 40 | virtual void mvcpAllMails(const Opie::OSmartPointer<Folder>&fromFolder, |
43 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 41 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
44 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 42 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
45 | 43 | ||
@@ -51,3 +49,3 @@ public: | |||
51 | */ | 49 | */ |
52 | virtual int createMbox(const QString&,const Opie::osmart_pointer<Folder>&parentfolder=0, | 50 | virtual int createMbox(const QString&,const Opie::OSmartPointer<Folder>&parentfolder=0, |
53 | const QString& delemiter="/",bool getsubfolder=false); | 51 | const QString& delemiter="/",bool getsubfolder=false); |
diff --git a/noncore/net/mail/libmailwrapper/generatemail.cpp b/noncore/net/mail/libmailwrapper/generatemail.cpp index 4f7ec0c..cb7ccc0 100644 --- a/noncore/net/mail/libmailwrapper/generatemail.cpp +++ b/noncore/net/mail/libmailwrapper/generatemail.cpp | |||
@@ -281,3 +281,3 @@ mailimf_mailbox *Generatemail::newMailbox(const QString&name, const QString&mail | |||
281 | 281 | ||
282 | mailimf_fields *Generatemail::createImfFields(const Opie::osmart_pointer<Mail>&mail ) | 282 | mailimf_fields *Generatemail::createImfFields(const Opie::OSmartPointer<Mail>&mail ) |
283 | { | 283 | { |
@@ -401,3 +401,3 @@ mailimf_fields *Generatemail::createImfFields(const Opie::osmart_pointer<Mail>&m | |||
401 | 401 | ||
402 | mailmime *Generatemail::createMimeMail(const Opie::osmart_pointer<Mail> &mail ) { | 402 | mailmime *Generatemail::createMimeMail(const Opie::OSmartPointer<Mail> &mail ) { |
403 | mailmime *message, *txtPart; | 403 | mailmime *message, *txtPart; |
diff --git a/noncore/net/mail/libmailwrapper/generatemail.h b/noncore/net/mail/libmailwrapper/generatemail.h index 409a55e..c246a2a 100644 --- a/noncore/net/mail/libmailwrapper/generatemail.h +++ b/noncore/net/mail/libmailwrapper/generatemail.h | |||
@@ -8,3 +8,3 @@ | |||
8 | 8 | ||
9 | #include <opie2/osmart_pointer.h> | 9 | #include <opie2/osmartpointer.h> |
10 | 10 | ||
@@ -38,4 +38,4 @@ protected: | |||
38 | mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); | 38 | mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); |
39 | mailimf_fields *createImfFields(const Opie::osmart_pointer<Mail> &mail ); | 39 | mailimf_fields *createImfFields(const Opie::OSmartPointer<Mail> &mail ); |
40 | mailmime *createMimeMail(const Opie::osmart_pointer<Mail>&mail ); | 40 | mailmime *createMimeMail(const Opie::OSmartPointer<Mail>&mail ); |
41 | clist *createRcptList( mailimf_fields *fields ); | 41 | clist *createRcptList( mailimf_fields *fields ); |
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp index 6c8a5a1..ee2c8cd 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp | |||
@@ -333,3 +333,3 @@ QString Genericwrapper::parseMailboxList( mailimf_mailbox_list *list ) | |||
333 | 333 | ||
334 | encodedString* Genericwrapper::fetchDecodedPart(const RecMail&,const RecPart&part) | 334 | encodedString* Genericwrapper::fetchDecodedPart(const RecMailP&,const RecPart&part) |
335 | { | 335 | { |
@@ -341,3 +341,3 @@ encodedString* Genericwrapper::fetchDecodedPart(const RecMail&,const RecPart&par | |||
341 | 341 | ||
342 | encodedString* Genericwrapper::fetchRawPart(const RecMail&mail,const RecPart&part) | 342 | encodedString* Genericwrapper::fetchRawPart(const RecMailP&mail,const RecPart&part) |
343 | { | 343 | { |
@@ -349,3 +349,3 @@ encodedString* Genericwrapper::fetchRawPart(const RecMail&mail,const RecPart&par | |||
349 | 349 | ||
350 | QString Genericwrapper::fetchTextPart(const RecMail&mail,const RecPart&part) | 350 | QString Genericwrapper::fetchTextPart(const RecMailP&mail,const RecPart&part) |
351 | { | 351 | { |
@@ -389,3 +389,3 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) | |||
389 | 389 | ||
390 | void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const QString&mailbox,bool mbox_as_to) | 390 | void Genericwrapper::parseList(QValueList<Opie::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to) |
391 | { | 391 | { |
@@ -417,3 +417,3 @@ void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const | |||
417 | } | 417 | } |
418 | RecMail * mail = new RecMail(); | 418 | RecMailP mail = new RecMail(); |
419 | mail->setWrapper(this); | 419 | mail->setWrapper(this); |
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.h b/noncore/net/mail/libmailwrapper/genericwrapper.h index d0db45a..f9968d1 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.h +++ b/noncore/net/mail/libmailwrapper/genericwrapper.h | |||
@@ -36,7 +36,7 @@ public: | |||
36 | 36 | ||
37 | virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part); | 37 | virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPart&part); |
38 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part); | 38 | virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPart&part); |
39 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part); | 39 | virtual QString fetchTextPart(const RecMailP&mail,const RecPart&part); |
40 | virtual void cleanMimeCache(); | 40 | virtual void cleanMimeCache(); |
41 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&){return 1;} | 41 | virtual int deleteMbox(const Opie::OSmartPointer<Folder>&){return 1;} |
42 | virtual void logout(){}; | 42 | virtual void logout(){}; |
@@ -56,3 +56,3 @@ protected: | |||
56 | static QString getencoding(mailmime_mechanism*aEnc); | 56 | static QString getencoding(mailmime_mechanism*aEnc); |
57 | virtual void parseList(QList<RecMail> &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false); | 57 | virtual void parseList(QValueList<Opie::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false); |
58 | QStringList parseInreplies(mailimf_in_reply_to * in_replies); | 58 | QStringList parseInreplies(mailimf_in_reply_to * in_replies); |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 3b3be0f..071e734 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -207,3 +207,3 @@ void IMAPwrapper::logout() | |||
207 | 207 | ||
208 | void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | 208 | void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::OSmartPointer<RecMail> > &target ) |
209 | { | 209 | { |
@@ -268,3 +268,3 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
268 | 268 | ||
269 | QValueList<Opie::osmart_pointer<Folder> >* IMAPwrapper::listFolders() | 269 | QValueList<Opie::OSmartPointer<Folder> >* IMAPwrapper::listFolders() |
270 | { | 270 | { |
@@ -484,3 +484,3 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | |||
484 | 484 | ||
485 | RecBody IMAPwrapper::fetchBody(const RecMail&mail) | 485 | RecBody IMAPwrapper::fetchBody(const RecMailP&mail) |
486 | { | 486 | { |
@@ -496,3 +496,3 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail) | |||
496 | 496 | ||
497 | mb = mail.getMbox().latin1(); | 497 | mb = mail->getMbox().latin1(); |
498 | 498 | ||
@@ -502,3 +502,3 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail) | |||
502 | } | 502 | } |
503 | err = selectMbox(mail.getMbox()); | 503 | err = selectMbox(mail->getMbox()); |
504 | if ( err != MAILIMAP_NO_ERROR ) { | 504 | if ( err != MAILIMAP_NO_ERROR ) { |
@@ -508,3 +508,3 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail) | |||
508 | /* the range has to start at 1!!! not with 0!!!! */ | 508 | /* the range has to start at 1!!! not with 0!!!! */ |
509 | set = mailimap_set_new_interval( mail.getNumber(),mail.getNumber() ); | 509 | set = mailimap_set_new_interval( mail->getNumber(),mail->getNumber() ); |
510 | fetchAtt = mailimap_fetch_att_new_bodystructure(); | 510 | fetchAtt = mailimap_fetch_att_new_bodystructure(); |
@@ -570,3 +570,3 @@ QStringList IMAPwrapper::address_list_to_stringlist(clist*list) | |||
570 | 570 | ||
571 | encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>&path,bool internal_call) | 571 | encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call) |
572 | { | 572 | { |
@@ -587,3 +587,3 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int> | |||
587 | if (!internal_call) { | 587 | if (!internal_call) { |
588 | err = selectMbox(mail.getMbox()); | 588 | err = selectMbox(mail->getMbox()); |
589 | if ( err != MAILIMAP_NO_ERROR ) { | 589 | if ( err != MAILIMAP_NO_ERROR ) { |
@@ -592,3 +592,3 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int> | |||
592 | } | 592 | } |
593 | set = mailimap_set_new_single(mail.getNumber()); | 593 | set = mailimap_set_new_single(mail->getNumber()); |
594 | 594 | ||
@@ -643,3 +643,3 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int> | |||
643 | current_count means the position inside the internal loop! */ | 643 | current_count means the position inside the internal loop! */ |
644 | void IMAPwrapper::traverseBody(const RecMail&mail,mailimap_body*body,RecBody&target_body, | 644 | void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&target_body, |
645 | int current_recursion,QValueList<int>recList,int current_count) | 645 | int current_recursion,QValueList<int>recList,int current_count) |
@@ -871,3 +871,3 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which) | |||
871 | 871 | ||
872 | void IMAPwrapper::deleteMail(const RecMail&mail) | 872 | void IMAPwrapper::deleteMail(const RecMailP&mail) |
873 | { | 873 | { |
@@ -881,3 +881,3 @@ void IMAPwrapper::deleteMail(const RecMail&mail) | |||
881 | } | 881 | } |
882 | err = selectMbox(mail.getMbox()); | 882 | err = selectMbox(mail->getMbox()); |
883 | if ( err != MAILIMAP_NO_ERROR ) { | 883 | if ( err != MAILIMAP_NO_ERROR ) { |
@@ -888,3 +888,3 @@ void IMAPwrapper::deleteMail(const RecMail&mail) | |||
888 | store_flags = mailimap_store_att_flags_new_set_flags(flist); | 888 | store_flags = mailimap_store_att_flags_new_set_flags(flist); |
889 | set = mailimap_set_new_single(mail.getNumber()); | 889 | set = mailimap_set_new_single(mail->getNumber()); |
890 | err = mailimap_store(m_imap,set,store_flags); | 890 | err = mailimap_store(m_imap,set,store_flags); |
@@ -906,3 +906,3 @@ void IMAPwrapper::deleteMail(const RecMail&mail) | |||
906 | 906 | ||
907 | void IMAPwrapper::answeredMail(const RecMail&mail) | 907 | void IMAPwrapper::answeredMail(const RecMailP&mail) |
908 | { | 908 | { |
@@ -916,3 +916,3 @@ void IMAPwrapper::answeredMail(const RecMail&mail) | |||
916 | } | 916 | } |
917 | err = selectMbox(mail.getMbox()); | 917 | err = selectMbox(mail->getMbox()); |
918 | if ( err != MAILIMAP_NO_ERROR ) { | 918 | if ( err != MAILIMAP_NO_ERROR ) { |
@@ -923,3 +923,3 @@ void IMAPwrapper::answeredMail(const RecMail&mail) | |||
923 | store_flags = mailimap_store_att_flags_new_add_flags(flist); | 923 | store_flags = mailimap_store_att_flags_new_add_flags(flist); |
924 | set = mailimap_set_new_single(mail.getNumber()); | 924 | set = mailimap_set_new_single(mail->getNumber()); |
925 | err = mailimap_store(m_imap,set,store_flags); | 925 | err = mailimap_store(m_imap,set,store_flags); |
@@ -934,3 +934,3 @@ void IMAPwrapper::answeredMail(const RecMail&mail) | |||
934 | 934 | ||
935 | QString IMAPwrapper::fetchTextPart(const RecMail&mail,const QValueList<int>&path,bool internal_call,const QString&enc) | 935 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) |
936 | { | 936 | { |
@@ -949,3 +949,3 @@ QString IMAPwrapper::fetchTextPart(const RecMail&mail,const QValueList<int>&path | |||
949 | 949 | ||
950 | QString IMAPwrapper::fetchTextPart(const RecMail&mail,const RecPart&part) | 950 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const RecPart&part) |
951 | { | 951 | { |
@@ -954,3 +954,3 @@ QString IMAPwrapper::fetchTextPart(const RecMail&mail,const RecPart&part) | |||
954 | 954 | ||
955 | encodedString* IMAPwrapper::fetchDecodedPart(const RecMail&mail,const RecPart&part) | 955 | encodedString* IMAPwrapper::fetchDecodedPart(const RecMailP&mail,const RecPart&part) |
956 | { | 956 | { |
@@ -962,3 +962,3 @@ encodedString* IMAPwrapper::fetchDecodedPart(const RecMail&mail,const RecPart&pa | |||
962 | 962 | ||
963 | encodedString* IMAPwrapper::fetchRawPart(const RecMail&mail,const RecPart&part) | 963 | encodedString* IMAPwrapper::fetchRawPart(const RecMailP&mail,const RecPart&part) |
964 | { | 964 | { |
@@ -1057,3 +1057,2 @@ void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | |||
1057 | int r = 0; | 1057 | int r = 0; |
1058 | int res = 0; | ||
1059 | target_stat.message_count = 0; | 1058 | target_stat.message_count = 0; |
@@ -1117,3 +1116,3 @@ const QString&IMAPwrapper::getName()const | |||
1117 | 1116 | ||
1118 | encodedString* IMAPwrapper::fetchRawBody(const RecMail&mail) | 1117 | encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) |
1119 | { | 1118 | { |
@@ -1156,3 +1155,3 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, | |||
1156 | 1155 | ||
1157 | void IMAPwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 1156 | void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) |
1158 | { | 1157 | { |
@@ -1168,3 +1167,3 @@ void IMAPwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,Abstrac | |||
1168 | } | 1167 | } |
1169 | int err = selectMbox(mail.getMbox()); | 1168 | int err = selectMbox(mail->getMbox()); |
1170 | if ( err != MAILIMAP_NO_ERROR ) { | 1169 | if ( err != MAILIMAP_NO_ERROR ) { |
@@ -1172,3 +1171,3 @@ void IMAPwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,Abstrac | |||
1172 | } | 1171 | } |
1173 | set = mailimap_set_new_single(mail.getNumber()); | 1172 | set = mailimap_set_new_single(mail->getNumber()); |
1174 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); | 1173 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h index 15f049f..3bd5967 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.h +++ b/noncore/net/mail/libmailwrapper/imapwrapper.h | |||
@@ -25,23 +25,23 @@ public: | |||
25 | virtual ~IMAPwrapper(); | 25 | virtual ~IMAPwrapper(); |
26 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); | 26 | virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders(); |
27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); | 27 | virtual void listMessages(const QString & mailbox,QValueList<Opie::OSmartPointer<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 RecMailP&mail); |
31 | virtual void answeredMail(const RecMail&mail); | 31 | virtual void answeredMail(const RecMailP&mail); |
32 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&folder); | 32 | virtual int deleteAllMail(const Opie::OSmartPointer<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(const Opie::osmart_pointer<Folder>&fromFolder, | 34 | virtual void mvcpAllMails(const Opie::OSmartPointer<Folder>&fromFolder, |
35 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 35 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
36 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 36 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
37 | 37 | ||
38 | virtual RecBody fetchBody(const RecMail&mail); | 38 | virtual RecBody fetchBody(const RecMailP&mail); |
39 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part); | 39 | virtual QString fetchTextPart(const RecMailP&mail,const RecPart&part); |
40 | virtual encodedString* fetchDecodedPart(const RecMail&mail,const RecPart&part); | 40 | virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPart&part); |
41 | virtual encodedString* fetchRawPart(const RecMail&mail,const RecPart&part); | 41 | virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPart&part); |
42 | virtual encodedString* fetchRawBody(const RecMail&mail); | 42 | virtual encodedString* fetchRawBody(const RecMailP&mail); |
43 | 43 | ||
44 | virtual int createMbox(const QString&,const Opie::osmart_pointer<Folder>&parentfolder=0, | 44 | virtual int createMbox(const QString&,const Opie::OSmartPointer<Folder>&parentfolder=0, |
45 | const QString& delemiter="/",bool getsubfolder=false); | 45 | const QString& delemiter="/",bool getsubfolder=false); |
46 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&folder); | 46 | virtual int deleteMbox(const Opie::OSmartPointer<Folder>&folder); |
47 | 47 | ||
@@ -58,4 +58,4 @@ protected: | |||
58 | 58 | ||
59 | virtual QString fetchTextPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); | 59 | virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); |
60 | virtual encodedString*fetchRawPart(const RecMail&mail,const QValueList<int>&path,bool internal_call); | 60 | virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call); |
61 | int selectMbox(const QString&mbox); | 61 | int selectMbox(const QString&mbox); |
@@ -67,3 +67,3 @@ protected: | |||
67 | void fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which); | 67 | void fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which); |
68 | 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 RecMailP&mail,mailimap_body*body,RecBody&target_body,int current_recursion,QValueList<int>recList,int current_count=1); |
69 | 69 | ||
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp index 49b3caa..7dd7e58 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.cpp +++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp | |||
@@ -4,3 +4,3 @@ | |||
4 | RecMail::RecMail() | 4 | RecMail::RecMail() |
5 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) | 5 | :Opie::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) |
6 | { | 6 | { |
@@ -10,3 +10,3 @@ RecMail::RecMail() | |||
10 | RecMail::RecMail(const RecMail&old) | 10 | RecMail::RecMail(const RecMail&old) |
11 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) | 11 | :Opie::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) |
12 | { | 12 | { |
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h index 10d367f..dc10de6 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.h +++ b/noncore/net/mail/libmailwrapper/mailtypes.h | |||
@@ -10,2 +10,4 @@ | |||
10 | 10 | ||
11 | #include <opie2/osmartpointer.h> | ||
12 | |||
11 | #include <qbitarray.h> | 13 | #include <qbitarray.h> |
@@ -29,3 +31,3 @@ class AbstractMail; | |||
29 | */ | 31 | */ |
30 | class RecMail | 32 | class RecMail:public Opie::ORefCount |
31 | { | 33 | { |
@@ -36,4 +38,4 @@ public: | |||
36 | 38 | ||
37 | const int getNumber()const{return msg_number;} | 39 | const unsigned int getNumber()const{return msg_number;} |
38 | void setNumber(int number){msg_number=number;} | 40 | void setNumber(unsigned int number){msg_number=number;} |
39 | const QString&getDate()const{ return date; } | 41 | const QString&getDate()const{ return date; } |
@@ -50,4 +52,4 @@ public: | |||
50 | const QString&Replyto()const{return replyto;} | 52 | const QString&Replyto()const{return replyto;} |
51 | void setMsgsize(int size){msg_size = size;} | 53 | void setMsgsize(unsigned int size){msg_size = size;} |
52 | const int Msgsize()const{return msg_size;} | 54 | const unsigned int Msgsize()const{return msg_size;} |
53 | 55 | ||
@@ -73,3 +75,3 @@ protected: | |||
73 | QString subject,date,from,mbox,msg_id,replyto; | 75 | QString subject,date,from,mbox,msg_id,replyto; |
74 | int msg_number,msg_size; | 76 | unsigned int msg_number,msg_size; |
75 | QBitArray msg_flags; | 77 | QBitArray msg_flags; |
@@ -81,2 +83,3 @@ protected: | |||
81 | 83 | ||
84 | typedef Opie::OSmartPointer<RecMail> RecMailP; | ||
82 | typedef QMap<QString,QString> part_plist_t; | 85 | typedef QMap<QString,QString> part_plist_t; |
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp index c71d69f..9bf2fd3 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp | |||
@@ -157,3 +157,3 @@ QString IMAPFolder::decodeFolderName( const QString &name ) | |||
157 | Mail::Mail() | 157 | Mail::Mail() |
158 | :Opie::oref_count(),name(""), mail(""), to(""), cc(""), bcc(""), reply(""), subject(""), message("") | 158 | :Opie::ORefCount(),name(""), mail(""), to(""), cc(""), bcc(""), reply(""), subject(""), message("") |
159 | { | 159 | { |
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.h b/noncore/net/mail/libmailwrapper/mailwrapper.h index 3b3bb32..6bf0078 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.h +++ b/noncore/net/mail/libmailwrapper/mailwrapper.h | |||
@@ -10,3 +10,3 @@ | |||
10 | 10 | ||
11 | #include <opie2/osmart_pointer.h> | 11 | #include <opie2/osmartpointer.h> |
12 | 12 | ||
@@ -30,3 +30,3 @@ protected: | |||
30 | 30 | ||
31 | class Mail:public Opie::oref_count | 31 | class Mail:public Opie::ORefCount |
32 | { | 32 | { |
@@ -68,3 +68,3 @@ private: | |||
68 | 68 | ||
69 | class Folder:public Opie::oref_count | 69 | class Folder:public Opie::ORefCount |
70 | { | 70 | { |
@@ -84,3 +84,3 @@ protected: | |||
84 | 84 | ||
85 | typedef Opie::osmart_pointer<Folder> FolderP; | 85 | typedef Opie::OSmartPointer<Folder> FolderP; |
86 | 86 | ||
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index 9ff3de2..5e6b714 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |||
@@ -21,3 +21,3 @@ MBOXwrapper::~MBOXwrapper() | |||
21 | 21 | ||
22 | void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | 22 | void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target ) |
23 | { | 23 | { |
@@ -46,5 +46,5 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
46 | 46 | ||
47 | QValueList<Opie::osmart_pointer<Folder> >* MBOXwrapper::listFolders() | 47 | QValueList<Opie::OSmartPointer<Folder> >* MBOXwrapper::listFolders() |
48 | { | 48 | { |
49 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); | 49 | QValueList<Opie::OSmartPointer<Folder> >* folders = new QValueList<Opie::OSmartPointer<Folder> >(); |
50 | QDir dir(MBOXPath); | 50 | QDir dir(MBOXPath); |
@@ -61,3 +61,3 @@ QValueList<Opie::osmart_pointer<Folder> >* MBOXwrapper::listFolders() | |||
61 | 61 | ||
62 | void MBOXwrapper::deleteMail(const RecMail&mail) | 62 | void MBOXwrapper::deleteMail(const RecMailP & mail) |
63 | { | 63 | { |
@@ -65,3 +65,3 @@ void MBOXwrapper::deleteMail(const RecMail&mail) | |||
65 | QString p = MBOXPath+"/"; | 65 | QString p = MBOXPath+"/"; |
66 | p+=mail.getMbox(); | 66 | p+=mail->getMbox(); |
67 | 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); |
@@ -76,3 +76,3 @@ void MBOXwrapper::deleteMail(const RecMail&mail) | |||
76 | } | 76 | } |
77 | r = mailsession_remove_message(folder->fld_session,mail.getNumber()); | 77 | r = mailsession_remove_message(folder->fld_session,mail->getNumber()); |
78 | if (r != MAIL_NO_ERROR) { | 78 | if (r != MAIL_NO_ERROR) { |
@@ -84,3 +84,3 @@ void MBOXwrapper::deleteMail(const RecMail&mail) | |||
84 | 84 | ||
85 | void MBOXwrapper::answeredMail(const RecMail&) | 85 | void MBOXwrapper::answeredMail(const RecMailP&) |
86 | { | 86 | { |
@@ -88,3 +88,3 @@ void MBOXwrapper::answeredMail(const RecMail&) | |||
88 | 88 | ||
89 | RecBody MBOXwrapper::fetchBody( const RecMail &mail ) | 89 | RecBody MBOXwrapper::fetchBody( const RecMailP &mail ) |
90 | { | 90 | { |
@@ -93,3 +93,3 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) | |||
93 | QString p = MBOXPath+"/"; | 93 | QString p = MBOXPath+"/"; |
94 | p+=mail.getMbox(); | 94 | p+=mail->getMbox(); |
95 | mailmessage * msg; | 95 | mailmessage * msg; |
@@ -108,5 +108,5 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) | |||
108 | } | 108 | } |
109 | r = mailsession_get_message(folder->fld_session, mail.getNumber(), &msg); | 109 | r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg); |
110 | if (r != MAIL_NO_ERROR) { | 110 | if (r != MAIL_NO_ERROR) { |
111 | qDebug("Error fetching mail %i",mail.getNumber()); | 111 | qDebug("Error fetching mail %i",mail->getNumber()); |
112 | mailfolder_free(folder); | 112 | mailfolder_free(folder); |
@@ -117,3 +117,3 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) | |||
117 | if (r != MAIL_NO_ERROR) { | 117 | if (r != MAIL_NO_ERROR) { |
118 | qDebug("Error fetching mail %i",mail.getNumber()); | 118 | qDebug("Error fetching mail %i",mail->getNumber()); |
119 | mailfolder_free(folder); | 119 | mailfolder_free(folder); |
@@ -171,3 +171,3 @@ void MBOXwrapper::storeMessage(const char*msg,size_t length, const QString&folde | |||
171 | 171 | ||
172 | encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) | 172 | encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail) |
173 | { | 173 | { |
@@ -176,3 +176,3 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) | |||
176 | QString p = MBOXPath+"/"; | 176 | QString p = MBOXPath+"/"; |
177 | p+=mail.getMbox(); | 177 | p+=mail->getMbox(); |
178 | mailmessage * msg; | 178 | mailmessage * msg; |
@@ -191,5 +191,5 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) | |||
191 | } | 191 | } |
192 | r = mailsession_get_message(folder->fld_session, mail.getNumber(), &msg); | 192 | r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg); |
193 | if (r != MAIL_NO_ERROR) { | 193 | if (r != MAIL_NO_ERROR) { |
194 | Global::statusMessage(tr("Error fetching mail %i").arg(mail.getNumber())); | 194 | Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); |
195 | mailfolder_free(folder); | 195 | mailfolder_free(folder); |
@@ -200,3 +200,3 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) | |||
200 | if (r != MAIL_NO_ERROR) { | 200 | if (r != MAIL_NO_ERROR) { |
201 | Global::statusMessage(tr("Error fetching mail %i").arg(mail.getNumber())); | 201 | Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); |
202 | mailfolder_free(folder); | 202 | mailfolder_free(folder); |
@@ -214,3 +214,3 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) | |||
214 | 214 | ||
215 | void MBOXwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) | 215 | void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) |
216 | { | 216 | { |
@@ -228,3 +228,3 @@ void MBOXwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) | |||
228 | 228 | ||
229 | void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target) | 229 | void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target) |
230 | { | 230 | { |
@@ -232,4 +232,5 @@ void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target) | |||
232 | int r; | 232 | int r; |
233 | for (unsigned int i=0; i < target.count();++i) { | 233 | QValueList<RecMailP>::ConstIterator it; |
234 | r = mailmbox_delete_msg(f,target.at(i)->getNumber()); | 234 | for (it=target.begin(); it != target.end();++it) { |
235 | r = mailmbox_delete_msg(f,(*it)->getNumber()); | ||
235 | if (r!=MAILMBOX_NO_ERROR) { | 236 | if (r!=MAILMBOX_NO_ERROR) { |
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.h b/noncore/net/mail/libmailwrapper/mboxwrapper.h index c3d9b50..33eeb1e 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.h +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.h | |||
@@ -6,4 +6,2 @@ | |||
6 | 6 | ||
7 | class RecMail; | ||
8 | class RecBody; | ||
9 | class encodedString; | 7 | class encodedString; |
@@ -19,12 +17,12 @@ public: | |||
19 | 17 | ||
20 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 18 | virtual void listMessages(const QString & mailbox, QValueList<RecMailP>&target ); |
21 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); | 19 | virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders(); |
22 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 20 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
23 | 21 | ||
24 | virtual void deleteMail(const RecMail&mail); | 22 | virtual void deleteMail(const RecMailP&mail); |
25 | virtual void answeredMail(const RecMail&mail); | 23 | virtual void answeredMail(const RecMailP&mail); |
26 | 24 | ||
27 | virtual int createMbox(const QString&folder,const Opie::osmart_pointer<Folder>&f=0, | 25 | virtual int createMbox(const QString&folder,const Opie::OSmartPointer<Folder>&f=0, |
28 | const QString&d="",bool s=false); | 26 | const QString&d="",bool s=false); |
29 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&); | 27 | virtual int deleteMbox(const Opie::OSmartPointer<Folder>&); |
30 | 28 | ||
@@ -32,8 +30,8 @@ public: | |||
32 | 30 | ||
33 | virtual RecBody fetchBody( const RecMail &mail ); | 31 | virtual RecBody fetchBody( const RecMailP &mail ); |
34 | static void mbox_progress( size_t current, size_t maximum ); | 32 | static void mbox_progress( size_t current, size_t maximum ); |
35 | 33 | ||
36 | virtual encodedString* fetchRawBody(const RecMail&mail); | 34 | virtual encodedString* fetchRawBody(const RecMailP&mail); |
37 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); | 35 | virtual void deleteMails(const QString & FolderName,const QValueList<RecMailP> &target); |
38 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); | 36 | virtual int deleteAllMail(const Opie::OSmartPointer<Folder>&); |
39 | virtual MAILLIB::ATYPE getType()const; | 37 | virtual MAILLIB::ATYPE getType()const; |
@@ -42,3 +40,3 @@ public: | |||
42 | protected: | 40 | protected: |
43 | static void deleteMails(mailmbox_folder*f,QList<RecMail> &target); | 41 | static void deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target); |
44 | QString MBOXPath; | 42 | QString MBOXPath; |
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp index aaaa20a..0b00a2e 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp | |||
@@ -62,3 +62,3 @@ MHwrapper::~MHwrapper() | |||
62 | 62 | ||
63 | void MHwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | 63 | void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::OSmartPointer<RecMail> > &target ) |
64 | { | 64 | { |
@@ -78,5 +78,5 @@ void MHwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
78 | 78 | ||
79 | QValueList<Opie::osmart_pointer<Folder> >* MHwrapper::listFolders() | 79 | QValueList<Opie::OSmartPointer<Folder> >* MHwrapper::listFolders() |
80 | { | 80 | { |
81 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); | 81 | QValueList<Opie::OSmartPointer<Folder> >* folders = new QValueList<Opie::OSmartPointer<Folder> >(); |
82 | /* this is needed! */ | 82 | /* this is needed! */ |
@@ -103,3 +103,3 @@ QValueList<Opie::osmart_pointer<Folder> >* MHwrapper::listFolders() | |||
103 | 103 | ||
104 | void MHwrapper::deleteMail(const RecMail&mail) | 104 | void MHwrapper::deleteMail(const RecMailP&mail) |
105 | { | 105 | { |
@@ -109,3 +109,3 @@ void MHwrapper::deleteMail(const RecMail&mail) | |||
109 | } | 109 | } |
110 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); | 110 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); |
111 | if (r!=MAIL_NO_ERROR) { | 111 | if (r!=MAIL_NO_ERROR) { |
@@ -114,3 +114,3 @@ void MHwrapper::deleteMail(const RecMail&mail) | |||
114 | } | 114 | } |
115 | r = mailsession_remove_message(m_storage->sto_session,mail.getNumber()); | 115 | r = mailsession_remove_message(m_storage->sto_session,mail->getNumber()); |
116 | if (r != MAIL_NO_ERROR) { | 116 | if (r != MAIL_NO_ERROR) { |
@@ -120,3 +120,3 @@ void MHwrapper::deleteMail(const RecMail&mail) | |||
120 | 120 | ||
121 | void MHwrapper::answeredMail(const RecMail&) | 121 | void MHwrapper::answeredMail(const RecMailP&) |
122 | { | 122 | { |
@@ -124,3 +124,3 @@ void MHwrapper::answeredMail(const RecMail&) | |||
124 | 124 | ||
125 | RecBody MHwrapper::fetchBody( const RecMail &mail ) | 125 | RecBody MHwrapper::fetchBody( const RecMailP &mail ) |
126 | { | 126 | { |
@@ -133,6 +133,5 @@ RecBody MHwrapper::fetchBody( const RecMail &mail ) | |||
133 | char*data=0; | 133 | char*data=0; |
134 | size_t size; | ||
135 | 134 | ||
136 | /* mail should hold the complete path! */ | 135 | /* mail should hold the complete path! */ |
137 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); | 136 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); |
138 | if (r != MAIL_NO_ERROR) { | 137 | if (r != MAIL_NO_ERROR) { |
@@ -140,5 +139,5 @@ RecBody MHwrapper::fetchBody( const RecMail &mail ) | |||
140 | } | 139 | } |
141 | r = mailsession_get_message(m_storage->sto_session, mail.getNumber(), &msg); | 140 | r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); |
142 | if (r != MAIL_NO_ERROR) { | 141 | if (r != MAIL_NO_ERROR) { |
143 | qDebug("Error fetching mail %i",mail.getNumber()); | 142 | qDebug("Error fetching mail %i",mail->getNumber()); |
144 | return body; | 143 | return body; |
@@ -214,3 +213,3 @@ void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder) | |||
214 | 213 | ||
215 | encodedString* MHwrapper::fetchRawBody(const RecMail&mail) | 214 | encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) |
216 | { | 215 | { |
@@ -224,3 +223,3 @@ encodedString* MHwrapper::fetchRawBody(const RecMail&mail) | |||
224 | size_t size; | 223 | size_t size; |
225 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); | 224 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); |
226 | if (r!=MAIL_NO_ERROR) { | 225 | if (r!=MAIL_NO_ERROR) { |
@@ -229,5 +228,5 @@ encodedString* MHwrapper::fetchRawBody(const RecMail&mail) | |||
229 | } | 228 | } |
230 | r = mailsession_get_message(m_storage->sto_session, mail.getNumber(), &msg); | 229 | r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); |
231 | if (r != MAIL_NO_ERROR) { | 230 | if (r != MAIL_NO_ERROR) { |
232 | Global::statusMessage(tr("Error fetching mail %i").arg(mail.getNumber())); | 231 | Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); |
233 | return 0; | 232 | return 0; |
@@ -236,3 +235,3 @@ encodedString* MHwrapper::fetchRawBody(const RecMail&mail) | |||
236 | if (r != MAIL_NO_ERROR) { | 235 | if (r != MAIL_NO_ERROR) { |
237 | Global::statusMessage(tr("Error fetching mail %i").arg(mail.getNumber())); | 236 | Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); |
238 | if (msg) mailmessage_free(msg); | 237 | if (msg) mailmessage_free(msg); |
@@ -245,3 +244,3 @@ encodedString* MHwrapper::fetchRawBody(const RecMail&mail) | |||
245 | 244 | ||
246 | void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) | 245 | void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) |
247 | { | 246 | { |
@@ -253,6 +252,5 @@ void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) | |||
253 | } | 252 | } |
254 | RecMail*c = 0; | 253 | QValueList<RecMailP>::ConstIterator it; |
255 | for (unsigned int i=0; i < target.count();++i) { | 254 | for (it=target.begin(); it!=target.end();++it) { |
256 | c = target.at(i); | 255 | r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); |
257 | r = mailsession_remove_message(m_storage->sto_session,c->getNumber()); | ||
258 | if (r != MAIL_NO_ERROR) { | 256 | if (r != MAIL_NO_ERROR) { |
@@ -374,3 +372,3 @@ const QString&MHwrapper::getName()const | |||
374 | } | 372 | } |
375 | void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 373 | void MHwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) |
376 | { | 374 | { |
@@ -387,3 +385,3 @@ void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractM | |||
387 | QString tf = buildPath(targetFolder); | 385 | QString tf = buildPath(targetFolder); |
388 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); | 386 | int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); |
389 | if (r != MAIL_NO_ERROR) { | 387 | if (r != MAIL_NO_ERROR) { |
@@ -393,5 +391,5 @@ void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractM | |||
393 | if (moveit) { | 391 | if (moveit) { |
394 | r = mailsession_move_message(m_storage->sto_session,mail.getNumber(),(char*)tf.latin1()); | 392 | r = mailsession_move_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1()); |
395 | } else { | 393 | } else { |
396 | r = mailsession_copy_message(m_storage->sto_session,mail.getNumber(),(char*)tf.latin1()); | 394 | r = mailsession_copy_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1()); |
397 | } | 395 | } |
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.h b/noncore/net/mail/libmailwrapper/mhwrapper.h index c7c8183..208cf2f 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.h +++ b/noncore/net/mail/libmailwrapper/mhwrapper.h | |||
@@ -8,4 +8,2 @@ | |||
8 | 8 | ||
9 | class RecMail; | ||
10 | class RecBody; | ||
11 | class encodedString; | 9 | class encodedString; |
@@ -21,15 +19,15 @@ public: | |||
21 | 19 | ||
22 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 20 | virtual void listMessages(const QString & mailbox, QValueList<Opie::OSmartPointer<RecMail> > &target ); |
23 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); | 21 | virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders(); |
24 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 22 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
25 | 23 | ||
26 | virtual void deleteMail(const RecMail&mail); | 24 | virtual void deleteMail(const RecMailP&mail); |
27 | virtual void answeredMail(const RecMail&mail); | 25 | virtual void answeredMail(const RecMailP&mail); |
28 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 26 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
29 | virtual void mvcpAllMails(const Opie::osmart_pointer<Folder>&fromFolder, | 27 | virtual void mvcpAllMails(const Opie::OSmartPointer<Folder>&fromFolder, |
30 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 28 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
31 | 29 | ||
32 | virtual int createMbox(const QString&folder,const Opie::osmart_pointer<Folder>&f=0, | 30 | virtual int createMbox(const QString&folder,const Opie::OSmartPointer<Folder>&f=0, |
33 | const QString&d="",bool s=false); | 31 | const QString&d="",bool s=false); |
34 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&); | 32 | virtual int deleteMbox(const Opie::OSmartPointer<Folder>&); |
35 | 33 | ||
@@ -37,8 +35,8 @@ public: | |||
37 | 35 | ||
38 | virtual RecBody fetchBody( const RecMail &mail ); | 36 | virtual RecBody fetchBody( const RecMailP &mail ); |
39 | static void mbox_progress( size_t current, size_t maximum ); | 37 | static void mbox_progress( size_t current, size_t maximum ); |
40 | 38 | ||
41 | virtual encodedString* fetchRawBody(const RecMail&mail); | 39 | virtual encodedString* fetchRawBody(const RecMailP&mail); |
42 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); | 40 | virtual void deleteMails(const QString & FolderName,const QValueList<Opie::OSmartPointer<RecMail> > &target); |
43 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); | 41 | virtual int deleteAllMail(const Opie::OSmartPointer<Folder>&); |
44 | virtual MAILLIB::ATYPE getType()const; | 42 | virtual MAILLIB::ATYPE getType()const; |
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp index 2ec052c..c0b3eec 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp | |||
@@ -34,3 +34,3 @@ void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) { | |||
34 | 34 | ||
35 | RecBody NNTPwrapper::fetchBody( const RecMail &mail ) { | 35 | RecBody NNTPwrapper::fetchBody( const RecMailP &mail ) { |
36 | int err = NEWSNNTP_NO_ERROR; | 36 | int err = NEWSNNTP_NO_ERROR; |
@@ -46,4 +46,4 @@ RecBody NNTPwrapper::fetchBody( const RecMail &mail ) { | |||
46 | mailmessage * mailmsg; | 46 | mailmessage * mailmsg; |
47 | if (mail.Msgsize()>HARD_MSG_SIZE_LIMIT) { | 47 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { |
48 | qDebug("Message to large: %i",mail.Msgsize()); | 48 | qDebug("Message to large: %i",mail->Msgsize()); |
49 | return body; | 49 | return body; |
@@ -55,3 +55,3 @@ RecBody NNTPwrapper::fetchBody( const RecMail &mail ) { | |||
55 | 55 | ||
56 | if (mail.getNumber()!=last_msg_id) { | 56 | if (mail->getNumber()!=last_msg_id) { |
57 | if (msg_cache.exists()) { | 57 | if (msg_cache.exists()) { |
@@ -60,4 +60,4 @@ RecBody NNTPwrapper::fetchBody( const RecMail &mail ) { | |||
60 | msg_cache.open(IO_ReadWrite|IO_Truncate); | 60 | msg_cache.open(IO_ReadWrite|IO_Truncate); |
61 | last_msg_id = mail.getNumber(); | 61 | last_msg_id = mail->getNumber(); |
62 | err = mailsession_get_message(m_nntp->sto_session, mail.getNumber(), &mailmsg); | 62 | err = mailsession_get_message(m_nntp->sto_session, mail->getNumber(), &mailmsg); |
63 | err = mailmessage_fetch(mailmsg,&message,&length); | 63 | err = mailmessage_fetch(mailmsg,&message,&length); |
@@ -98,3 +98,3 @@ RecBody NNTPwrapper::fetchBody( const RecMail &mail ) { | |||
98 | 98 | ||
99 | void NNTPwrapper::listMessages(const QString & which, QList<RecMail> &target ) | 99 | void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::OSmartPointer<RecMail> > &target ) |
100 | { | 100 | { |
@@ -190,5 +190,5 @@ void NNTPwrapper::logout() | |||
190 | 190 | ||
191 | QValueList<Opie::osmart_pointer<Folder> >* NNTPwrapper::listFolders() { | 191 | QValueList<Opie::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { |
192 | 192 | ||
193 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); | 193 | QValueList<Opie::OSmartPointer<Folder> >* folders = new QValueList<Opie::OSmartPointer<Folder> >(); |
194 | QStringList groups; | 194 | QStringList groups; |
@@ -241,3 +241,3 @@ QStringList NNTPwrapper::listAllNewsgroups(const QString&mask) { | |||
241 | 241 | ||
242 | void NNTPwrapper::answeredMail(const RecMail&) {} | 242 | void NNTPwrapper::answeredMail(const RecMailP&) {} |
243 | 243 | ||
@@ -255,3 +255,3 @@ void NNTPwrapper::statusFolder(folderStat&target_stat,const QString&) { | |||
255 | 255 | ||
256 | encodedString* NNTPwrapper::fetchRawBody(const RecMail&mail) { | 256 | encodedString* NNTPwrapper::fetchRawBody(const RecMailP&mail) { |
257 | char*target=0; | 257 | char*target=0; |
@@ -260,3 +260,3 @@ encodedString* NNTPwrapper::fetchRawBody(const RecMail&mail) { | |||
260 | mailmessage * mailmsg = 0; | 260 | mailmessage * mailmsg = 0; |
261 | int err = mailsession_get_message(m_nntp->sto_session, mail.getNumber(), &mailmsg); | 261 | int err = mailsession_get_message(m_nntp->sto_session, mail->getNumber(), &mailmsg); |
262 | err = mailmessage_fetch(mailmsg,&target,&length); | 262 | err = mailmessage_fetch(mailmsg,&target,&length); |
@@ -278,3 +278,3 @@ const QString&NNTPwrapper::getName()const{ | |||
278 | 278 | ||
279 | void NNTPwrapper::deleteMail(const RecMail&) { | 279 | void NNTPwrapper::deleteMail(const RecMailP&) { |
280 | } | 280 | } |
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.h b/noncore/net/mail/libmailwrapper/nntpwrapper.h index d3a384a..a7e4b95 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.h +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.h | |||
@@ -22,5 +22,5 @@ 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, QValueList<Opie::OSmartPointer<RecMail> > &target ); |
24 | /* should only get the subscribed one */ | 24 | /* should only get the subscribed one */ |
25 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); | 25 | virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders(); |
26 | /* mailbox will be ignored */ | 26 | /* mailbox will be ignored */ |
@@ -28,8 +28,8 @@ public: | |||
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 RecMailP&mail); |
30 | virtual void answeredMail(const RecMail&mail); | 30 | virtual void answeredMail(const RecMailP&mail); |
31 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); | 31 | virtual int deleteAllMail(const Opie::OSmartPointer<Folder>&); |
32 | 32 | ||
33 | virtual RecBody fetchBody( const RecMail &mail ); | 33 | virtual RecBody fetchBody( const RecMailP &mail ); |
34 | virtual encodedString* fetchRawBody(const RecMail&mail); | 34 | virtual encodedString* fetchRawBody(const RecMailP&mail); |
35 | virtual void logout(); | 35 | virtual void logout(); |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 7bf7ed2..6737d6c 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -32,3 +32,3 @@ void POP3wrapper::pop3_progress( size_t current, size_t maximum ) { | |||
32 | 32 | ||
33 | RecBody POP3wrapper::fetchBody( const RecMail &mail ) { | 33 | RecBody POP3wrapper::fetchBody( const RecMailP &mail ) { |
34 | int err = MAILPOP3_NO_ERROR; | 34 | int err = MAILPOP3_NO_ERROR; |
@@ -44,4 +44,4 @@ RecBody POP3wrapper::fetchBody( const RecMail &mail ) { | |||
44 | mailmessage * mailmsg; | 44 | mailmessage * mailmsg; |
45 | if (mail.Msgsize()>HARD_MSG_SIZE_LIMIT) { | 45 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { |
46 | qDebug("Message to large: %i",mail.Msgsize()); | 46 | qDebug("Message to large: %i",mail->Msgsize()); |
47 | return body; | 47 | return body; |
@@ -53,3 +53,3 @@ RecBody POP3wrapper::fetchBody( const RecMail &mail ) { | |||
53 | 53 | ||
54 | if (mail.getNumber()!=last_msg_id) { | 54 | if (mail->getNumber()!=last_msg_id) { |
55 | if (msg_cache.exists()) { | 55 | if (msg_cache.exists()) { |
@@ -58,4 +58,4 @@ RecBody POP3wrapper::fetchBody( const RecMail &mail ) { | |||
58 | msg_cache.open(IO_ReadWrite|IO_Truncate); | 58 | msg_cache.open(IO_ReadWrite|IO_Truncate); |
59 | last_msg_id = mail.getNumber(); | 59 | last_msg_id = mail->getNumber(); |
60 | err = mailsession_get_message(m_pop3->sto_session, mail.getNumber(), &mailmsg); | 60 | err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); |
61 | err = mailmessage_fetch(mailmsg,&message,&length); | 61 | err = mailmessage_fetch(mailmsg,&message,&length); |
@@ -95,3 +95,3 @@ RecBody POP3wrapper::fetchBody( const RecMail &mail ) { | |||
95 | 95 | ||
96 | void POP3wrapper::listMessages(const QString &, QList<RecMail> &target ) | 96 | void POP3wrapper::listMessages(const QString &, QValueList<Opie::OSmartPointer<RecMail> > &target ) |
97 | { | 97 | { |
@@ -171,3 +171,2 @@ void POP3wrapper::logout() | |||
171 | { | 171 | { |
172 | int err = MAILPOP3_NO_ERROR; | ||
173 | if ( m_pop3 == NULL ) | 172 | if ( m_pop3 == NULL ) |
@@ -179,4 +178,4 @@ void POP3wrapper::logout() | |||
179 | 178 | ||
180 | QValueList<Opie::osmart_pointer<Folder> >* POP3wrapper::listFolders() { | 179 | QValueList<Opie::OSmartPointer<Folder> >* POP3wrapper::listFolders() { |
181 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<FolderP>(); | 180 | QValueList<Opie::OSmartPointer<Folder> >* folders = new QValueList<FolderP>(); |
182 | FolderP inb=new Folder("INBOX","/"); | 181 | FolderP inb=new Folder("INBOX","/"); |
@@ -186,3 +185,3 @@ QValueList<Opie::osmart_pointer<Folder> >* POP3wrapper::listFolders() { | |||
186 | 185 | ||
187 | void POP3wrapper::deleteMail(const RecMail&mail) { | 186 | void POP3wrapper::deleteMail(const RecMailP&mail) { |
188 | login(); | 187 | login(); |
@@ -190,3 +189,3 @@ void POP3wrapper::deleteMail(const RecMail&mail) { | |||
190 | return; | 189 | return; |
191 | int err = mailsession_remove_message(m_pop3->sto_session,mail.getNumber()); | 190 | int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); |
192 | if (err != MAIL_NO_ERROR) { | 191 | if (err != MAIL_NO_ERROR) { |
@@ -196,3 +195,3 @@ void POP3wrapper::deleteMail(const RecMail&mail) { | |||
196 | 195 | ||
197 | void POP3wrapper::answeredMail(const RecMail&) {} | 196 | void POP3wrapper::answeredMail(const RecMailP&) {} |
198 | 197 | ||
@@ -230,5 +229,8 @@ void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) { | |||
230 | &target_stat.message_recent,&target_stat.message_unseen); | 229 | &target_stat.message_recent,&target_stat.message_unseen); |
230 | if (r != MAIL_NO_ERROR) { | ||
231 | qDebug("error getting folter status."); | ||
232 | } | ||
231 | } | 233 | } |
232 | 234 | ||
233 | encodedString* POP3wrapper::fetchRawBody(const RecMail&mail) { | 235 | encodedString* POP3wrapper::fetchRawBody(const RecMailP&mail) { |
234 | char*target=0; | 236 | char*target=0; |
@@ -237,3 +239,3 @@ encodedString* POP3wrapper::fetchRawBody(const RecMail&mail) { | |||
237 | mailmessage * mailmsg = 0; | 239 | mailmessage * mailmsg = 0; |
238 | int err = mailsession_get_message(m_pop3->sto_session, mail.getNumber(), &mailmsg); | 240 | int err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); |
239 | err = mailmessage_fetch(mailmsg,&target,&length); | 241 | err = mailmessage_fetch(mailmsg,&target,&length); |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h index e4afb94..31eb6f1 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.h +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h | |||
@@ -19,4 +19,4 @@ public: | |||
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, QValueList<Opie::OSmartPointer<RecMail> > &target ); |
21 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); | 21 | virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders(); |
22 | /* mailbox will be ignored */ | 22 | /* mailbox will be ignored */ |
@@ -24,8 +24,8 @@ public: | |||
24 | 24 | ||
25 | virtual void deleteMail(const RecMail&mail); | 25 | virtual void deleteMail(const RecMailP&mail); |
26 | virtual void answeredMail(const RecMail&mail); | 26 | virtual void answeredMail(const RecMailP&mail); |
27 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); | 27 | virtual int deleteAllMail(const Opie::OSmartPointer<Folder>&); |
28 | 28 | ||
29 | virtual RecBody fetchBody( const RecMail &mail ); | 29 | virtual RecBody fetchBody( const RecMailP &mail ); |
30 | virtual encodedString* fetchRawBody(const RecMail&mail); | 30 | virtual encodedString* fetchRawBody(const RecMailP&mail); |
31 | virtual void logout(); | 31 | virtual void logout(); |
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index afc5618..86673aa 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp | |||
@@ -314,3 +314,3 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size ) | |||
314 | 314 | ||
315 | void SMTPwrapper::sendMail(const Opie::osmart_pointer<Mail>&mail,bool later ) | 315 | void SMTPwrapper::sendMail(const Opie::OSmartPointer<Mail>&mail,bool later ) |
316 | { | 316 | { |
@@ -334,3 +334,3 @@ void SMTPwrapper::sendMail(const Opie::osmart_pointer<Mail>&mail,bool later ) | |||
334 | 334 | ||
335 | int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,RecMail*which) { | 335 | int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,const RecMailP&which) { |
336 | size_t curTok = 0; | 336 | size_t curTok = 0; |
@@ -342,3 +342,3 @@ int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,RecMail*which) { | |||
342 | 342 | ||
343 | encodedString * data = wrap->fetchRawBody(*which); | 343 | encodedString * data = wrap->fetchRawBody(which); |
344 | if (!data) | 344 | if (!data) |
@@ -393,4 +393,4 @@ bool SMTPwrapper::flushOutbox() { | |||
393 | QString oldPw, oldUser; | 393 | QString oldPw, oldUser; |
394 | QList<RecMail> mailsToSend; | 394 | QValueList<RecMailP> mailsToSend; |
395 | QList<RecMail> mailsToRemove; | 395 | QValueList<RecMailP> mailsToRemove; |
396 | QString mbox("Outgoing"); | 396 | QString mbox("Outgoing"); |
@@ -423,3 +423,2 @@ bool SMTPwrapper::flushOutbox() { | |||
423 | 423 | ||
424 | mailsToSend.setAutoDelete(false); | ||
425 | sendProgress = new progressMailSend(); | 424 | sendProgress = new progressMailSend(); |
@@ -429,3 +428,3 @@ bool SMTPwrapper::flushOutbox() { | |||
429 | while (mailsToSend.count()>0) { | 428 | while (mailsToSend.count()>0) { |
430 | if (sendQueuedMail(wrap,mailsToSend.at(0))==0) { | 429 | if (sendQueuedMail(wrap, (*mailsToSend.begin()))==0) { |
431 | QMessageBox::critical(0,tr("Error sending mail"), | 430 | QMessageBox::critical(0,tr("Error sending mail"), |
@@ -435,4 +434,4 @@ bool SMTPwrapper::flushOutbox() { | |||
435 | } | 434 | } |
436 | mailsToRemove.append(mailsToSend.at(0)); | 435 | mailsToRemove.append((*mailsToSend.begin())); |
437 | mailsToSend.removeFirst(); | 436 | mailsToSend.remove(mailsToSend.begin()); |
438 | sendProgress->setCurrentMails(mailsToRemove.count()); | 437 | sendProgress->setCurrentMails(mailsToRemove.count()); |
@@ -452,3 +451,2 @@ bool SMTPwrapper::flushOutbox() { | |||
452 | wrap->deleteMails(mbox,mailsToRemove); | 451 | wrap->deleteMails(mbox,mailsToRemove); |
453 | mailsToSend.setAutoDelete(true); | ||
454 | delete wrap; | 452 | delete wrap; |
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h index 08bde74..71ae35c 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.h +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h | |||
@@ -13,3 +13,3 @@ | |||
13 | 13 | ||
14 | #include <opie2/osmart_pointer.h> | 14 | #include <opie2/osmartpointer.h> |
15 | 15 | ||
@@ -25,3 +25,3 @@ public: | |||
25 | virtual ~SMTPwrapper(); | 25 | virtual ~SMTPwrapper(); |
26 | void sendMail(const Opie::osmart_pointer<Mail>& mail,bool later=false ); | 26 | void sendMail(const Opie::OSmartPointer<Mail>& mail,bool later=false ); |
27 | bool flushOutbox(); | 27 | bool flushOutbox(); |
@@ -52,3 +52,3 @@ protected: | |||
52 | 52 | ||
53 | int sendQueuedMail(AbstractMail*wrap,RecMail*which); | 53 | int sendQueuedMail(AbstractMail*wrap,const Opie::OSmartPointer<RecMail>&which); |
54 | void storeFailedMail(const char*data,unsigned int size, const char*failuremessage); | 54 | void storeFailedMail(const char*data,unsigned int size, const char*failuremessage); |
diff --git a/noncore/net/mail/libmailwrapper/storemail.cpp b/noncore/net/mail/libmailwrapper/storemail.cpp index 052e0f1..595e7fc 100644 --- a/noncore/net/mail/libmailwrapper/storemail.cpp +++ b/noncore/net/mail/libmailwrapper/storemail.cpp | |||
@@ -51,3 +51,3 @@ Storemail::~Storemail() | |||
51 | 51 | ||
52 | int Storemail::storeMail(const Opie::osmart_pointer<Mail>&mail) | 52 | int Storemail::storeMail(const Opie::OSmartPointer<Mail>&mail) |
53 | { | 53 | { |
diff --git a/noncore/net/mail/libmailwrapper/storemail.h b/noncore/net/mail/libmailwrapper/storemail.h index 7d8ea3d..80c7431 100644 --- a/noncore/net/mail/libmailwrapper/storemail.h +++ b/noncore/net/mail/libmailwrapper/storemail.h | |||
@@ -20,3 +20,3 @@ public: | |||
20 | 20 | ||
21 | int storeMail(const Opie::osmart_pointer<Mail>&mail); | 21 | int storeMail(const Opie::OSmartPointer<Mail>&mail); |
22 | 22 | ||
diff --git a/noncore/net/mail/mailistviewitem.cpp b/noncore/net/mail/mailistviewitem.cpp index 75633ef..0b926da 100644 --- a/noncore/net/mail/mailistviewitem.cpp +++ b/noncore/net/mail/mailistviewitem.cpp | |||
@@ -12,5 +12,5 @@ void MailListViewItem::showEntry() | |||
12 | { | 12 | { |
13 | if ( mail_data.getFlags().testBit( FLAG_ANSWERED ) == true) { | 13 | if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { |
14 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgreplied") ); | 14 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgreplied") ); |
15 | } else if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { | 15 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { |
16 | /* I think it looks nicer if there are not such a log of icons but only on mails | 16 | /* I think it looks nicer if there are not such a log of icons but only on mails |
@@ -21,3 +21,3 @@ void MailListViewItem::showEntry() | |||
21 | } | 21 | } |
22 | double s = mail_data.Msgsize(); | 22 | double s = mail_data->Msgsize(); |
23 | int w; | 23 | int w; |
@@ -51,9 +51,9 @@ void MailListViewItem::showEntry() | |||
51 | 51 | ||
52 | setText(1,mail_data.getSubject()); | 52 | setText(1,mail_data->getSubject()); |
53 | setText(2,mail_data.getFrom()); | 53 | setText(2,mail_data->getFrom()); |
54 | setText(3,fsize); | 54 | setText(3,fsize); |
55 | setText(4,mail_data.getDate()); | 55 | setText(4,mail_data->getDate()); |
56 | } | 56 | } |
57 | 57 | ||
58 | void MailListViewItem::storeData(const RecMail&data) | 58 | void MailListViewItem::storeData(const RecMailP&data) |
59 | { | 59 | { |
@@ -62,3 +62,3 @@ void MailListViewItem::storeData(const RecMail&data) | |||
62 | 62 | ||
63 | const RecMail& MailListViewItem::data()const | 63 | const RecMailP& MailListViewItem::data()const |
64 | { | 64 | { |
@@ -69,4 +69,4 @@ MAILLIB::ATYPE MailListViewItem::wrapperType() | |||
69 | { | 69 | { |
70 | if (!mail_data.Wrapper()) return MAILLIB::A_UNDEFINED; | 70 | if (!mail_data->Wrapper()) return MAILLIB::A_UNDEFINED; |
71 | return mail_data.Wrapper()->getType(); | 71 | return mail_data->Wrapper()->getType(); |
72 | } | 72 | } |
diff --git a/noncore/net/mail/mailistviewitem.h b/noncore/net/mail/mailistviewitem.h index f736de0..d953d83 100644 --- a/noncore/net/mail/mailistviewitem.h +++ b/noncore/net/mail/mailistviewitem.h | |||
@@ -13,4 +13,4 @@ public: | |||
13 | 13 | ||
14 | void storeData(const RecMail&data); | 14 | void storeData(const RecMailP&data); |
15 | const RecMail&data()const; | 15 | const RecMailP&data()const; |
16 | void showEntry(); | 16 | void showEntry(); |
@@ -19,3 +19,3 @@ public: | |||
19 | protected: | 19 | protected: |
20 | RecMail mail_data; | 20 | RecMailP mail_data; |
21 | }; | 21 | }; |
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index bcf0866..c23ad3f 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -121,3 +121,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
121 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 121 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
122 | connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); | 122 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
123 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | ||
123 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 124 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
@@ -179,3 +180,3 @@ void MainWindow::slotShowFolders( bool ) | |||
179 | 180 | ||
180 | void MainWindow::refreshMailView(QList<RecMail>*) | 181 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
181 | { | 182 | { |
diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h index 1ba6299..8d004c6 100644 --- a/noncore/net/mail/mainwindow.h +++ b/noncore/net/mail/mainwindow.h | |||
@@ -13,2 +13,5 @@ | |||
13 | 13 | ||
14 | #include <libmailwrapper/mailtypes.h> | ||
15 | #include <opie2/osmartpointer.h> | ||
16 | |||
14 | class RecMail; | 17 | class RecMail; |
@@ -32,3 +35,3 @@ protected slots: | |||
32 | virtual void slotShowFolders( bool show ); | 35 | virtual void slotShowFolders( bool show ); |
33 | virtual void refreshMailView(QList<RecMail>*); | 36 | virtual void refreshMailView(const QValueList<RecMailP>&); |
34 | virtual void displayMail(); | 37 | virtual void displayMail(); |
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index d95b3c9..dd305df 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -147,3 +147,3 @@ void OpieMail::displayMail() | |||
147 | if (!item) return; | 147 | if (!item) return; |
148 | RecMail mail = ((MailListViewItem*)item)->data(); | 148 | RecMailP mail = ((MailListViewItem*)item)->data(); |
149 | RecBody body = folderView->fetchBody(mail); | 149 | RecBody body = folderView->fetchBody(mail); |
@@ -168,6 +168,6 @@ void OpieMail::slotDeleteMail() | |||
168 | if (!mailView->currentItem()) return; | 168 | if (!mailView->currentItem()) return; |
169 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 169 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
170 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail.getFrom() + " - " + mail.getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 170 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
171 | { | 171 | { |
172 | mail.Wrapper()->deleteMail( mail ); | 172 | mail->Wrapper()->deleteMail( mail ); |
173 | folderView->refreshCurrent(); | 173 | folderView->refreshCurrent(); |
@@ -219,3 +219,3 @@ void OpieMail::slotShowFolders( bool show ) | |||
219 | 219 | ||
220 | void OpieMail::refreshMailView(QList<RecMail>*list) | 220 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) |
221 | { | 221 | { |
@@ -223,6 +223,8 @@ void OpieMail::refreshMailView(QList<RecMail>*list) | |||
223 | mailView->clear(); | 223 | mailView->clear(); |
224 | for (unsigned int i = 0; i < list->count();++i) | 224 | |
225 | QValueList<RecMailP>::ConstIterator it; | ||
226 | for (it = list.begin(); it != list.end();++it) | ||
225 | { | 227 | { |
226 | item = new MailListViewItem(mailView,item); | 228 | item = new MailListViewItem(mailView,item); |
227 | item->storeData(*(list->at(i))); | 229 | item->storeData((*it)); |
228 | item->showEntry(); | 230 | item->showEntry(); |
@@ -246,3 +248,3 @@ void OpieMail::slotMoveCopyMail() | |||
246 | if (!mailView->currentItem()) return; | 248 | if (!mailView->currentItem()) return; |
247 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 249 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
248 | AbstractMail*targetMail = 0; | 250 | AbstractMail*targetMail = 0; |
@@ -254,3 +256,3 @@ void OpieMail::slotMoveCopyMail() | |||
254 | targetFolder = sels.currentFolder(); | 256 | targetFolder = sels.currentFolder(); |
255 | if ( (mail.Wrapper()==targetMail && mail.getMbox()==targetFolder) || | 257 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || |
256 | targetFolder.isEmpty()) | 258 | targetFolder.isEmpty()) |
@@ -265,3 +267,3 @@ void OpieMail::slotMoveCopyMail() | |||
265 | } | 267 | } |
266 | mail.Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); | 268 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); |
267 | folderView->refreshCurrent(); | 269 | folderView->refreshCurrent(); |
diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h index 88c7ea1..b93bd60 100644 --- a/noncore/net/mail/opiemail.h +++ b/noncore/net/mail/opiemail.h | |||
@@ -6,2 +6,4 @@ | |||
6 | 6 | ||
7 | #include <opie2/osmartpointer.h> | ||
8 | #include <libmailwrapper/mailtypes.h> | ||
7 | 9 | ||
@@ -29,3 +31,3 @@ protected slots: | |||
29 | virtual void slotShowFolders( bool show ); | 31 | virtual void slotShowFolders( bool show ); |
30 | virtual void refreshMailView(QList<RecMail>*); | 32 | virtual void refreshMailView(const QValueList<RecMailP>&); |
31 | virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); | 33 | virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); |
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index 78652d7..894a386 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -227,3 +227,3 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
227 | { | 227 | { |
228 | encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); | 228 | encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); |
229 | if (content) | 229 | if (content) |
@@ -247,5 +247,5 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
247 | { | 247 | { |
248 | if ( m_recMail.Wrapper() != 0l ) | 248 | if ( m_recMail->Wrapper() != 0l ) |
249 | { // make sure that there is a wrapper , even after delete or simular actions | 249 | { // make sure that there is a wrapper , even after delete or simular actions |
250 | browser->setText( m_recMail.Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); | 250 | browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); |
251 | } | 251 | } |
@@ -258,3 +258,3 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int | |||
258 | 258 | ||
259 | void ViewMail::setMail( RecMail mail ) | 259 | void ViewMail::setMail( RecMailP mail ) |
260 | { | 260 | { |
@@ -263,10 +263,10 @@ void ViewMail::setMail( RecMail mail ) | |||
263 | 263 | ||
264 | m_mail[0] = mail.getFrom(); | 264 | m_mail[0] = mail->getFrom(); |
265 | m_mail[1] = mail.getSubject(); | 265 | m_mail[1] = mail->getSubject(); |
266 | m_mail[3] = mail.getDate(); | 266 | m_mail[3] = mail->getDate(); |
267 | m_mail[4] = mail.Msgid(); | 267 | m_mail[4] = mail->Msgid(); |
268 | 268 | ||
269 | m_mail2[0] = mail.To(); | 269 | m_mail2[0] = mail->To(); |
270 | m_mail2[1] = mail.CC(); | 270 | m_mail2[1] = mail->CC(); |
271 | m_mail2[2] = mail.Bcc(); | 271 | m_mail2[2] = mail->Bcc(); |
272 | 272 | ||
@@ -350,3 +350,3 @@ ViewMail::~ViewMail() | |||
350 | { | 350 | { |
351 | m_recMail.Wrapper()->cleanMimeCache(); | 351 | m_recMail->Wrapper()->cleanMimeCache(); |
352 | hide(); | 352 | hide(); |
@@ -417,6 +417,6 @@ void ViewMail::slotReply() | |||
417 | ComposeMail composer( settings ,this, 0, true); | 417 | ComposeMail composer( settings ,this, 0, true); |
418 | if (m_recMail.Replyto().isEmpty()) { | 418 | if (m_recMail->Replyto().isEmpty()) { |
419 | composer.setTo( m_recMail.getFrom()); | 419 | composer.setTo( m_recMail->getFrom()); |
420 | } else { | 420 | } else { |
421 | composer.setTo( m_recMail.Replyto()); | 421 | composer.setTo( m_recMail->Replyto()); |
422 | } | 422 | } |
@@ -424,3 +424,3 @@ void ViewMail::slotReply() | |||
424 | composer.setMessage( rtext ); | 424 | composer.setMessage( rtext ); |
425 | composer.setInReplyTo(m_recMail.Msgid()); | 425 | composer.setInReplyTo(m_recMail->Msgid()); |
426 | 426 | ||
@@ -428,3 +428,3 @@ void ViewMail::slotReply() | |||
428 | { | 428 | { |
429 | m_recMail.Wrapper()->answeredMail(m_recMail); | 429 | m_recMail->Wrapper()->answeredMail(m_recMail); |
430 | } | 430 | } |
@@ -471,3 +471,3 @@ void ViewMail::slotDeleteMail( ) | |||
471 | { | 471 | { |
472 | m_recMail.Wrapper()->deleteMail( m_recMail ); | 472 | m_recMail->Wrapper()->deleteMail( m_recMail ); |
473 | hide(); | 473 | hide(); |
diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h index abbd5b3..6875e3c 100644 --- a/noncore/net/mail/viewmail.h +++ b/noncore/net/mail/viewmail.h | |||
@@ -38,3 +38,3 @@ public: | |||
38 | void exec(); | 38 | void exec(); |
39 | void setMail( RecMail mail ); | 39 | void setMail( RecMailP mail ); |
40 | void setBody( RecBody body ); | 40 | void setBody( RecBody body ); |
@@ -62,3 +62,3 @@ private: | |||
62 | RecBody m_body; | 62 | RecBody m_body; |
63 | RecMail m_recMail; | 63 | RecMailP m_recMail; |
64 | bool m_showHtml; | 64 | bool m_showHtml; |