summaryrefslogtreecommitdiff
authoralwin <alwin>2004-03-12 19:24:38 (UTC)
committer alwin <alwin>2004-03-12 19:24:38 (UTC)
commitb600871ce93553a116a66fd80acd6dfc1cc46829 (patch) (unidiff)
treeb361346a49e09d9f0220993583bf183cf29bd974
parent874d5a34eca296263dcd1adf857aebe9981825a1 (diff)
downloadopie-b600871ce93553a116a66fd80acd6dfc1cc46829.zip
opie-b600871ce93553a116a66fd80acd6dfc1cc46829.tar.gz
opie-b600871ce93553a116a66fd80acd6dfc1cc46829.tar.bz2
some more smart-pointers
some bugfixes some renaming of internals
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountitem.cpp34
-rw-r--r--noncore/net/mail/accountitem.h58
-rw-r--r--noncore/net/mail/accountview.cpp12
-rw-r--r--noncore/net/mail/accountview.h11
-rw-r--r--noncore/net/mail/composemail.cpp24
-rw-r--r--noncore/net/mail/composemail.h4
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.cpp16
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.h36
-rw-r--r--noncore/net/mail/libmailwrapper/generatemail.cpp4
-rw-r--r--noncore/net/mail/libmailwrapper/generatemail.h6
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp10
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.h10
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp49
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.h34
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.cpp4
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.h15
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.cpp2
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.h8
-rw-r--r--noncore/net/mail/libmailwrapper/mboxwrapper.cpp43
-rw-r--r--noncore/net/mail/libmailwrapper/mboxwrapper.h24
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp50
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.h26
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.cpp26
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.h14
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.cpp32
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.h14
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp18
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.h6
-rw-r--r--noncore/net/mail/libmailwrapper/storemail.cpp2
-rw-r--r--noncore/net/mail/libmailwrapper/storemail.h2
-rw-r--r--noncore/net/mail/mailistviewitem.cpp20
-rw-r--r--noncore/net/mail/mailistviewitem.h6
-rw-r--r--noncore/net/mail/mainwindow.cpp7
-rw-r--r--noncore/net/mail/mainwindow.h11
-rw-r--r--noncore/net/mail/opiemail.cpp24
-rw-r--r--noncore/net/mail/opiemail.h4
-rw-r--r--noncore/net/mail/viewmail.cpp36
-rw-r--r--noncore/net/mail/viewmail.h34
38 files changed, 369 insertions, 367 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
@@ -49,7 +49,7 @@ AbstractMail *POP3viewItem::getWrapper()
49 return wrapper; 49 return wrapper;
50} 50}
51 51
52void POP3viewItem::refresh( QList<RecMail> & ) 52void POP3viewItem::refresh(QValueList<Opie::OSmartPointer<RecMail> > & )
53{ 53{
54 refresh(); 54 refresh();
55} 55}
@@ -75,7 +75,7 @@ void POP3viewItem::refresh()
75 delete folders; 75 delete folders;
76} 76}
77 77
78RecBody POP3viewItem::fetchBody( const RecMail &mail ) 78RecBody POP3viewItem::fetchBody( const RecMailP &mail )
79{ 79{
80 qDebug( "POP3 fetchBody" ); 80 qDebug( "POP3 fetchBody" );
81 return wrapper->fetchBody( mail ); 81 return wrapper->fetchBody( mail );
@@ -154,13 +154,13 @@ POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent ,
154 setText( 0, folder->getDisplayName() ); 154 setText( 0, folder->getDisplayName() );
155} 155}
156 156
157void POP3folderItem::refresh(QList<RecMail>&target) 157void POP3folderItem::refresh(QValueList<RecMailP>&target)
158{ 158{
159 if (folder->may_select()) 159 if (folder->may_select())
160 pop3->getWrapper()->listMessages( folder->getName(),target ); 160 pop3->getWrapper()->listMessages( folder->getName(),target );
161} 161}
162 162
163RecBody POP3folderItem::fetchBody(const RecMail&aMail) 163RecBody POP3folderItem::fetchBody(const RecMailP&aMail)
164{ 164{
165 return pop3->getWrapper()->fetchBody(aMail); 165 return pop3->getWrapper()->fetchBody(aMail);
166} 166}
@@ -239,7 +239,7 @@ AbstractMail *NNTPviewItem::getWrapper()
239 return wrapper; 239 return wrapper;
240} 240}
241 241
242void NNTPviewItem::refresh( QList<RecMail> & ) 242void NNTPviewItem::refresh( QValueList<RecMailP> & )
243{ 243{
244 refresh(); 244 refresh();
245} 245}
@@ -266,7 +266,7 @@ void NNTPviewItem::refresh()
266 delete folders; 266 delete folders;
267} 267}
268 268
269RecBody NNTPviewItem::fetchBody( const RecMail &mail ) 269RecBody NNTPviewItem::fetchBody( const RecMailP &mail )
270{ 270{
271 qDebug( "NNTP fetchBody" ); 271 qDebug( "NNTP fetchBody" );
272 return wrapper->fetchBody( mail ); 272 return wrapper->fetchBody( mail );
@@ -358,13 +358,13 @@ NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent
358 setText( 0, folder->getDisplayName() ); 358 setText( 0, folder->getDisplayName() );
359} 359}
360 360
361void NNTPfolderItem::refresh(QList<RecMail>&target) 361void NNTPfolderItem::refresh(QValueList<RecMailP>&target)
362{ 362{
363 if (folder->may_select()) 363 if (folder->may_select())
364 nntp->getWrapper()->listMessages( folder->getName(),target ); 364 nntp->getWrapper()->listMessages( folder->getName(),target );
365} 365}
366 366
367RecBody NNTPfolderItem::fetchBody(const RecMail&aMail) 367RecBody NNTPfolderItem::fetchBody(const RecMailP&aMail)
368{ 368{
369 return nntp->getWrapper()->fetchBody(aMail); 369 return nntp->getWrapper()->fetchBody(aMail);
370} 370}
@@ -428,7 +428,7 @@ AbstractMail *IMAPviewItem::getWrapper()
428 return wrapper; 428 return wrapper;
429} 429}
430 430
431void IMAPviewItem::refresh(QList<RecMail>&) 431void IMAPviewItem::refresh(QValueList<RecMailP>&)
432{ 432{
433 refreshFolders(false); 433 refreshFolders(false);
434} 434}
@@ -561,7 +561,7 @@ void IMAPviewItem::contextMenuSelected(int id)
561 } 561 }
562} 562}
563 563
564RecBody IMAPviewItem::fetchBody(const RecMail&) 564RecBody IMAPviewItem::fetchBody(const RecMailP&)
565{ 565{
566 return RecBody(); 566 return RecBody();
567} 567}
@@ -609,7 +609,7 @@ const QString& IMAPfolderItem::Delemiter()const
609 return folder->Separator(); 609 return folder->Separator();
610} 610}
611 611
612void IMAPfolderItem::refresh(QList<RecMail>&target) 612void IMAPfolderItem::refresh(QValueList<RecMailP>&target)
613{ 613{
614 if (folder->may_select()) 614 if (folder->may_select())
615 { 615 {
@@ -621,7 +621,7 @@ void IMAPfolderItem::refresh(QList<RecMail>&target)
621 } 621 }
622} 622}
623 623
624RecBody IMAPfolderItem::fetchBody(const RecMail&aMail) 624RecBody IMAPfolderItem::fetchBody(const RecMailP&aMail)
625{ 625{
626 return imap->getWrapper()->fetchBody(aMail); 626 return imap->getWrapper()->fetchBody(aMail);
627} 627}
@@ -748,7 +748,7 @@ AbstractMail *MHviewItem::getWrapper()
748 return wrapper; 748 return wrapper;
749} 749}
750 750
751void MHviewItem::refresh( QList<RecMail> & target) 751void MHviewItem::refresh( QValueList<RecMailP> & target)
752{ 752{
753 refresh(false); 753 refresh(false);
754 getWrapper()->listMessages( "",target ); 754 getWrapper()->listMessages( "",target );
@@ -799,7 +799,7 @@ void MHviewItem::refresh(bool force)
799 delete folders; 799 delete folders;
800} 800}
801 801
802RecBody MHviewItem::fetchBody( const RecMail &mail ) 802RecBody MHviewItem::fetchBody( const RecMailP &mail )
803{ 803{
804 qDebug( "MH fetchBody" ); 804 qDebug( "MH fetchBody" );
805 return wrapper->fetchBody( mail ); 805 return wrapper->fetchBody( mail );
@@ -914,13 +914,13 @@ const FolderP&MHfolderItem::getFolder()const
914 return folder; 914 return folder;
915} 915}
916 916
917void MHfolderItem::refresh(QList<RecMail>&target) 917void MHfolderItem::refresh(QValueList<RecMailP>&target)
918{ 918{
919 if (folder->may_select()) 919 if (folder->may_select())
920 mbox->getWrapper()->listMessages( folder->getName(),target ); 920 mbox->getWrapper()->listMessages( folder->getName(),target );
921} 921}
922 922
923RecBody MHfolderItem::fetchBody(const RecMail&aMail) 923RecBody MHfolderItem::fetchBody(const RecMailP&aMail)
924{ 924{
925 return mbox->getWrapper()->fetchBody(aMail); 925 return mbox->getWrapper()->fetchBody(aMail);
926} 926}
@@ -1042,7 +1042,7 @@ AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after )
1042 init(); 1042 init();
1043} 1043}
1044 1044
1045AccountViewItem::AccountViewItem( const Opie::osmart_pointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ) 1045AccountViewItem::AccountViewItem( const Opie::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after )
1046 :QListViewItem( parent,after ),folder(folderInit) 1046 :QListViewItem( parent,after ),folder(folderInit)
1047{ 1047{
1048 init(); 1048 init();
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
@@ -3,7 +3,7 @@
3 3
4#include <qlistview.h> 4#include <qlistview.h>
5#include <qlist.h> 5#include <qlist.h>
6#include <opie2/osmart_pointer.h> 6#include <opie2/osmartpointer.h>
7 7
8class POP3wrapper; 8class POP3wrapper;
9class RecMail; 9class RecMail;
@@ -24,11 +24,11 @@ public:
24 AccountViewItem( AccountView *parent ); 24 AccountViewItem( AccountView *parent );
25 AccountViewItem( QListViewItem *parent); 25 AccountViewItem( QListViewItem *parent);
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;};
33 virtual void contextMenuSelected(int){} 33 virtual void contextMenuSelected(int){}
34 virtual AccountView*accountView(); 34 virtual AccountView*accountView();
@@ -39,10 +39,10 @@ protected:
39 AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0); 39 AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0);
40 virtual void init(); 40 virtual void init();
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};
47 47
48class POP3viewItem : public AccountViewItem 48class POP3viewItem : public AccountViewItem
@@ -51,8 +51,8 @@ class POP3viewItem : public AccountViewItem
51public: 51public:
52 POP3viewItem( POP3account *a, AccountView *parent ); 52 POP3viewItem( POP3account *a, AccountView *parent );
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();
57 virtual QPopupMenu * getContextMenu(); 57 virtual QPopupMenu * getContextMenu();
58 virtual void contextMenuSelected(int); 58 virtual void contextMenuSelected(int);
@@ -69,10 +69,10 @@ class POP3folderItem : public AccountViewItem
69{ 69{
70 70
71public: 71public:
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();
77 virtual void contextMenuSelected(int); 77 virtual void contextMenuSelected(int);
78 78
@@ -88,8 +88,8 @@ class NNTPviewItem : public AccountViewItem
88public: 88public:
89 NNTPviewItem( NNTPaccount *a, AccountView *parent ); 89 NNTPviewItem( NNTPaccount *a, AccountView *parent );
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();
94 virtual QPopupMenu * getContextMenu(); 94 virtual QPopupMenu * getContextMenu();
95 virtual void contextMenuSelected(int); 95 virtual void contextMenuSelected(int);
@@ -107,10 +107,10 @@ class NNTPfolderItem : public AccountViewItem
107{ 107{
108 108
109public: 109public:
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();
115 virtual void contextMenuSelected(int); 115 virtual void contextMenuSelected(int);
116 116
@@ -127,8 +127,8 @@ class IMAPviewItem : public AccountViewItem
127public: 127public:
128 IMAPviewItem( IMAPaccount *a, AccountView *parent ); 128 IMAPviewItem( IMAPaccount *a, AccountView *parent );
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();
133 virtual QPopupMenu * getContextMenu(); 133 virtual QPopupMenu * getContextMenu();
134 virtual void contextMenuSelected(int); 134 virtual void contextMenuSelected(int);
@@ -147,11 +147,11 @@ class IMAPfolderItem : public AccountViewItem
147{ 147{
148 148
149public: 149public:
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();
156 virtual void contextMenuSelected(int); 156 virtual void contextMenuSelected(int);
157 virtual const QString& Delemiter()const; 157 virtual const QString& Delemiter()const;
@@ -169,8 +169,8 @@ class MHviewItem : public AccountViewItem
169public: 169public:
170 MHviewItem( const QString&aMboxPath, AccountView *parent ); 170 MHviewItem( const QString&aMboxPath, AccountView *parent );
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();
175 virtual QPopupMenu * getContextMenu(); 175 virtual QPopupMenu * getContextMenu();
176 virtual void contextMenuSelected(int); 176 virtual void contextMenuSelected(int);
@@ -189,14 +189,14 @@ class MHfolderItem : public AccountViewItem
189{ 189{
190 190
191public: 191public:
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();
201 201
202protected: 202protected:
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
@@ -92,11 +92,10 @@ void AccountView::refresh(QListViewItem *item)
92 if ( item ) 92 if ( item )
93 { 93 {
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 }
101} 100}
102 101
@@ -104,18 +103,17 @@ void AccountView::refreshCurrent()
104{ 103{
105 m_currentItem = currentItem(); 104 m_currentItem = currentItem();
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}
113 111
114void AccountView::refreshAll() 112void AccountView::refreshAll()
115{ 113{
116} 114}
117 115
118RecBody AccountView::fetchBody(const RecMail&aMail) 116RecBody AccountView::fetchBody(const RecMailP&aMail)
119{ 117{
120 QListViewItem*item = selectedItem (); 118 QListViewItem*item = selectedItem ();
121 if (!item) return RecBody(); 119 if (!item) return RecBody();
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
@@ -3,11 +3,10 @@
3 3
4#include <qlistview.h> 4#include <qlistview.h>
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
8class Selectstore; 9class Selectstore;
9class RecMail;
10class RecBody;
11class Folder; 10class Folder;
12class AbstractMail; 11class AbstractMail;
13class Account; 12class Account;
@@ -22,8 +21,8 @@ public:
22 AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); 21 AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
23 virtual ~AccountView(); 22 virtual ~AccountView();
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();
28 27
29public slots: 28public slots:
@@ -35,7 +34,7 @@ public slots:
35 void setupFolderselect(Selectstore*sels); 34 void setupFolderselect(Selectstore*sels);
36 35
37signals: 36signals:
38 void refreshMailview(QList<RecMail>*); 37 void refreshMailview(const QValueList<RecMailP>& );
39 38
40protected: 39protected:
41 QListViewItem* m_currentItem; 40 QListViewItem* m_currentItem;
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
@@ -188,7 +188,7 @@ void ComposeMail::accept()
188 qDebug( "Sending Mail with " + 188 qDebug( "Sending Mail with " +
189 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() ); 189 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() );
190#endif 190#endif
191 Opie::osmart_pointer<Mail> mail=new Mail; 191 Opie::OSmartPointer<Mail> mail=new Mail;
192 192
193 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); 193 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
194 mail->setMail(fromBox->currentText()); 194 mail->setMail(fromBox->currentText());
@@ -236,7 +236,7 @@ void ComposeMail::reject()
236 tr("No"),QString::null,0,1); 236 tr("No"),QString::null,0,1);
237 237
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());
241 mail->setTo( toLine->text() ); 241 mail->setTo( toLine->text() );
242 mail->setName(senderNameEdit->text()); 242 mail->setName(senderNameEdit->text());
@@ -256,11 +256,11 @@ void ComposeMail::reject()
256 } 256 }
257 qDebug(txt); 257 qDebug(txt);
258 mail->setMessage( txt ); 258 mail->setMessage( txt );
259 259
260 /* only use the default drafts folder name! */ 260 /* only use the default drafts folder name! */
261 Storemail wrapper(AbstractMail::draftFolder()); 261 Storemail wrapper(AbstractMail::draftFolder());
262 wrapper.storeMail(mail); 262 wrapper.storeMail(mail);
263 263
264 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 264 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
265 /* attachments we will ignore! */ 265 /* attachments we will ignore! */
266 if ( it != NULL ) { 266 if ( it != NULL ) {
@@ -275,15 +275,15 @@ ComposeMail::~ComposeMail()
275{ 275{
276} 276}
277 277
278void ComposeMail::reEditMail(const RecMail&current) 278void ComposeMail::reEditMail(const RecMailP&current)
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}
288 288
289AttachViewItem::AttachViewItem( QListView *parent, Attachment *att ) 289AttachViewItem::AttachViewItem( QListView *parent, Attachment *att )
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
@@ -9,7 +9,9 @@
9#include <libmailwrapper/settings.h> 9#include <libmailwrapper/settings.h>
10#include <libmailwrapper/mailwrapper.h> 10#include <libmailwrapper/mailwrapper.h>
11 11
12class RecMail;
12 13
14#include <opie2/osmartpointer.h>
13 15
14class AddressPicker : public AddressPickerUI 16class AddressPicker : public AddressPickerUI
15{ 17{
@@ -35,7 +37,7 @@ public:
35 ComposeMail( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); 37 ComposeMail( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 );
36 virtual ~ComposeMail(); 38 virtual ~ComposeMail();
37 39
38 void reEditMail(const RecMail&current); 40 void reEditMail(const Opie::OSmartPointer<RecMail>&current);
39 41
40public slots: 42public slots:
41 void slotAdjustColumns(); 43 void slotAdjustColumns();
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
@@ -81,7 +81,7 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin
81 81
82QString AbstractMail::convert_String(const char*text) 82QString 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;
86 int err = MAILIMF_NO_ERROR; 86 int err = MAILIMF_NO_ERROR;
87 87
@@ -111,7 +111,7 @@ QString AbstractMail::gen_attachment_id()
111 return "{" + stream.read().stripWhiteSpace() + "}"; 111 return "{" + stream.read().stripWhiteSpace() + "}";
112} 112}
113 113
114int AbstractMail::createMbox(const QString&,const FolderP&,const QString& delemiter,bool) 114int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool)
115{ 115{
116 return 0; 116 return 0;
117} 117}
@@ -129,31 +129,31 @@ QString AbstractMail::draftFolder()
129} 129}
130 130
131/* temporary - will be removed when implemented in all classes */ 131/* temporary - will be removed when implemented in all classes */
132void AbstractMail::deleteMails(const QString &,QList<RecMail> &) 132void AbstractMail::deleteMails(const QString &,const QValueList<Opie::OSmartPointer<RecMail> > &)
133{ 133{
134} 134}
135 135
136void AbstractMail::mvcpAllMails(const FolderP&fromFolder, 136void AbstractMail::mvcpAllMails(const FolderP&fromFolder,
137 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 137 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
138{ 138{
139 QList<RecMail> t; 139 QValueList<RecMailP> t;
140 listMessages(fromFolder->getName(),t); 140 listMessages(fromFolder->getName(),t);
141 encodedString*st = 0; 141 encodedString*st = 0;
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) {
146 targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); 146 targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder);
147 delete st; 147 delete st;
148 } 148 }
149 t.removeFirst(); 149 t.remove(t.begin());
150 } 150 }
151 if (moveit) { 151 if (moveit) {
152 deleteAllMail(fromFolder); 152 deleteAllMail(fromFolder);
153 } 153 }
154} 154}
155 155
156void AbstractMail::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 156void AbstractMail::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
157{ 157{
158 encodedString*st = 0; 158 encodedString*st = 0;
159 st = fetchRawBody(mail); 159 st = fetchRawBody(mail);
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
@@ -6,11 +6,9 @@
6#include "settings.h" 6#include "settings.h"
7 7
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
11class RecMail;
12class RecBody;
13class RecPart;
14class IMAPwrapper; 12class IMAPwrapper;
15class POP3wrapper; 13class POP3wrapper;
16class Folder; 14class Folder;
@@ -23,25 +21,25 @@ class AbstractMail:public QObject
23public: 21public:
24 AbstractMail(){}; 22 AbstractMail(){};
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
46 virtual void cleanMimeCache(){}; 44 virtual void cleanMimeCache(){};
47 /* mail box methods */ 45 /* mail box methods */
@@ -49,7 +47,7 @@ public:
49 * if the implementing subclass has prefixes, 47 * if the implementing subclass has prefixes,
50 * them has to be appended automatic. 48 * them has to be appended automatic.
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);
54 virtual void logout()=0; 52 virtual void logout()=0;
55 53
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
@@ -279,7 +279,7 @@ mailimf_mailbox *Generatemail::newMailbox(const QString&name, const QString&mail
279 strdup( mail.latin1() ) ); 279 strdup( mail.latin1() ) );
280} 280}
281 281
282mailimf_fields *Generatemail::createImfFields(const Opie::osmart_pointer<Mail>&mail ) 282mailimf_fields *Generatemail::createImfFields(const Opie::OSmartPointer<Mail>&mail )
283{ 283{
284 mailimf_fields *fields = NULL; 284 mailimf_fields *fields = NULL;
285 mailimf_field *xmailer = NULL; 285 mailimf_field *xmailer = NULL;
@@ -399,7 +399,7 @@ mailimf_fields *Generatemail::createImfFields(const Opie::osmart_pointer<Mail>&m
399 return fields; 399 return fields;
400} 400}
401 401
402mailmime *Generatemail::createMimeMail(const Opie::osmart_pointer<Mail> &mail ) { 402mailmime *Generatemail::createMimeMail(const Opie::OSmartPointer<Mail> &mail ) {
403 mailmime *message, *txtPart; 403 mailmime *message, *txtPart;
404 mailimf_fields *fields; 404 mailimf_fields *fields;
405 int err; 405 int err;
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
@@ -6,7 +6,7 @@
6#include <qobject.h> 6#include <qobject.h>
7#include <libetpan/clist.h> 7#include <libetpan/clist.h>
8 8
9#include <opie2/osmart_pointer.h> 9#include <opie2/osmartpointer.h>
10 10
11class Mail; 11class Mail;
12class RecMail; 12class RecMail;
@@ -36,8 +36,8 @@ protected:
36 mailmime *buildFilePart(const QString&filename,const QString&mimetype,const QString&content); 36 mailmime *buildFilePart(const QString&filename,const QString&mimetype,const QString&content);
37 mailmime *buildTxtPart(const QString&str ); 37 mailmime *buildTxtPart(const QString&str );
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 );
42 42
43 static const char* USER_AGENT; 43 static const char* USER_AGENT;
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
@@ -331,7 +331,7 @@ QString Genericwrapper::parseMailboxList( mailimf_mailbox_list *list )
331 return result; 331 return result;
332} 332}
333 333
334encodedString* Genericwrapper::fetchDecodedPart(const RecMail&,const RecPart&part) 334encodedString* Genericwrapper::fetchDecodedPart(const RecMailP&,const RecPart&part)
335{ 335{
336 QMap<QString,encodedString*>::ConstIterator it = bodyCache.find(part.Identifier()); 336 QMap<QString,encodedString*>::ConstIterator it = bodyCache.find(part.Identifier());
337 if (it==bodyCache.end()) return new encodedString(); 337 if (it==bodyCache.end()) return new encodedString();
@@ -339,7 +339,7 @@ encodedString* Genericwrapper::fetchDecodedPart(const RecMail&,const RecPart&par
339 return t; 339 return t;
340} 340}
341 341
342encodedString* Genericwrapper::fetchRawPart(const RecMail&mail,const RecPart&part) 342encodedString* Genericwrapper::fetchRawPart(const RecMailP&mail,const RecPart&part)
343{ 343{
344 QMap<QString,encodedString*>::ConstIterator it = bodyCache.find(part.Identifier()); 344 QMap<QString,encodedString*>::ConstIterator it = bodyCache.find(part.Identifier());
345 if (it==bodyCache.end()) return new encodedString(); 345 if (it==bodyCache.end()) return new encodedString();
@@ -347,7 +347,7 @@ encodedString* Genericwrapper::fetchRawPart(const RecMail&mail,const RecPart&par
347 return t; 347 return t;
348} 348}
349 349
350QString Genericwrapper::fetchTextPart(const RecMail&mail,const RecPart&part) 350QString Genericwrapper::fetchTextPart(const RecMailP&mail,const RecPart&part)
351{ 351{
352 encodedString*t = fetchDecodedPart(mail,part); 352 encodedString*t = fetchDecodedPart(mail,part);
353 QString text=t->Content(); 353 QString text=t->Content();
@@ -387,7 +387,7 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies)
387 return res; 387 return res;
388} 388}
389 389
390void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const QString&mailbox,bool mbox_as_to) 390void Genericwrapper::parseList(QValueList<Opie::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to)
391{ 391{
392 int r; 392 int r;
393 mailmessage_list * env_list = 0; 393 mailmessage_list * env_list = 0;
@@ -415,7 +415,7 @@ void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const
415 //qDebug("could not fetch envelope of message %i", i); 415 //qDebug("could not fetch envelope of message %i", i);
416 continue; 416 continue;
417 } 417 }
418 RecMail * mail = new RecMail(); 418 RecMailP mail = new RecMail();
419 mail->setWrapper(this); 419 mail->setWrapper(this);
420 mail_flags * flag_result = 0; 420 mail_flags * flag_result = 0;
421 r = mailmessage_get_flags(msg,&flag_result); 421 r = mailmessage_get_flags(msg,&flag_result);
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
@@ -34,11 +34,11 @@ public:
34 Genericwrapper(); 34 Genericwrapper();
35 virtual ~Genericwrapper(); 35 virtual ~Genericwrapper();
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(){};
43 virtual void storeMessage(const char*msg,size_t length, const QString&folder){}; 43 virtual void storeMessage(const char*msg,size_t length, const QString&folder){};
44 44
@@ -54,7 +54,7 @@ protected:
54 static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime); 54 static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime);
55 static void fillParameters(RecPart&target,clist*parameters); 55 static void fillParameters(RecPart&target,clist*parameters);
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);
59 59
60 QString msgTempName; 60 QString msgTempName;
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
@@ -205,7 +205,7 @@ void IMAPwrapper::logout()
205 m_Lastmbox = ""; 205 m_Lastmbox = "";
206} 206}
207 207
208void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) 208void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::OSmartPointer<RecMail> > &target )
209{ 209{
210 int err = MAILIMAP_NO_ERROR; 210 int err = MAILIMAP_NO_ERROR;
211 clist *result = 0; 211 clist *result = 0;
@@ -266,7 +266,7 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
266 if (result) mailimap_fetch_list_free(result); 266 if (result) mailimap_fetch_list_free(result);
267} 267}
268 268
269QValueList<Opie::osmart_pointer<Folder> >* IMAPwrapper::listFolders() 269QValueList<Opie::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
270{ 270{
271 const char *path, *mask; 271 const char *path, *mask;
272 int err = MAILIMAP_NO_ERROR; 272 int err = MAILIMAP_NO_ERROR;
@@ -482,7 +482,7 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
482 return m; 482 return m;
483} 483}
484 484
485RecBody IMAPwrapper::fetchBody(const RecMail&mail) 485RecBody IMAPwrapper::fetchBody(const RecMailP&mail)
486{ 486{
487 RecBody body; 487 RecBody body;
488 const char *mb; 488 const char *mb;
@@ -494,19 +494,19 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail)
494 mailimap_set *set = 0; 494 mailimap_set *set = 0;
495 mailimap_body*body_desc = 0; 495 mailimap_body*body_desc = 0;
496 496
497 mb = mail.getMbox().latin1(); 497 mb = mail->getMbox().latin1();
498 498
499 login(); 499 login();
500 if (!m_imap) { 500 if (!m_imap) {
501 return body; 501 return body;
502 } 502 }
503 err = selectMbox(mail.getMbox()); 503 err = selectMbox(mail->getMbox());
504 if ( err != MAILIMAP_NO_ERROR ) { 504 if ( err != MAILIMAP_NO_ERROR ) {
505 return body; 505 return body;
506 } 506 }
507 507
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();
511 fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt); 511 fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt);
512 err = mailimap_fetch( m_imap, set, fetchType, &result ); 512 err = mailimap_fetch( m_imap, set, fetchType, &result );
@@ -568,7 +568,7 @@ QStringList IMAPwrapper::address_list_to_stringlist(clist*list)
568 return l; 568 return l;
569} 569}
570 570
571encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>&path,bool internal_call) 571encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call)
572{ 572{
573 encodedString*res=new encodedString; 573 encodedString*res=new encodedString;
574 int err; 574 int err;
@@ -585,12 +585,12 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>
585 return res; 585 return res;
586 } 586 }
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 ) {
590 return res; 590 return res;
591 } 591 }
592 } 592 }
593 set = mailimap_set_new_single(mail.getNumber()); 593 set = mailimap_set_new_single(mail->getNumber());
594 594
595 clist*id_list = 0; 595 clist*id_list = 0;
596 596
@@ -641,7 +641,7 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>
641 641
642/* current_recursion is for recursive calls. 642/* current_recursion is for recursive calls.
643 current_count means the position inside the internal loop! */ 643 current_count means the position inside the internal loop! */
644void IMAPwrapper::traverseBody(const RecMail&mail,mailimap_body*body,RecBody&target_body, 644void 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)
646{ 646{
647 if (!body || current_recursion>=10) { 647 if (!body || current_recursion>=10) {
@@ -869,7 +869,7 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which)
869 target_part.setSize(which->bd_size); 869 target_part.setSize(which->bd_size);
870} 870}
871 871
872void IMAPwrapper::deleteMail(const RecMail&mail) 872void IMAPwrapper::deleteMail(const RecMailP&mail)
873{ 873{
874 mailimap_flag_list*flist; 874 mailimap_flag_list*flist;
875 mailimap_set *set; 875 mailimap_set *set;
@@ -879,14 +879,14 @@ void IMAPwrapper::deleteMail(const RecMail&mail)
879 if (!m_imap) { 879 if (!m_imap) {
880 return; 880 return;
881 } 881 }
882 err = selectMbox(mail.getMbox()); 882 err = selectMbox(mail->getMbox());
883 if ( err != MAILIMAP_NO_ERROR ) { 883 if ( err != MAILIMAP_NO_ERROR ) {
884 return; 884 return;
885 } 885 }
886 flist = mailimap_flag_list_new_empty(); 886 flist = mailimap_flag_list_new_empty();
887 mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); 887 mailimap_flag_list_add(flist,mailimap_flag_new_deleted());
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);
891 mailimap_set_free( set ); 891 mailimap_set_free( set );
892 mailimap_store_att_flags_free(store_flags); 892 mailimap_store_att_flags_free(store_flags);
@@ -904,7 +904,7 @@ void IMAPwrapper::deleteMail(const RecMail&mail)
904 qDebug("Delete successfull %s",m_imap->imap_response); 904 qDebug("Delete successfull %s",m_imap->imap_response);
905} 905}
906 906
907void IMAPwrapper::answeredMail(const RecMail&mail) 907void IMAPwrapper::answeredMail(const RecMailP&mail)
908{ 908{
909 mailimap_flag_list*flist; 909 mailimap_flag_list*flist;
910 mailimap_set *set; 910 mailimap_set *set;
@@ -914,14 +914,14 @@ void IMAPwrapper::answeredMail(const RecMail&mail)
914 if (!m_imap) { 914 if (!m_imap) {
915 return; 915 return;
916 } 916 }
917 err = selectMbox(mail.getMbox()); 917 err = selectMbox(mail->getMbox());
918 if ( err != MAILIMAP_NO_ERROR ) { 918 if ( err != MAILIMAP_NO_ERROR ) {
919 return; 919 return;
920 } 920 }
921 flist = mailimap_flag_list_new_empty(); 921 flist = mailimap_flag_list_new_empty();
922 mailimap_flag_list_add(flist,mailimap_flag_new_answered()); 922 mailimap_flag_list_add(flist,mailimap_flag_new_answered());
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);
926 mailimap_set_free( set ); 926 mailimap_set_free( set );
927 mailimap_store_att_flags_free(store_flags); 927 mailimap_store_att_flags_free(store_flags);
@@ -932,7 +932,7 @@ void IMAPwrapper::answeredMail(const RecMail&mail)
932 } 932 }
933} 933}
934 934
935QString IMAPwrapper::fetchTextPart(const RecMail&mail,const QValueList<int>&path,bool internal_call,const QString&enc) 935QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc)
936{ 936{
937 QString body(""); 937 QString body("");
938 encodedString*res = fetchRawPart(mail,path,internal_call); 938 encodedString*res = fetchRawPart(mail,path,internal_call);
@@ -947,12 +947,12 @@ QString IMAPwrapper::fetchTextPart(const RecMail&mail,const QValueList<int>&path
947 return body; 947 return body;
948} 948}
949 949
950QString IMAPwrapper::fetchTextPart(const RecMail&mail,const RecPart&part) 950QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const RecPart&part)
951{ 951{
952 return fetchTextPart(mail,part.Positionlist(),false,part.Encoding()); 952 return fetchTextPart(mail,part.Positionlist(),false,part.Encoding());
953} 953}
954 954
955encodedString* IMAPwrapper::fetchDecodedPart(const RecMail&mail,const RecPart&part) 955encodedString* IMAPwrapper::fetchDecodedPart(const RecMailP&mail,const RecPart&part)
956{ 956{
957 encodedString*res = fetchRawPart(mail,part.Positionlist(),false); 957 encodedString*res = fetchRawPart(mail,part.Positionlist(),false);
958 encodedString*r = decode_String(res,part.Encoding()); 958 encodedString*r = decode_String(res,part.Encoding());
@@ -960,7 +960,7 @@ encodedString* IMAPwrapper::fetchDecodedPart(const RecMail&mail,const RecPart&pa
960 return r; 960 return r;
961} 961}
962 962
963encodedString* IMAPwrapper::fetchRawPart(const RecMail&mail,const RecPart&part) 963encodedString* IMAPwrapper::fetchRawPart(const RecMailP&mail,const RecPart&part)
964{ 964{
965 return fetchRawPart(mail,part.Positionlist(),false); 965 return fetchRawPart(mail,part.Positionlist(),false);
966} 966}
@@ -1055,7 +1055,6 @@ void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
1055 mailimap_mailbox_data_status * status=0; 1055 mailimap_mailbox_data_status * status=0;
1056 clistiter * cur = 0; 1056 clistiter * cur = 0;
1057 int r = 0; 1057 int r = 0;
1058 int res = 0;
1059 target_stat.message_count = 0; 1058 target_stat.message_count = 0;
1060 target_stat.message_unseen = 0; 1059 target_stat.message_unseen = 0;
1061 target_stat.message_recent = 0; 1060 target_stat.message_recent = 0;
@@ -1115,7 +1114,7 @@ const QString&IMAPwrapper::getName()const
1115 return account->getAccountName(); 1114 return account->getAccountName();
1116} 1115}
1117 1116
1118encodedString* IMAPwrapper::fetchRawBody(const RecMail&mail) 1117encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail)
1119{ 1118{
1120 // dummy 1119 // dummy
1121 QValueList<int> path; 1120 QValueList<int> path;
@@ -1154,7 +1153,7 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
1154 } 1153 }
1155} 1154}
1156 1155
1157void IMAPwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 1156void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
1158{ 1157{
1159 if (targetWrapper != this) { 1158 if (targetWrapper != this) {
1160 qDebug("Using generic"); 1159 qDebug("Using generic");
@@ -1166,11 +1165,11 @@ void IMAPwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,Abstrac
1166 if (!m_imap) { 1165 if (!m_imap) {
1167 return; 1166 return;
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 ) {
1171 return; 1170 return;
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());
1175 mailimap_set_free( set ); 1174 mailimap_set_free( set );
1176 if ( err != MAILIMAP_NO_ERROR ) { 1175 if ( err != MAILIMAP_NO_ERROR ) {
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
@@ -23,27 +23,27 @@ class IMAPwrapper : public AbstractMail
23public: 23public:
24 IMAPwrapper( IMAPaccount *a ); 24 IMAPwrapper( IMAPaccount *a );
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
48 static void imap_progress( size_t current, size_t maximum ); 48 static void imap_progress( size_t current, size_t maximum );
49 49
@@ -56,8 +56,8 @@ protected:
56 void login(); 56 void login();
57 bool start_tls(bool force=true); 57 bool start_tls(bool force=true);
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);
62 62
63 void fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description); 63 void fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description);
@@ -65,7 +65,7 @@ protected:
65 void fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which); 65 void fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which);
66 void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which); 66 void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which);
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
70 /* just helpers */ 70 /* just helpers */
71 static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which); 71 static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which);
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
@@ -2,13 +2,13 @@
2#include <stdlib.h> 2#include <stdlib.h>
3 3
4RecMail::RecMail() 4RecMail::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{
7 init(); 7 init();
8} 8}
9 9
10RecMail::RecMail(const RecMail&old) 10RecMail::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{
13 init(); 13 init();
14 copy_old(old); 14 copy_old(old);
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
@@ -8,6 +8,8 @@
8#define FLAG_DRAFT 4 8#define FLAG_DRAFT 4
9#define FLAG_RECENT 5 9#define FLAG_RECENT 5
10 10
11#include <opie2/osmartpointer.h>
12
11#include <qbitarray.h> 13#include <qbitarray.h>
12#include <qstring.h> 14#include <qstring.h>
13#include <qstringlist.h> 15#include <qstringlist.h>
@@ -27,15 +29,15 @@ class AbstractMail;
27 make a request to the mailwrapper with this class as parameter to 29 make a request to the mailwrapper with this class as parameter to
28 get the body. Same words for the attachments. 30 get the body. Same words for the attachments.
29*/ 31*/
30class RecMail 32class RecMail:public Opie::ORefCount
31{ 33{
32public: 34public:
33 RecMail(); 35 RecMail();
34 RecMail(const RecMail&old); 36 RecMail(const RecMail&old);
35 virtual ~RecMail(); 37 virtual ~RecMail();
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; }
40 void setDate( const QString&a ) { date = a; } 42 void setDate( const QString&a ) { date = a; }
41 const QString&getFrom()const{ return from; } 43 const QString&getFrom()const{ return from; }
@@ -48,8 +50,8 @@ public:
48 const QString&Msgid()const{return msg_id;} 50 const QString&Msgid()const{return msg_id;}
49 void setReplyto(const QString&reply){replyto=reply;} 51 void setReplyto(const QString&reply){replyto=reply;}
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
54 56
55 void setTo(const QStringList&list); 57 void setTo(const QStringList&list);
@@ -71,7 +73,7 @@ public:
71 73
72protected: 74protected:
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;
76 QStringList to,cc,bcc,in_reply_to,references; 78 QStringList to,cc,bcc,in_reply_to,references;
77 AbstractMail*wrapper; 79 AbstractMail*wrapper;
@@ -79,6 +81,7 @@ protected:
79 void copy_old(const RecMail&old); 81 void copy_old(const RecMail&old);
80}; 82};
81 83
84typedef Opie::OSmartPointer<RecMail> RecMailP;
82typedef QMap<QString,QString> part_plist_t; 85typedef QMap<QString,QString> part_plist_t;
83 86
84class RecPart 87class RecPart
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
@@ -155,7 +155,7 @@ QString IMAPFolder::decodeFolderName( const QString &name )
155} 155}
156 156
157Mail::Mail() 157Mail::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{
160} 160}
161 161
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
@@ -8,7 +8,7 @@
8 8
9#include "settings.h" 9#include "settings.h"
10 10
11#include <opie2/osmart_pointer.h> 11#include <opie2/osmartpointer.h>
12 12
13class Attachment 13class Attachment
14{ 14{
@@ -28,7 +28,7 @@ protected:
28 28
29}; 29};
30 30
31class Mail:public Opie::oref_count 31class Mail:public Opie::ORefCount
32{ 32{
33public: 33public:
34 Mail(); 34 Mail();
@@ -66,7 +66,7 @@ private:
66 QStringList m_in_reply_to; 66 QStringList m_in_reply_to;
67}; 67};
68 68
69class Folder:public Opie::oref_count 69class Folder:public Opie::ORefCount
70{ 70{
71public: 71public:
72 Folder( const QString&init_name,const QString&sep ); 72 Folder( const QString&init_name,const QString&sep );
@@ -82,7 +82,7 @@ protected:
82 QString nameDisplay, name, separator,prefix; 82 QString nameDisplay, name, separator,prefix;
83}; 83};
84 84
85typedef Opie::osmart_pointer<Folder> FolderP; 85typedef Opie::OSmartPointer<Folder> FolderP;
86 86
87class MHFolder : public Folder 87class MHFolder : public Folder
88{ 88{
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
@@ -19,7 +19,7 @@ MBOXwrapper::~MBOXwrapper()
19{ 19{
20} 20}
21 21
22void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) 22void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target )
23{ 23{
24 mailstorage*storage = mailstorage_new(NULL); 24 mailstorage*storage = mailstorage_new(NULL);
25 QString p = MBOXPath+"/"; 25 QString p = MBOXPath+"/";
@@ -44,9 +44,9 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target )
44 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); 44 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count()));
45} 45}
46 46
47QValueList<Opie::osmart_pointer<Folder> >* MBOXwrapper::listFolders() 47QValueList<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);
51 if (!dir.exists()) return folders; 51 if (!dir.exists()) return folders;
52 dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); 52 dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable);
@@ -59,11 +59,11 @@ QValueList<Opie::osmart_pointer<Folder> >* MBOXwrapper::listFolders()
59 return folders; 59 return folders;
60} 60}
61 61
62void MBOXwrapper::deleteMail(const RecMail&mail) 62void MBOXwrapper::deleteMail(const RecMailP & mail)
63{ 63{
64 mailstorage*storage = mailstorage_new(NULL); 64 mailstorage*storage = mailstorage_new(NULL);
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);
68 mailfolder*folder; 68 mailfolder*folder;
69 folder = mailfolder_new( storage,(char*)p.latin1(),NULL); 69 folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
@@ -74,7 +74,7 @@ void MBOXwrapper::deleteMail(const RecMail&mail)
74 mailstorage_free(storage); 74 mailstorage_free(storage);
75 return; 75 return;
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) {
79 qDebug("error deleting mail"); 79 qDebug("error deleting mail");
80 } 80 }
@@ -82,16 +82,16 @@ void MBOXwrapper::deleteMail(const RecMail&mail)
82 mailstorage_free(storage); 82 mailstorage_free(storage);
83} 83}
84 84
85void MBOXwrapper::answeredMail(const RecMail&) 85void MBOXwrapper::answeredMail(const RecMailP&)
86{ 86{
87} 87}
88 88
89RecBody MBOXwrapper::fetchBody( const RecMail &mail ) 89RecBody MBOXwrapper::fetchBody( const RecMailP &mail )
90{ 90{
91 RecBody body; 91 RecBody body;
92 mailstorage*storage = mailstorage_new(NULL); 92 mailstorage*storage = mailstorage_new(NULL);
93 QString p = MBOXPath+"/"; 93 QString p = MBOXPath+"/";
94 p+=mail.getMbox(); 94 p+=mail->getMbox();
95 mailmessage * msg; 95 mailmessage * msg;
96 char*data=0; 96 char*data=0;
97 size_t size; 97 size_t size;
@@ -106,16 +106,16 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail )
106 mailstorage_free(storage); 106 mailstorage_free(storage);
107 return body; 107 return body;
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);
113 mailstorage_free(storage); 113 mailstorage_free(storage);
114 return body; 114 return body;
115 } 115 }
116 r = mailmessage_fetch(msg,&data,&size); 116 r = mailmessage_fetch(msg,&data,&size);
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);
120 mailstorage_free(storage); 120 mailstorage_free(storage);
121 mailmessage_free(msg); 121 mailmessage_free(msg);
@@ -169,12 +169,12 @@ void MBOXwrapper::storeMessage(const char*msg,size_t length, const QString&folde
169 mailmbox_done(f); 169 mailmbox_done(f);
170} 170}
171 171
172encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) 172encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail)
173{ 173{
174 RecBody body; 174 RecBody body;
175 mailstorage*storage = mailstorage_new(NULL); 175 mailstorage*storage = mailstorage_new(NULL);
176 QString p = MBOXPath+"/"; 176 QString p = MBOXPath+"/";
177 p+=mail.getMbox(); 177 p+=mail->getMbox();
178 mailmessage * msg; 178 mailmessage * msg;
179 char*data=0; 179 char*data=0;
180 size_t size; 180 size_t size;
@@ -189,16 +189,16 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail)
189 mailstorage_free(storage); 189 mailstorage_free(storage);
190 return 0; 190 return 0;
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);
196 mailstorage_free(storage); 196 mailstorage_free(storage);
197 return 0; 197 return 0;
198 } 198 }
199 r = mailmessage_fetch(msg,&data,&size); 199 r = mailmessage_fetch(msg,&data,&size);
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);
203 mailstorage_free(storage); 203 mailstorage_free(storage);
204 mailmessage_free(msg); 204 mailmessage_free(msg);
@@ -212,7 +212,7 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail)
212 return result; 212 return result;
213} 213}
214 214
215void MBOXwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) 215void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target)
216{ 216{
217 QString p = MBOXPath+"/"; 217 QString p = MBOXPath+"/";
218 p+=mailbox; 218 p+=mailbox;
@@ -226,12 +226,13 @@ void MBOXwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target)
226 mailmbox_done(f); 226 mailmbox_done(f);
227} 227}
228 228
229void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target) 229void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target)
230{ 230{
231 if (!f) return; 231 if (!f) return;
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) {
236 qDebug("error delete mail"); 237 qDebug("error delete mail");
237 } 238 }
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
@@ -4,8 +4,6 @@
4#include "genericwrapper.h" 4#include "genericwrapper.h"
5#include <qstring.h> 5#include <qstring.h>
6 6
7class RecMail;
8class RecBody;
9class encodedString; 7class encodedString;
10struct mailmbox_folder; 8struct mailmbox_folder;
11 9
@@ -17,30 +15,30 @@ public:
17 MBOXwrapper(const QString & dir,const QString&name); 15 MBOXwrapper(const QString & dir,const QString&name);
18 virtual ~MBOXwrapper(); 16 virtual ~MBOXwrapper();
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
31 virtual void storeMessage(const char*msg,size_t length, const QString&folder); 29 virtual void storeMessage(const char*msg,size_t length, const QString&folder);
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;
40 virtual const QString&getName()const; 38 virtual const QString&getName()const;
41 39
42protected: 40protected:
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;
45 QString MBOXName; 43 QString MBOXName;
46}; 44};
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
@@ -60,7 +60,7 @@ MHwrapper::~MHwrapper()
60 clean_storage(); 60 clean_storage();
61} 61}
62 62
63void MHwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) 63void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::OSmartPointer<RecMail> > &target )
64{ 64{
65 init_storage(); 65 init_storage();
66 if (!m_storage) { 66 if (!m_storage) {
@@ -76,9 +76,9 @@ void MHwrapper::listMessages(const QString & mailbox, QList<RecMail> &target )
76 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); 76 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count()));
77} 77}
78 78
79QValueList<Opie::osmart_pointer<Folder> >* MHwrapper::listFolders() 79QValueList<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! */
83 if (m_storage) mailstorage_disconnect(m_storage); 83 if (m_storage) mailstorage_disconnect(m_storage);
84 init_storage(); 84 init_storage();
@@ -101,28 +101,28 @@ QValueList<Opie::osmart_pointer<Folder> >* MHwrapper::listFolders()
101 return folders; 101 return folders;
102} 102}
103 103
104void MHwrapper::deleteMail(const RecMail&mail) 104void MHwrapper::deleteMail(const RecMailP&mail)
105{ 105{
106 init_storage(); 106 init_storage();
107 if (!m_storage) { 107 if (!m_storage) {
108 return; 108 return;
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) {
112 qDebug("error selecting folder!"); 112 qDebug("error selecting folder!");
113 return; 113 return;
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) {
117 qDebug("error deleting mail"); 117 qDebug("error deleting mail");
118 } 118 }
119} 119}
120 120
121void MHwrapper::answeredMail(const RecMail&) 121void MHwrapper::answeredMail(const RecMailP&)
122{ 122{
123} 123}
124 124
125RecBody MHwrapper::fetchBody( const RecMail &mail ) 125RecBody MHwrapper::fetchBody( const RecMailP &mail )
126{ 126{
127 RecBody body; 127 RecBody body;
128 init_storage(); 128 init_storage();
@@ -131,16 +131,15 @@ RecBody MHwrapper::fetchBody( const RecMail &mail )
131 } 131 }
132 mailmessage * msg; 132 mailmessage * msg;
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) {
139 return body; 138 return body;
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;
145 } 144 }
146 body = parseMail(msg); 145 body = parseMail(msg);
@@ -212,7 +211,7 @@ void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder)
212 return; 211 return;
213} 212}
214 213
215encodedString* MHwrapper::fetchRawBody(const RecMail&mail) 214encodedString* MHwrapper::fetchRawBody(const RecMailP&mail)
216{ 215{
217 encodedString*result = 0; 216 encodedString*result = 0;
218 init_storage(); 217 init_storage();
@@ -222,19 +221,19 @@ encodedString* MHwrapper::fetchRawBody(const RecMail&mail)
222 mailmessage * msg = 0; 221 mailmessage * msg = 0;
223 char*data=0; 222 char*data=0;
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) {
227 qDebug("error selecting folder!"); 226 qDebug("error selecting folder!");
228 return result; 227 return result;
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;
234 } 233 }
235 r = mailmessage_fetch(msg,&data,&size); 234 r = mailmessage_fetch(msg,&data,&size);
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);
239 return 0; 238 return 0;
240 } 239 }
@@ -243,7 +242,7 @@ encodedString* MHwrapper::fetchRawBody(const RecMail&mail)
243 return result; 242 return result;
244} 243}
245 244
246void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) 245void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target)
247{ 246{
248 QString f = buildPath(mailbox); 247 QString f = buildPath(mailbox);
249 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 248 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
@@ -251,10 +250,9 @@ void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target)
251 qDebug("deleteMails: error selecting folder!"); 250 qDebug("deleteMails: error selecting folder!");
252 return; 251 return;
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) {
259 qDebug("error deleting mail"); 257 qDebug("error deleting mail");
260 break; 258 break;
@@ -372,7 +370,7 @@ const QString&MHwrapper::getName()const
372{ 370{
373 return MHName; 371 return MHName;
374} 372}
375void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 373void MHwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
376{ 374{
377 init_storage(); 375 init_storage();
378 if (!m_storage) { 376 if (!m_storage) {
@@ -385,15 +383,15 @@ void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractM
385 } 383 }
386 qDebug("Using internal routines for move/copy"); 384 qDebug("Using internal routines for move/copy");
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) {
390 qDebug("Error selecting source mailbox"); 388 qDebug("Error selecting source mailbox");
391 return; 389 return;
392 } 390 }
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 }
398 if (r != MAIL_NO_ERROR) { 396 if (r != MAIL_NO_ERROR) {
399 qDebug("Error copy/moving mail internal (%i)",r); 397 qDebug("Error copy/moving mail internal (%i)",r);
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
@@ -6,8 +6,6 @@
6#include "genericwrapper.h" 6#include "genericwrapper.h"
7#include <qstring.h> 7#include <qstring.h>
8 8
9class RecMail;
10class RecBody;
11class encodedString; 9class encodedString;
12struct mailmbox_folder; 10struct mailmbox_folder;
13class OProcess; 11class OProcess;
@@ -19,28 +17,28 @@ public:
19 MHwrapper(const QString & dir,const QString&name); 17 MHwrapper(const QString & dir,const QString&name);
20 virtual ~MHwrapper(); 18 virtual ~MHwrapper();
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
36 virtual void storeMessage(const char*msg,size_t length, const QString&folder); 34 virtual void storeMessage(const char*msg,size_t length, const QString&folder);
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;
45 virtual const QString&getName()const; 43 virtual const QString&getName()const;
46 44
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
@@ -32,7 +32,7 @@ void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) {
32} 32}
33 33
34 34
35RecBody NNTPwrapper::fetchBody( const RecMail &mail ) { 35RecBody NNTPwrapper::fetchBody( const RecMailP &mail ) {
36 int err = NEWSNNTP_NO_ERROR; 36 int err = NEWSNNTP_NO_ERROR;
37 char *message = 0; 37 char *message = 0;
38 size_t length = 0; 38 size_t length = 0;
@@ -44,8 +44,8 @@ RecBody NNTPwrapper::fetchBody( const RecMail &mail ) {
44 44
45 RecBody body; 45 RecBody body;
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;
50 } 50 }
51 51
@@ -53,13 +53,13 @@ RecBody NNTPwrapper::fetchBody( const RecMail &mail ) {
53 53
54 cleanMimeCache(); 54 cleanMimeCache();
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()) {
58 msg_cache.remove(); 58 msg_cache.remove();
59 } 59 }
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);
64 msg_cache.writeBlock(message,length); 64 msg_cache.writeBlock(message,length);
65 } else { 65 } else {
@@ -96,7 +96,7 @@ RecBody NNTPwrapper::fetchBody( const RecMail &mail ) {
96} 96}
97 97
98 98
99void NNTPwrapper::listMessages(const QString & which, QList<RecMail> &target ) 99void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::OSmartPointer<RecMail> > &target )
100{ 100{
101 login(); 101 login();
102 if (!m_nntp) 102 if (!m_nntp)
@@ -188,9 +188,9 @@ void NNTPwrapper::logout()
188 m_nntp = 0; 188 m_nntp = 0;
189} 189}
190 190
191QValueList<Opie::osmart_pointer<Folder> >* NNTPwrapper::listFolders() { 191QValueList<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;
195 if (account) { 195 if (account) {
196 groups = account->getGroups(); 196 groups = account->getGroups();
@@ -239,7 +239,7 @@ QStringList NNTPwrapper::listAllNewsgroups(const QString&mask) {
239 return res; 239 return res;
240} 240}
241 241
242void NNTPwrapper::answeredMail(const RecMail&) {} 242void NNTPwrapper::answeredMail(const RecMailP&) {}
243 243
244void NNTPwrapper::statusFolder(folderStat&target_stat,const QString&) { 244void NNTPwrapper::statusFolder(folderStat&target_stat,const QString&) {
245 login(); 245 login();
@@ -253,12 +253,12 @@ void NNTPwrapper::statusFolder(folderStat&target_stat,const QString&) {
253} 253}
254 254
255 255
256encodedString* NNTPwrapper::fetchRawBody(const RecMail&mail) { 256encodedString* NNTPwrapper::fetchRawBody(const RecMailP&mail) {
257 char*target=0; 257 char*target=0;
258 size_t length=0; 258 size_t length=0;
259 encodedString*res = 0; 259 encodedString*res = 0;
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);
263 if (mailmsg) 263 if (mailmsg)
264 mailmessage_free(mailmsg); 264 mailmessage_free(mailmsg);
@@ -276,7 +276,7 @@ const QString&NNTPwrapper::getName()const{
276 return account->getAccountName(); 276 return account->getAccountName();
277} 277}
278 278
279void NNTPwrapper::deleteMail(const RecMail&) { 279void NNTPwrapper::deleteMail(const RecMailP&) {
280} 280}
281 281
282int NNTPwrapper::deleteAllMail(const FolderP&) { 282int NNTPwrapper::deleteAllMail(const FolderP&) {
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
@@ -20,18 +20,18 @@ public:
20 virtual ~NNTPwrapper(); 20 virtual ~NNTPwrapper();
21 21
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 */
27 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 27 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
28 QStringList listAllNewsgroups(const QString&mask = QString::null); 28 QStringList listAllNewsgroups(const QString&mask = QString::null);
29 virtual void deleteMail(const RecMail&mail); 29 virtual void deleteMail(const 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();
36 virtual MAILLIB::ATYPE getType()const; 36 virtual MAILLIB::ATYPE getType()const;
37 virtual const QString&getName()const; 37 virtual const QString&getName()const;
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
@@ -30,7 +30,7 @@ void POP3wrapper::pop3_progress( size_t current, size_t maximum ) {
30 qDebug( "POP3: %i of %i", current, maximum ); 30 qDebug( "POP3: %i of %i", current, maximum );
31} 31}
32 32
33RecBody POP3wrapper::fetchBody( const RecMail &mail ) { 33RecBody POP3wrapper::fetchBody( const RecMailP &mail ) {
34 int err = MAILPOP3_NO_ERROR; 34 int err = MAILPOP3_NO_ERROR;
35 char *message = 0; 35 char *message = 0;
36 size_t length = 0; 36 size_t length = 0;
@@ -42,8 +42,8 @@ RecBody POP3wrapper::fetchBody( const RecMail &mail ) {
42 42
43 RecBody body; 43 RecBody body;
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;
48 } 48 }
49 49
@@ -51,13 +51,13 @@ RecBody POP3wrapper::fetchBody( const RecMail &mail ) {
51 51
52 cleanMimeCache(); 52 cleanMimeCache();
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()) {
56 msg_cache.remove(); 56 msg_cache.remove();
57 } 57 }
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);
62 msg_cache.writeBlock(message,length); 62 msg_cache.writeBlock(message,length);
63 } else { 63 } else {
@@ -93,7 +93,7 @@ RecBody POP3wrapper::fetchBody( const RecMail &mail ) {
93 return body; 93 return body;
94} 94}
95 95
96void POP3wrapper::listMessages(const QString &, QList<RecMail> &target ) 96void POP3wrapper::listMessages(const QString &, QValueList<Opie::OSmartPointer<RecMail> > &target )
97{ 97{
98 login(); 98 login();
99 if (!m_pop3) 99 if (!m_pop3)
@@ -169,7 +169,6 @@ void POP3wrapper::login()
169 169
170void POP3wrapper::logout() 170void POP3wrapper::logout()
171{ 171{
172 int err = MAILPOP3_NO_ERROR;
173 if ( m_pop3 == NULL ) 172 if ( m_pop3 == NULL )
174 return; 173 return;
175 mailstorage_free(m_pop3); 174 mailstorage_free(m_pop3);
@@ -177,24 +176,24 @@ void POP3wrapper::logout()
177} 176}
178 177
179 178
180QValueList<Opie::osmart_pointer<Folder> >* POP3wrapper::listFolders() { 179QValueList<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","/");
183 folders->append(inb); 182 folders->append(inb);
184 return folders; 183 return folders;
185} 184}
186 185
187void POP3wrapper::deleteMail(const RecMail&mail) { 186void POP3wrapper::deleteMail(const RecMailP&mail) {
188 login(); 187 login();
189 if (!m_pop3) 188 if (!m_pop3)
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) {
193 Global::statusMessage(tr("error deleting mail")); 192 Global::statusMessage(tr("error deleting mail"));
194 } 193 }
195} 194}
196 195
197void POP3wrapper::answeredMail(const RecMail&) {} 196void POP3wrapper::answeredMail(const RecMailP&) {}
198 197
199int POP3wrapper::deleteAllMail(const FolderP&) { 198int POP3wrapper::deleteAllMail(const FolderP&) {
200 login(); 199 login();
@@ -228,14 +227,17 @@ void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) {
228 return; 227 return;
229 int r = mailsession_status_folder(m_pop3->sto_session,0,&target_stat.message_count, 228 int r = mailsession_status_folder(m_pop3->sto_session,0,&target_stat.message_count,
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
233encodedString* POP3wrapper::fetchRawBody(const RecMail&mail) { 235encodedString* POP3wrapper::fetchRawBody(const RecMailP&mail) {
234 char*target=0; 236 char*target=0;
235 size_t length=0; 237 size_t length=0;
236 encodedString*res = 0; 238 encodedString*res = 0;
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);
240 if (mailmsg) 242 if (mailmsg)
241 mailmessage_free(mailmsg); 243 mailmessage_free(mailmsg);
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
@@ -17,17 +17,17 @@ public:
17 POP3wrapper( POP3account *a ); 17 POP3wrapper( POP3account *a );
18 virtual ~POP3wrapper(); 18 virtual ~POP3wrapper();
19 /* mailbox will be ignored */ 19 /* mailbox will be ignored */
20 virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); 20 virtual void listMessages(const QString & mailbox, 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 */
23 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 23 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
24 24
25 virtual void deleteMail(const RecMail&mail); 25 virtual void deleteMail(const 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();
32 virtual MAILLIB::ATYPE getType()const; 32 virtual MAILLIB::ATYPE getType()const;
33 virtual const QString&getName()const; 33 virtual const QString&getName()const;
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
@@ -312,7 +312,7 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size )
312 return result; 312 return result;
313} 313}
314 314
315void SMTPwrapper::sendMail(const Opie::osmart_pointer<Mail>&mail,bool later ) 315void SMTPwrapper::sendMail(const Opie::OSmartPointer<Mail>&mail,bool later )
316{ 316{
317 mailmime * mimeMail; 317 mailmime * mimeMail;
318 318
@@ -332,7 +332,7 @@ void SMTPwrapper::sendMail(const Opie::osmart_pointer<Mail>&mail,bool later )
332 } 332 }
333} 333}
334 334
335int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,RecMail*which) { 335int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,const RecMailP&which) {
336 size_t curTok = 0; 336 size_t curTok = 0;
337 mailimf_fields *fields = 0; 337 mailimf_fields *fields = 0;
338 mailimf_field*ffrom = 0; 338 mailimf_field*ffrom = 0;
@@ -340,7 +340,7 @@ int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,RecMail*which) {
340 char*from = 0; 340 char*from = 0;
341 int res = 0; 341 int res = 0;
342 342
343 encodedString * data = wrap->fetchRawBody(*which); 343 encodedString * data = wrap->fetchRawBody(which);
344 if (!data) 344 if (!data)
345 return 0; 345 return 0;
346 int err = mailimf_fields_parse( data->Content(), data->Length(), &curTok, &fields ); 346 int err = mailimf_fields_parse( data->Content(), data->Length(), &curTok, &fields );
@@ -391,8 +391,8 @@ bool SMTPwrapper::flushOutbox() {
391 return false; 391 return false;
392 } 392 }
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");
397 wrap->listMessages(mbox,mailsToSend); 397 wrap->listMessages(mbox,mailsToSend);
398 if (mailsToSend.count()==0) { 398 if (mailsToSend.count()==0) {
@@ -421,20 +421,19 @@ bool SMTPwrapper::flushOutbox() {
421 } 421 }
422 422
423 423
424 mailsToSend.setAutoDelete(false);
425 sendProgress = new progressMailSend(); 424 sendProgress = new progressMailSend();
426 sendProgress->show(); 425 sendProgress->show();
427 sendProgress->setMaxMails(mailsToSend.count()); 426 sendProgress->setMaxMails(mailsToSend.count());
428 427
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"),
432 tr("Error sending queued mail - breaking")); 431 tr("Error sending queued mail - breaking"));
433 returnValue = false; 432 returnValue = false;
434 break; 433 break;
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());
439 } 438 }
440 if (reset_user_value) { 439 if (reset_user_value) {
@@ -450,7 +449,6 @@ bool SMTPwrapper::flushOutbox() {
450 delete sendProgress; 449 delete sendProgress;
451 sendProgress = 0; 450 sendProgress = 0;
452 wrap->deleteMails(mbox,mailsToRemove); 451 wrap->deleteMails(mbox,mailsToRemove);
453 mailsToSend.setAutoDelete(true);
454 delete wrap; 452 delete wrap;
455 return returnValue; 453 return returnValue;
456} 454}
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
@@ -11,7 +11,7 @@
11#include "settings.h" 11#include "settings.h"
12#include "generatemail.h" 12#include "generatemail.h"
13 13
14#include <opie2/osmart_pointer.h> 14#include <opie2/osmartpointer.h>
15 15
16class SMTPaccount; 16class SMTPaccount;
17class AbstractMail; 17class AbstractMail;
@@ -23,7 +23,7 @@ class SMTPwrapper : public Generatemail
23public: 23public:
24 SMTPwrapper(SMTPaccount * aSmtp); 24 SMTPwrapper(SMTPaccount * aSmtp);
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();
28 28
29 static progressMailSend*sendProgress; 29 static progressMailSend*sendProgress;
@@ -50,7 +50,7 @@ protected:
50 50
51 void storeMail(mailmime*mail, const QString&box); 51 void storeMail(mailmime*mail, const QString&box);
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);
55 55
56 int m_queuedMail; 56 int m_queuedMail;
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
@@ -49,7 +49,7 @@ Storemail::~Storemail()
49{ 49{
50} 50}
51 51
52int Storemail::storeMail(const Opie::osmart_pointer<Mail>&mail) 52int Storemail::storeMail(const Opie::OSmartPointer<Mail>&mail)
53{ 53{
54 if (!wrapper) return 0; 54 if (!wrapper) return 0;
55 int ret = 1; 55 int ret = 1;
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
@@ -18,7 +18,7 @@ public:
18 Storemail(const QString&aFolder); 18 Storemail(const QString&aFolder);
19 virtual ~Storemail(); 19 virtual ~Storemail();
20 20
21 int storeMail(const Opie::osmart_pointer<Mail>&mail); 21 int storeMail(const Opie::OSmartPointer<Mail>&mail);
22 22
23protected: 23protected:
24 Account* m_Account; 24 Account* m_Account;
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
@@ -10,16 +10,16 @@ MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item )
10 10
11void MailListViewItem::showEntry() 11void 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
17 replied or new - Alwin*/ 17 replied or new - Alwin*/
18 //setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); 18 //setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") );
19 } else { 19 } else {
20 setPixmap( 0, Resource::loadPixmap( "mail/kmmsgnew") ); 20 setPixmap( 0, Resource::loadPixmap( "mail/kmmsgnew") );
21 } 21 }
22 double s = mail_data.Msgsize(); 22 double s = mail_data->Msgsize();
23 int w; 23 int w;
24 w=0; 24 w=0;
25 25
@@ -49,24 +49,24 @@ void MailListViewItem::showEntry()
49 o << s << " " << q << "Byte"; 49 o << s << " " << q << "Byte";
50 } 50 }
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
58void MailListViewItem::storeData(const RecMail&data) 58void MailListViewItem::storeData(const RecMailP&data)
59{ 59{
60 mail_data = data; 60 mail_data = data;
61} 61}
62 62
63const RecMail& MailListViewItem::data()const 63const RecMailP& MailListViewItem::data()const
64{ 64{
65 return mail_data; 65 return mail_data;
66} 66}
67 67
68MAILLIB::ATYPE MailListViewItem::wrapperType() 68MAILLIB::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
@@ -11,13 +11,13 @@ public:
11 MailListViewItem(QListView * parent, MailListViewItem * after ); 11 MailListViewItem(QListView * parent, MailListViewItem * after );
12 virtual ~MailListViewItem(){} 12 virtual ~MailListViewItem(){}
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();
17 MAILLIB::ATYPE wrapperType(); 17 MAILLIB::ATYPE wrapperType();
18 18
19protected: 19protected:
20 RecMail mail_data; 20 RecMailP mail_data;
21}; 21};
22 22
23#endif 23#endif
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
@@ -119,7 +119,8 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
119 SLOT( mailLeftClicked(int,QListViewItem*,const QPoint&,int) ) ); 119 SLOT( mailLeftClicked(int,QListViewItem*,const QPoint&,int) ) );
120 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, 120 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
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() ) );
124 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 125 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
125// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 126// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
@@ -177,7 +178,7 @@ void MainWindow::slotShowFolders( bool )
177 qDebug( "slotShowFolders not reached" ); 178 qDebug( "slotShowFolders not reached" );
178} 179}
179 180
180void MainWindow::refreshMailView(QList<RecMail>*) 181void MainWindow::refreshMailView(const QValueList<RecMailP>&)
181{ 182{
182 qDebug( "refreshMailView not reached" ); 183 qDebug( "refreshMailView not reached" );
183} 184}
@@ -205,7 +206,7 @@ void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int )
205void MainWindow::slotSendQueued() 206void MainWindow::slotSendQueued()
206{ 207{
207} 208}
208 209
209void MainWindow::slotEditAccounts() 210void MainWindow::slotEditAccounts()
210{ 211{
211} 212}
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
@@ -11,6 +11,9 @@
11#include "accountview.h" 11#include "accountview.h"
12#include "statuswidget.h" 12#include "statuswidget.h"
13 13
14#include <libmailwrapper/mailtypes.h>
15#include <opie2/osmartpointer.h>
16
14class RecMail; 17class RecMail;
15 18
16class MainWindow : public QMainWindow 19class MainWindow : public QMainWindow
@@ -25,25 +28,25 @@ public slots:
25 virtual void slotAdjustColumns(); 28 virtual void slotAdjustColumns();
26 virtual void appMessage(const QCString &msg, const QByteArray &data); 29 virtual void appMessage(const QCString &msg, const QByteArray &data);
27 virtual void slotComposeMail(); 30 virtual void slotComposeMail();
28 31
29protected slots: 32protected slots:
30 virtual void slotSendQueued(); 33 virtual void slotSendQueued();
31 virtual void slotEditAccounts(); 34 virtual void slotEditAccounts();
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();
35 virtual void slotDeleteMail(); 38 virtual void slotDeleteMail();
36 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 39 virtual void mailHold(int, QListViewItem *,const QPoint&,int);
37 virtual void slotAdjustLayout(); 40 virtual void slotAdjustLayout();
38 virtual void slotEditSettings(); 41 virtual void slotEditSettings();
39 virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); 42 virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int );
40 43
41protected: 44protected:
42 QToolBar *toolBar; 45 QToolBar *toolBar;
43 StatusWidget *statusWidget; 46 StatusWidget *statusWidget;
44 QMenuBar *menuBar; 47 QMenuBar *menuBar;
45 QPopupMenu *mailMenu, *settingsMenu; 48 QPopupMenu *mailMenu, *settingsMenu;
46 QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, 49 QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails,
47 *editSettings, *editAccounts, *syncFolders; 50 *editSettings, *editAccounts, *syncFolders;
48 AccountView *folderView; 51 AccountView *folderView;
49 QListView *mailView; 52 QListView *mailView;
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
@@ -145,7 +145,7 @@ void OpieMail::displayMail()
145{ 145{
146 QListViewItem*item = mailView->currentItem(); 146 QListViewItem*item = mailView->currentItem();
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);
150 ViewMail readMail( this,"", Qt::WType_Modal | WStyle_ContextHelp ); 150 ViewMail readMail( this,"", Qt::WType_Modal | WStyle_ContextHelp );
151 readMail.setBody( body ); 151 readMail.setBody( body );
@@ -166,10 +166,10 @@ void OpieMail::displayMail()
166void OpieMail::slotDeleteMail() 166void OpieMail::slotDeleteMail()
167{ 167{
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();
174 } 174 }
175} 175}
@@ -217,14 +217,16 @@ void OpieMail::slotShowFolders( bool show )
217 } 217 }
218} 218}
219 219
220void OpieMail::refreshMailView(QList<RecMail>*list) 220void OpieMail::refreshMailView(const QValueList<RecMailP>&list)
221{ 221{
222 MailListViewItem*item = 0; 222 MailListViewItem*item = 0;
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();
229 } 231 }
230} 232}
@@ -244,7 +246,7 @@ void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int
244void OpieMail::slotMoveCopyMail() 246void OpieMail::slotMoveCopyMail()
245{ 247{
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;
249 QString targetFolder = ""; 251 QString targetFolder = "";
250 Selectstore sels; 252 Selectstore sels;
@@ -252,7 +254,7 @@ void OpieMail::slotMoveCopyMail()
252 if (!sels.exec()) return; 254 if (!sels.exec()) return;
253 targetMail = sels.currentMail(); 255 targetMail = sels.currentMail();
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())
257 { 259 {
258 return; 260 return;
@@ -263,14 +265,14 @@ void OpieMail::slotMoveCopyMail()
263 tr("<center>Error while creating<br>new folder - breaking.</center>")); 265 tr("<center>Error while creating<br>new folder - breaking.</center>"));
264 return; 266 return;
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();
268} 270}
269 271
270void OpieMail::reEditMail() 272void OpieMail::reEditMail()
271{ 273{
272 if (!mailView->currentItem()) return; 274 if (!mailView->currentItem()) return;
273 275
274 ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); 276 ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp );
275 compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); 277 compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data());
276 compose.slotAdjustColumns(); 278 compose.slotAdjustColumns();
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
@@ -4,6 +4,8 @@
4#include "mainwindow.h" 4#include "mainwindow.h"
5#include <libmailwrapper/settings.h> 5#include <libmailwrapper/settings.h>
6 6
7#include <opie2/osmartpointer.h>
8#include <libmailwrapper/mailtypes.h>
7 9
8class OpieMail : public MainWindow 10class OpieMail : public MainWindow
9{ 11{
@@ -27,7 +29,7 @@ protected slots:
27 virtual void slotDeleteMail(); 29 virtual void slotDeleteMail();
28 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 30 virtual void mailHold(int, QListViewItem *,const QPoint&,int);
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 );
32 virtual void slotMoveCopyMail(); 34 virtual void slotMoveCopyMail();
33 virtual void reEditMail(); 35 virtual void reEditMail();
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
@@ -225,7 +225,7 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
225 225
226 if( !str.isEmpty() ) 226 if( !str.isEmpty() )
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)
230 { 230 {
231 QFile output(str); 231 QFile output(str);
@@ -245,9 +245,9 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
245 } 245 }
246 else 246 else
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 }
252 } 252 }
253 break; 253 break;
@@ -256,19 +256,19 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
256} 256}
257 257
258 258
259void ViewMail::setMail( RecMail mail ) 259void ViewMail::setMail( RecMailP mail )
260{ 260{
261 261
262 m_recMail = mail; 262 m_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
273 setText(); 273 setText();
274} 274}
@@ -348,7 +348,7 @@ void ViewMail::setText()
348 348
349ViewMail::~ViewMail() 349ViewMail::~ViewMail()
350{ 350{
351 m_recMail.Wrapper()->cleanMimeCache(); 351 m_recMail->Wrapper()->cleanMimeCache();
352 hide(); 352 hide();
353} 353}
354 354
@@ -415,18 +415,18 @@ void ViewMail::slotReply()
415 415
416 Settings *settings = new Settings(); 416 Settings *settings = new Settings();
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 }
423 composer.setSubject( prefix + m_mail[1] ); 423 composer.setSubject( prefix + m_mail[1] );
424 composer.setMessage( rtext ); 424 composer.setMessage( rtext );
425 composer.setInReplyTo(m_recMail.Msgid()); 425 composer.setInReplyTo(m_recMail->Msgid());
426 426
427 if ( QDialog::Accepted == QPEApplication::execDialog( &composer ) ) 427 if ( QDialog::Accepted == QPEApplication::execDialog( &composer ) )
428 { 428 {
429 m_recMail.Wrapper()->answeredMail(m_recMail); 429 m_recMail->Wrapper()->answeredMail(m_recMail);
430 } 430 }
431} 431}
432 432
@@ -469,7 +469,7 @@ void ViewMail::slotDeleteMail( )
469{ 469{
470 if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 470 if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
471 { 471 {
472 m_recMail.Wrapper()->deleteMail( m_recMail ); 472 m_recMail->Wrapper()->deleteMail( m_recMail );
473 hide(); 473 hide();
474 deleted = true; 474 deleted = true;
475 } 475 }
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
@@ -28,40 +28,40 @@ private:
28 28
29class ViewMail : public ViewMailBase 29class ViewMail : public ViewMailBase
30{ 30{
31 Q_OBJECT 31 Q_OBJECT
32 32
33public: 33public:
34 ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = 0); 34 ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
35 ~ViewMail(); 35 ~ViewMail();
36 36
37 void hide(); 37 void hide();
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 );
41 bool deleted; 41 bool deleted;
42 42
43protected: 43protected:
44 QString deHtml(const QString &string); 44 QString deHtml(const QString &string);
45 AttachItem* searchParent(const QValueList<int>&path); 45 AttachItem* searchParent(const QValueList<int>&path);
46 AttachItem* lastChild(AttachItem*parent); 46 AttachItem* lastChild(AttachItem*parent);
47 47
48protected slots: 48protected slots:
49 void slotReply(); 49 void slotReply();
50 void slotForward(); 50 void slotForward();
51 void setText(); 51 void setText();
52 void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); 52 void slotItemClicked( QListViewItem * item , const QPoint & point, int c );
53 void slotDeleteMail( ); 53 void slotDeleteMail( );
54 void slotShowHtml( bool ); 54 void slotShowHtml( bool );
55 55
56private: 56private:
57 void readConfig(); 57 void readConfig();
58 58
59 bool _inLoop; 59 bool _inLoop;
60 QString m_mailHtml; 60 QString m_mailHtml;
61 bool m_gotBody; 61 bool m_gotBody;
62 RecBody m_body; 62 RecBody m_body;
63 RecMail m_recMail; 63 RecMailP m_recMail;
64 bool m_showHtml; 64 bool m_showHtml;
65 65
66 // 0 from 1 subject 2 bodytext 3 date 66 // 0 from 1 subject 2 bodytext 3 date
67 QMap <int,QString> m_mail; 67 QMap <int,QString> m_mail;