author | alwin <alwin> | 2004-03-12 14:12:00 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-12 14:12:00 (UTC) |
commit | d1929ef43f0eaaa17aa42196384d1ed925132873 (patch) (unidiff) | |
tree | eff911f93fe7919d7820e5a2e68b72f2f76143da /noncore | |
parent | d38384a6edb0110117e0297864f813b379d52789 (diff) | |
download | opie-d1929ef43f0eaaa17aa42196384d1ed925132873.zip opie-d1929ef43f0eaaa17aa42196384d1ed925132873.tar.gz opie-d1929ef43f0eaaa17aa42196384d1ed925132873.tar.bz2 |
some pointers embedded into osmart_pointer handling
21 files changed, 152 insertions, 134 deletions
diff --git a/noncore/net/mail/accountitem.cpp b/noncore/net/mail/accountitem.cpp index 396dcb7..3e12563 100644 --- a/noncore/net/mail/accountitem.cpp +++ b/noncore/net/mail/accountitem.cpp | |||
@@ -58,5 +58,5 @@ void POP3viewItem::refresh() | |||
58 | { | 58 | { |
59 | if (account->getOffline()) return; | 59 | if (account->getOffline()) return; |
60 | QList<Folder> *folders = wrapper->listFolders(); | 60 | QValueList<FolderP> *folders = wrapper->listFolders(); |
61 | QListViewItem *child = firstChild(); | 61 | QListViewItem *child = firstChild(); |
62 | while ( child ) | 62 | while ( child ) |
@@ -66,13 +66,11 @@ void POP3viewItem::refresh() | |||
66 | delete tmp; | 66 | delete tmp; |
67 | } | 67 | } |
68 | Folder *it; | 68 | QValueList<FolderP>::ConstIterator it; |
69 | QListViewItem*item = 0; | 69 | QListViewItem*item = 0; |
70 | for ( it = folders->first(); it; it = folders->next() ) | 70 | for ( it = folders->begin(); it!=folders->end(); ++it) |
71 | { | 71 | { |
72 | item = new POP3folderItem( it, this , item ); | 72 | item = new POP3folderItem( (*it), this , item ); |
73 | item->setSelectable(it->may_select()); | 73 | item->setSelectable( (*it)->may_select()); |
74 | } | 74 | } |
75 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
76 | folders->setAutoDelete(false); | ||
77 | delete folders; | 75 | delete folders; |
78 | } | 76 | } |
@@ -142,8 +140,7 @@ POP3folderItem::~POP3folderItem() | |||
142 | {} | 140 | {} |
143 | 141 | ||
144 | POP3folderItem::POP3folderItem( Folder *folderInit, POP3viewItem *parent , QListViewItem*after ) | 142 | POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) |
145 | : AccountViewItem( parent,after ) | 143 | : AccountViewItem(folderInit,parent,after ) |
146 | { | 144 | { |
147 | folder = folderInit; | ||
148 | pop3 = parent; | 145 | pop3 = parent; |
149 | if (folder->getDisplayName().lower()!="inbox") | 146 | if (folder->getDisplayName().lower()!="inbox") |
@@ -251,5 +248,6 @@ void NNTPviewItem::refresh() | |||
251 | { | 248 | { |
252 | if (account->getOffline()) return; | 249 | if (account->getOffline()) return; |
253 | QList<Folder> *folders = wrapper->listFolders(); | 250 | QValueList<FolderP> *folders = wrapper->listFolders(); |
251 | |||
254 | QListViewItem *child = firstChild(); | 252 | QListViewItem *child = firstChild(); |
255 | while ( child ) | 253 | while ( child ) |
@@ -259,13 +257,11 @@ void NNTPviewItem::refresh() | |||
259 | delete tmp; | 257 | delete tmp; |
260 | } | 258 | } |
261 | Folder *it; | 259 | QValueList<FolderP>::ConstIterator it; |
262 | QListViewItem*item = 0; | 260 | QListViewItem*item = 0; |
263 | for ( it = folders->first(); it; it = folders->next() ) | 261 | for ( it = folders->begin(); it!=folders->end(); ++it) |
264 | { | 262 | { |
265 | item = new NNTPfolderItem( it, this , item ); | 263 | item = new NNTPfolderItem( (*it), this , item ); |
266 | item->setSelectable(it->may_select()); | 264 | item->setSelectable( (*it)->may_select()); |
267 | } | 265 | } |
268 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
269 | folders->setAutoDelete(false); | ||
270 | delete folders; | 266 | delete folders; |
271 | } | 267 | } |
@@ -348,8 +344,7 @@ NNTPfolderItem::~NNTPfolderItem() | |||
348 | {} | 344 | {} |
349 | 345 | ||
350 | NNTPfolderItem::NNTPfolderItem( Folder *folderInit, NNTPviewItem *parent , QListViewItem*after ) | 346 | NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent , QListViewItem*after ) |
351 | : AccountViewItem( parent,after ) | 347 | : AccountViewItem( folderInit, parent,after ) |
352 | { | 348 | { |
353 | folder = folderInit; | ||
354 | nntp = parent; | 349 | nntp = parent; |
355 | if (folder->getDisplayName().lower()!="inbox") | 350 | if (folder->getDisplayName().lower()!="inbox") |
@@ -451,19 +446,17 @@ void IMAPviewItem::refreshFolders(bool force) | |||
451 | removeChilds(); | 446 | removeChilds(); |
452 | currentFolders.clear(); | 447 | currentFolders.clear(); |
453 | QList<Folder> *folders = wrapper->listFolders(); | 448 | QValueList<FolderP> * folders = wrapper->listFolders(); |
454 | 449 | ||
455 | Folder *it; | 450 | QValueList<FolderP>::Iterator it; |
456 | QListViewItem*item = 0; | 451 | QListViewItem*item = 0; |
457 | QListViewItem*titem = 0; | 452 | QListViewItem*titem = 0; |
458 | QString fname,del,search; | 453 | QString fname,del,search; |
459 | int pos; | 454 | int pos; |
460 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
461 | folders->setAutoDelete(false); | ||
462 | 455 | ||
463 | for ( it = folders->first(); it; it = folders->next() ) | 456 | for ( it = folders->begin(); it!=folders->end(); ++it) |
464 | { | 457 | { |
465 | if (it->getDisplayName().lower()=="inbox") | 458 | if ((*it)->getDisplayName().lower()=="inbox") |
466 | { | 459 | { |
467 | item = new IMAPfolderItem( it, this , item ); | 460 | item = new IMAPfolderItem( (*it), this , item ); |
468 | folders->remove(it); | 461 | folders->remove(it); |
469 | qDebug("inbox found"); | 462 | qDebug("inbox found"); |
@@ -471,9 +464,9 @@ void IMAPviewItem::refreshFolders(bool force) | |||
471 | } | 464 | } |
472 | } | 465 | } |
473 | for ( it = folders->first(); it; it = folders->next() ) | 466 | for ( it = folders->begin(); it!=folders->end(); ++it) |
474 | { | 467 | { |
475 | fname = it->getDisplayName(); | 468 | fname = (*it)->getDisplayName(); |
476 | currentFolders.append(it->getName()); | 469 | currentFolders.append((*it)->getName()); |
477 | pos = fname.findRev(it->Separator()); | 470 | pos = fname.findRev((*it)->Separator()); |
478 | if (pos != -1) | 471 | if (pos != -1) |
479 | { | 472 | { |
@@ -484,12 +477,12 @@ void IMAPviewItem::refreshFolders(bool force) | |||
484 | { | 477 | { |
485 | titem = item; | 478 | titem = item; |
486 | item = new IMAPfolderItem(it,pitem,pitem->firstChild(),this); | 479 | item = new IMAPfolderItem( (*it),pitem,pitem->firstChild(),this); |
487 | /* setup the short name */ | 480 | /* setup the short name */ |
488 | item->setText(0,it->getDisplayName().right(it->getDisplayName().length()-pos-1)); | 481 | item->setText(0,(*it)->getDisplayName().right((*it)->getDisplayName().length()-pos-1)); |
489 | item = titem; | 482 | item = titem; |
490 | } | 483 | } |
491 | else | 484 | else |
492 | { | 485 | { |
493 | item = new IMAPfolderItem( it, this , item ); | 486 | item = new IMAPfolderItem( (*it), this , item ); |
494 | } | 487 | } |
495 | } | 488 | } |
@@ -579,8 +572,7 @@ bool IMAPviewItem::offline() | |||
579 | } | 572 | } |
580 | 573 | ||
581 | IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent , QListViewItem*after ) | 574 | IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , QListViewItem*after ) |
582 | : AccountViewItem( parent , after ) | 575 | : AccountViewItem( folderInit, parent , after ) |
583 | { | 576 | { |
584 | folder = folderInit; | ||
585 | imap = parent; | 577 | imap = parent; |
586 | if (folder->getDisplayName().lower()!="inbox") | 578 | if (folder->getDisplayName().lower()!="inbox") |
@@ -595,8 +587,7 @@ IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent , QList | |||
595 | } | 587 | } |
596 | 588 | ||
597 | IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ) | 589 | IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ) |
598 | : AccountViewItem( parent,after ) | 590 | : AccountViewItem(folderInit, parent,after ) |
599 | { | 591 | { |
600 | folder = folderInit; | ||
601 | imap = master; | 592 | imap = master; |
602 | if (folder->getDisplayName().lower()!="inbox") | 593 | if (folder->getDisplayName().lower()!="inbox") |
@@ -769,18 +760,18 @@ void MHviewItem::refresh(bool force) | |||
769 | removeChilds(); | 760 | removeChilds(); |
770 | currentFolders.clear(); | 761 | currentFolders.clear(); |
771 | QList<Folder> *folders = wrapper->listFolders(); | 762 | QValueList<FolderP> *folders = wrapper->listFolders(); |
772 | Folder *it; | 763 | QValueList<FolderP>::ConstIterator it; |
773 | MHfolderItem*item = 0; | 764 | MHfolderItem*item = 0; |
774 | MHfolderItem*pmaster = 0; | 765 | MHfolderItem*pmaster = 0; |
775 | QString fname = ""; | 766 | QString fname = ""; |
776 | int pos; | 767 | int pos; |
777 | for ( it = folders->first(); it; it = folders->next() ) | 768 | for ( it = folders->begin(); it!=folders->end(); ++it) |
778 | { | 769 | { |
779 | fname = it->getDisplayName(); | 770 | fname = (*it)->getDisplayName(); |
780 | /* this folder itself */ | 771 | /* this folder itself */ |
781 | if (fname=="/") | 772 | if (fname=="/") |
782 | { | 773 | { |
783 | currentFolders.append(fname); | 774 | currentFolders.append(fname); |
784 | folder = it; | 775 | folder = (*it); |
785 | continue; | 776 | continue; |
786 | } | 777 | } |
@@ -798,14 +789,12 @@ void MHviewItem::refresh(bool force) | |||
798 | if (pmaster) | 789 | if (pmaster) |
799 | { | 790 | { |
800 | item = new MHfolderItem( it, pmaster, item, this ); | 791 | item = new MHfolderItem( (*it), pmaster, item, this ); |
801 | } | 792 | } |
802 | else | 793 | else |
803 | { | 794 | { |
804 | item = new MHfolderItem( it, this , item ); | 795 | item = new MHfolderItem( (*it), this , item ); |
805 | } | 796 | } |
806 | item->setSelectable(it->may_select()); | 797 | item->setSelectable((*it)->may_select()); |
807 | } | 798 | } |
808 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
809 | folders->setAutoDelete(false); | ||
810 | delete folders; | 799 | delete folders; |
811 | } | 800 | } |
@@ -879,14 +868,13 @@ MHfolderItem::~MHfolderItem() | |||
879 | {} | 868 | {} |
880 | 869 | ||
881 | MHfolderItem::MHfolderItem( Folder *folderInit, MHviewItem *parent , QListViewItem*after ) | 870 | MHfolderItem::MHfolderItem( const FolderP &folderInit, MHviewItem *parent , QListViewItem*after ) |
882 | : AccountViewItem( parent,after ) | 871 | : AccountViewItem(folderInit, parent,after ) |
883 | { | 872 | { |
884 | folder = folderInit; | ||
885 | mbox = parent; | 873 | mbox = parent; |
886 | initName(); | 874 | initName(); |
887 | } | 875 | } |
888 | 876 | ||
889 | MHfolderItem::MHfolderItem( Folder *folderInit, MHfolderItem *parent, QListViewItem*after, MHviewItem*master) | 877 | MHfolderItem::MHfolderItem(const FolderP& folderInit, MHfolderItem *parent, QListViewItem*after, MHviewItem*master) |
890 | : AccountViewItem( parent,after ) | 878 | : AccountViewItem(folderInit, parent,after ) |
891 | { | 879 | { |
892 | folder = folderInit; | 880 | folder = folderInit; |
@@ -922,5 +910,5 @@ void MHfolderItem::initName() | |||
922 | } | 910 | } |
923 | 911 | ||
924 | Folder*MHfolderItem::getFolder() | 912 | const FolderP&MHfolderItem::getFolder()const |
925 | { | 913 | { |
926 | return folder; | 914 | return folder; |
@@ -1044,5 +1032,5 @@ AccountViewItem::AccountViewItem( AccountView *parent ) | |||
1044 | 1032 | ||
1045 | AccountViewItem::AccountViewItem( QListViewItem *parent) | 1033 | AccountViewItem::AccountViewItem( QListViewItem *parent) |
1046 | : QListViewItem( parent) | 1034 | : QListViewItem( parent),folder(0) |
1047 | { | 1035 | { |
1048 | init(); | 1036 | init(); |
@@ -1050,5 +1038,11 @@ AccountViewItem::AccountViewItem( QListViewItem *parent) | |||
1050 | 1038 | ||
1051 | AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after ) | 1039 | AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after ) |
1052 | :QListViewItem( parent,after ) | 1040 | :QListViewItem( parent,after ),folder(0) |
1041 | { | ||
1042 | init(); | ||
1043 | } | ||
1044 | |||
1045 | AccountViewItem::AccountViewItem( const Opie::osmart_pointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ) | ||
1046 | :QListViewItem( parent,after ),folder(folderInit) | ||
1053 | { | 1047 | { |
1054 | init(); | 1048 | init(); |
@@ -1058,10 +1052,9 @@ void AccountViewItem::init() | |||
1058 | { | 1052 | { |
1059 | m_Backlink = 0; | 1053 | m_Backlink = 0; |
1060 | folder = 0; | ||
1061 | } | 1054 | } |
1062 | 1055 | ||
1063 | AccountViewItem::~AccountViewItem() | 1056 | AccountViewItem::~AccountViewItem() |
1064 | { | 1057 | { |
1065 | if (folder) delete folder; | 1058 | folder = 0; |
1066 | } | 1059 | } |
1067 | 1060 | ||
@@ -1071,5 +1064,5 @@ AccountView*AccountViewItem::accountView() | |||
1071 | } | 1064 | } |
1072 | 1065 | ||
1073 | void AccountViewItem::deleteAllMail(AbstractMail*wrapper,Folder*folder) | 1066 | void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder) |
1074 | { | 1067 | { |
1075 | if (!wrapper) return; | 1068 | if (!wrapper) return; |
diff --git a/noncore/net/mail/accountitem.h b/noncore/net/mail/accountitem.h index eb3baa3..8f712f5 100644 --- a/noncore/net/mail/accountitem.h +++ b/noncore/net/mail/accountitem.h | |||
@@ -4,4 +4,5 @@ | |||
4 | #include <qlistview.h> | 4 | #include <qlistview.h> |
5 | #include <qlist.h> | 5 | #include <qlist.h> |
6 | #include <opie2/osmart_pointer.h> | ||
6 | 7 | ||
7 | class POP3wrapper; | 8 | class POP3wrapper; |
@@ -24,4 +25,6 @@ public: | |||
24 | AccountViewItem( QListViewItem *parent); | 25 | AccountViewItem( QListViewItem *parent); |
25 | AccountViewItem( QListViewItem *parent , QListViewItem*after ); | 26 | AccountViewItem( QListViewItem *parent , QListViewItem*after ); |
27 | AccountViewItem( const Opie::osmart_pointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ); | ||
28 | |||
26 | virtual ~AccountViewItem(); | 29 | virtual ~AccountViewItem(); |
27 | virtual void refresh(QList<RecMail>&)=0; | 30 | virtual void refresh(QList<RecMail>&)=0; |
@@ -37,8 +40,8 @@ protected: | |||
37 | virtual void init(); | 40 | virtual void init(); |
38 | virtual void removeChilds(); | 41 | virtual void removeChilds(); |
39 | virtual void deleteAllMail(AbstractMail*wrapper,Folder*f); | 42 | virtual void deleteAllMail(AbstractMail*wrapper,const Opie::osmart_pointer<Folder>&f); |
40 | static const QString contextName; | 43 | static const QString contextName; |
41 | AccountView*m_Backlink; | 44 | AccountView*m_Backlink; |
42 | Folder *folder; | 45 | Opie::osmart_pointer<Folder> folder; |
43 | }; | 46 | }; |
44 | 47 | ||
@@ -67,5 +70,5 @@ class POP3folderItem : public AccountViewItem | |||
67 | 70 | ||
68 | public: | 71 | public: |
69 | POP3folderItem( Folder *folder, POP3viewItem *parent , QListViewItem*after ); | 72 | POP3folderItem( const Opie::osmart_pointer<Folder>&folder, POP3viewItem *parent , QListViewItem*after ); |
70 | virtual ~POP3folderItem(); | 73 | virtual ~POP3folderItem(); |
71 | virtual void refresh(QList<RecMail>&); | 74 | virtual void refresh(QList<RecMail>&); |
@@ -105,5 +108,5 @@ class NNTPfolderItem : public AccountViewItem | |||
105 | 108 | ||
106 | public: | 109 | public: |
107 | NNTPfolderItem( Folder *folder, NNTPviewItem *parent , QListViewItem*after ); | 110 | NNTPfolderItem(const Opie::osmart_pointer<Folder>&folder, NNTPviewItem *parent , QListViewItem*after ); |
108 | virtual ~NNTPfolderItem(); | 111 | virtual ~NNTPfolderItem(); |
109 | virtual void refresh(QList<RecMail>&); | 112 | virtual void refresh(QList<RecMail>&); |
@@ -145,6 +148,6 @@ class IMAPfolderItem : public AccountViewItem | |||
145 | 148 | ||
146 | public: | 149 | public: |
147 | IMAPfolderItem( Folder *folder, IMAPviewItem *parent , QListViewItem*after ); | 150 | IMAPfolderItem( const Opie::osmart_pointer<Folder>&folder, IMAPviewItem *parent , QListViewItem*after ); |
148 | IMAPfolderItem( Folder *folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); | 151 | IMAPfolderItem( const Opie::osmart_pointer<Folder>&folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); |
149 | virtual ~IMAPfolderItem(); | 152 | virtual ~IMAPfolderItem(); |
150 | virtual void refresh(QList<RecMail>&); | 153 | virtual void refresh(QList<RecMail>&); |
@@ -187,6 +190,6 @@ class MHfolderItem : public AccountViewItem | |||
187 | 190 | ||
188 | public: | 191 | public: |
189 | MHfolderItem( Folder *folder, MHviewItem *parent , QListViewItem*after ); | 192 | MHfolderItem( const Opie::osmart_pointer<Folder>&folder, MHviewItem *parent , QListViewItem*after ); |
190 | MHfolderItem( Folder *folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master); | 193 | MHfolderItem( const Opie::osmart_pointer<Folder>&folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master); |
191 | virtual ~MHfolderItem(); | 194 | virtual ~MHfolderItem(); |
192 | virtual void refresh(QList<RecMail>&); | 195 | virtual void refresh(QList<RecMail>&); |
@@ -194,5 +197,5 @@ public: | |||
194 | virtual QPopupMenu * getContextMenu(); | 197 | virtual QPopupMenu * getContextMenu(); |
195 | virtual void contextMenuSelected(int); | 198 | virtual void contextMenuSelected(int); |
196 | virtual Folder*getFolder(); | 199 | virtual const Opie::osmart_pointer<Folder>&getFolder()const; |
197 | virtual bool isDraftfolder(); | 200 | virtual bool isDraftfolder(); |
198 | 201 | ||
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index 7938d4f..297f553 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -144,5 +144,5 @@ void AccountView::setupFolderselect(Selectstore*sels) | |||
144 | } | 144 | } |
145 | 145 | ||
146 | void AccountView::downloadMails(Folder*fromFolder,AbstractMail*fromWrapper) | 146 | void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper) |
147 | { | 147 | { |
148 | AbstractMail*targetMail = 0; | 148 | AbstractMail*targetMail = 0; |
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h index 5000202..3478c0b 100644 --- a/noncore/net/mail/accountview.h +++ b/noncore/net/mail/accountview.h | |||
@@ -4,4 +4,5 @@ | |||
4 | #include <qlistview.h> | 4 | #include <qlistview.h> |
5 | #include <qlist.h> | 5 | #include <qlist.h> |
6 | #include <opie2/osmart_pointer.h> | ||
6 | 7 | ||
7 | class Selectstore; | 8 | class Selectstore; |
@@ -23,5 +24,5 @@ public: | |||
23 | virtual void populate( QList<Account> list ); | 24 | virtual void populate( QList<Account> list ); |
24 | virtual RecBody fetchBody(const RecMail&aMail); | 25 | virtual RecBody fetchBody(const RecMail&aMail); |
25 | virtual void downloadMails(Folder*fromFolder,AbstractMail*fromWrapper); | 26 | virtual void downloadMails(const Opie::osmart_pointer<Folder>&fromFolder,AbstractMail*fromWrapper); |
26 | virtual bool currentisDraft(); | 27 | virtual bool currentisDraft(); |
27 | 28 | ||
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index ac6f380..7e6d383 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp | |||
@@ -112,5 +112,5 @@ QString AbstractMail::gen_attachment_id() | |||
112 | } | 112 | } |
113 | 113 | ||
114 | int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool) | 114 | int AbstractMail::createMbox(const QString&,const FolderP&,const QString& delemiter,bool) |
115 | { | 115 | { |
116 | return 0; | 116 | return 0; |
@@ -134,5 +134,6 @@ void AbstractMail::deleteMails(const QString &,QList<RecMail> &) | |||
134 | } | 134 | } |
135 | 135 | ||
136 | void AbstractMail::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 136 | void AbstractMail::mvcpAllMails(const FolderP&fromFolder, |
137 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | ||
137 | { | 138 | { |
138 | QList<RecMail> t; | 139 | QList<RecMail> t; |
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h index d377452..d911468 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.h +++ b/noncore/net/mail/libmailwrapper/abstractmail.h | |||
@@ -4,7 +4,9 @@ | |||
4 | #include "maildefines.h" | 4 | #include "maildefines.h" |
5 | 5 | ||
6 | #include <qobject.h> | ||
7 | #include "settings.h" | 6 | #include "settings.h" |
8 | 7 | ||
8 | #include <qobject.h> | ||
9 | #include <opie2/osmart_pointer.h> | ||
10 | |||
9 | class RecMail; | 11 | class RecMail; |
10 | class RecBody; | 12 | class RecBody; |
@@ -22,5 +24,5 @@ public: | |||
22 | AbstractMail(){}; | 24 | AbstractMail(){}; |
23 | virtual ~AbstractMail(){} | 25 | virtual ~AbstractMail(){} |
24 | virtual QList<Folder>* listFolders()=0; | 26 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders()=0; |
25 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; | 27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; |
26 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; | 28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; |
@@ -33,10 +35,11 @@ public: | |||
33 | virtual void deleteMail(const RecMail&mail)=0; | 35 | virtual void deleteMail(const RecMail&mail)=0; |
34 | virtual void answeredMail(const RecMail&mail)=0; | 36 | virtual void answeredMail(const RecMail&mail)=0; |
35 | virtual int deleteAllMail(const Folder*)=0; | 37 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&)=0; |
36 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); | 38 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); |
37 | virtual int deleteMbox(const Folder*)=0; | 39 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&)=0; |
38 | virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; | 40 | virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; |
39 | 41 | ||
40 | virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 42 | virtual void mvcpAllMails(const Opie::osmart_pointer<Folder>&fromFolder, |
43 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | ||
41 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 44 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
42 | 45 | ||
@@ -47,5 +50,6 @@ public: | |||
47 | * them has to be appended automatic. | 50 | * them has to be appended automatic. |
48 | */ | 51 | */ |
49 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); | 52 | virtual int createMbox(const QString&,const Opie::osmart_pointer<Folder>&parentfolder=0, |
53 | const QString& delemiter="/",bool getsubfolder=false); | ||
50 | virtual void logout()=0; | 54 | virtual void logout()=0; |
51 | 55 | ||
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.h b/noncore/net/mail/libmailwrapper/genericwrapper.h index b3cd4fe..d0db45a 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.h +++ b/noncore/net/mail/libmailwrapper/genericwrapper.h | |||
@@ -39,5 +39,5 @@ public: | |||
39 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part); | 39 | virtual QString fetchTextPart(const RecMail&mail,const RecPart&part); |
40 | virtual void cleanMimeCache(); | 40 | virtual void cleanMimeCache(); |
41 | virtual int deleteMbox(const Folder*){return 1;} | 41 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&){return 1;} |
42 | virtual void logout(){}; | 42 | virtual void logout(){}; |
43 | virtual void storeMessage(const char*msg,size_t length, const QString&folder){}; | 43 | virtual void storeMessage(const char*msg,size_t length, const QString&folder){}; |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index e29a0a0..3b3be0f 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -267,5 +267,5 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
267 | } | 267 | } |
268 | 268 | ||
269 | QList<Folder>* IMAPwrapper::listFolders() | 269 | QValueList<Opie::osmart_pointer<Folder> >* IMAPwrapper::listFolders() |
270 | { | 270 | { |
271 | const char *path, *mask; | 271 | const char *path, *mask; |
@@ -276,6 +276,5 @@ QList<Folder>* IMAPwrapper::listFolders() | |||
276 | mailimap_mbx_list_flags*bflags = 0; | 276 | mailimap_mbx_list_flags*bflags = 0; |
277 | 277 | ||
278 | QList<Folder> * folders = new QList<Folder>(); | 278 | QValueList<FolderP>* folders = new QValueList<FolderP>(); |
279 | folders->setAutoDelete( false ); | ||
280 | login(); | 279 | login(); |
281 | if (!m_imap) { | 280 | if (!m_imap) { |
@@ -967,5 +966,5 @@ encodedString* IMAPwrapper::fetchRawPart(const RecMail&mail,const RecPart&part) | |||
967 | } | 966 | } |
968 | 967 | ||
969 | int IMAPwrapper::deleteAllMail(const Folder*folder) | 968 | int IMAPwrapper::deleteAllMail(const FolderP&folder) |
970 | { | 969 | { |
971 | login(); | 970 | login(); |
@@ -1008,5 +1007,5 @@ int IMAPwrapper::deleteAllMail(const Folder*folder) | |||
1008 | } | 1007 | } |
1009 | 1008 | ||
1010 | int IMAPwrapper::createMbox(const QString&folder,const Folder*parentfolder,const QString& delemiter,bool getsubfolder) | 1009 | int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder) |
1011 | { | 1010 | { |
1012 | if (folder.length()==0) return 0; | 1011 | if (folder.length()==0) return 0; |
@@ -1038,5 +1037,5 @@ int IMAPwrapper::createMbox(const QString&folder,const Folder*parentfolder,const | |||
1038 | } | 1037 | } |
1039 | 1038 | ||
1040 | int IMAPwrapper::deleteMbox(const Folder*folder) | 1039 | int IMAPwrapper::deleteMbox(const FolderP&folder) |
1041 | { | 1040 | { |
1042 | if (!folder) return 0; | 1041 | if (!folder) return 0; |
@@ -1124,5 +1123,6 @@ encodedString* IMAPwrapper::fetchRawBody(const RecMail&mail) | |||
1124 | } | 1123 | } |
1125 | 1124 | ||
1126 | void IMAPwrapper::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 1125 | void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, |
1126 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | ||
1127 | { | 1127 | { |
1128 | if (targetWrapper != this) { | 1128 | if (targetWrapper != this) { |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h index 2623725..15f049f 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.h +++ b/noncore/net/mail/libmailwrapper/imapwrapper.h | |||
@@ -24,5 +24,5 @@ public: | |||
24 | IMAPwrapper( IMAPaccount *a ); | 24 | IMAPwrapper( IMAPaccount *a ); |
25 | virtual ~IMAPwrapper(); | 25 | virtual ~IMAPwrapper(); |
26 | virtual QList<Folder>* listFolders(); | 26 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); |
27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); | 27 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); |
28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
@@ -30,7 +30,8 @@ public: | |||
30 | virtual void deleteMail(const RecMail&mail); | 30 | virtual void deleteMail(const RecMail&mail); |
31 | virtual void answeredMail(const RecMail&mail); | 31 | virtual void answeredMail(const RecMail&mail); |
32 | virtual int deleteAllMail(const Folder*folder); | 32 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&folder); |
33 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 33 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
34 | virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 34 | virtual void mvcpAllMails(const Opie::osmart_pointer<Folder>&fromFolder, |
35 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | ||
35 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 36 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
36 | 37 | ||
@@ -41,6 +42,7 @@ public: | |||
41 | virtual encodedString* fetchRawBody(const RecMail&mail); | 42 | virtual encodedString* fetchRawBody(const RecMail&mail); |
42 | 43 | ||
43 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); | 44 | virtual int createMbox(const QString&,const Opie::osmart_pointer<Folder>&parentfolder=0, |
44 | virtual int deleteMbox(const Folder*folder); | 45 | const QString& delemiter="/",bool getsubfolder=false); |
46 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&folder); | ||
45 | 47 | ||
46 | static void imap_progress( size_t current, size_t maximum ); | 48 | static void imap_progress( size_t current, size_t maximum ); |
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h index 17c6db9..10d367f 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.h +++ b/noncore/net/mail/libmailwrapper/mailtypes.h | |||
@@ -9,5 +9,4 @@ | |||
9 | #define FLAG_RECENT 5 | 9 | #define FLAG_RECENT 5 |
10 | 10 | ||
11 | #include <qlist.h> | ||
12 | #include <qbitarray.h> | 11 | #include <qbitarray.h> |
13 | #include <qstring.h> | 12 | #include <qstring.h> |
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp index 6bd98f6..c71d69f 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp | |||
@@ -36,4 +36,8 @@ Folder::Folder(const QString&tmp_name, const QString&sep ) | |||
36 | } | 36 | } |
37 | 37 | ||
38 | Folder::~Folder() | ||
39 | { | ||
40 | } | ||
41 | |||
38 | const QString& Folder::Separator()const | 42 | const QString& Folder::Separator()const |
39 | { | 43 | { |
@@ -58,4 +62,8 @@ IMAPFolder::IMAPFolder(const QString&name,const QString&sep, bool select,bool no | |||
58 | } | 62 | } |
59 | 63 | ||
64 | IMAPFolder::~IMAPFolder() | ||
65 | { | ||
66 | } | ||
67 | |||
60 | static unsigned char base64chars[] = | 68 | static unsigned char base64chars[] = |
61 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,"; | 69 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,"; |
@@ -165,2 +173,6 @@ MHFolder::MHFolder(const QString&disp_name,const QString&mbox) | |||
165 | prefix = mbox; | 173 | prefix = mbox; |
166 | } | 174 | } |
175 | |||
176 | MHFolder::~MHFolder() | ||
177 | { | ||
178 | } | ||
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.h b/noncore/net/mail/libmailwrapper/mailwrapper.h index c66572c..3b3bb32 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.h +++ b/noncore/net/mail/libmailwrapper/mailwrapper.h | |||
@@ -67,10 +67,9 @@ private: | |||
67 | }; | 67 | }; |
68 | 68 | ||
69 | class Folder : public QObject | 69 | class Folder:public Opie::oref_count |
70 | { | 70 | { |
71 | Q_OBJECT | ||
72 | |||
73 | public: | 71 | public: |
74 | Folder( const QString&init_name,const QString&sep ); | 72 | Folder( const QString&init_name,const QString&sep ); |
73 | virtual ~Folder(); | ||
75 | const QString&getDisplayName()const { return nameDisplay; } | 74 | const QString&getDisplayName()const { return nameDisplay; } |
76 | const QString&getName()const { return name; } | 75 | const QString&getName()const { return name; } |
@@ -84,9 +83,11 @@ protected: | |||
84 | }; | 83 | }; |
85 | 84 | ||
85 | typedef Opie::osmart_pointer<Folder> FolderP; | ||
86 | |||
86 | class MHFolder : public Folder | 87 | class MHFolder : public Folder |
87 | { | 88 | { |
88 | Q_OBJECT | ||
89 | public: | 89 | public: |
90 | MHFolder(const QString&disp_name,const QString&mbox); | 90 | MHFolder(const QString&disp_name,const QString&mbox); |
91 | virtual ~MHFolder(); | ||
91 | }; | 92 | }; |
92 | 93 | ||
@@ -95,4 +96,5 @@ class IMAPFolder : public Folder | |||
95 | public: | 96 | public: |
96 | IMAPFolder(const QString&name, const QString&sep, bool select=true,bool noinf=false,const QString&prefix="" ); | 97 | IMAPFolder(const QString&name, const QString&sep, bool select=true,bool noinf=false,const QString&prefix="" ); |
98 | virtual ~IMAPFolder(); | ||
97 | virtual bool may_select()const{return m_MaySelect;} | 99 | virtual bool may_select()const{return m_MaySelect;} |
98 | virtual bool no_inferior()const{return m_NoInferior;} | 100 | virtual bool no_inferior()const{return m_NoInferior;} |
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index abe4bb6..9ff3de2 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |||
@@ -45,8 +45,7 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
45 | } | 45 | } |
46 | 46 | ||
47 | QList<Folder>* MBOXwrapper::listFolders() | 47 | QValueList<Opie::osmart_pointer<Folder> >* MBOXwrapper::listFolders() |
48 | { | 48 | { |
49 | QList<Folder> * folders = new QList<Folder>(); | 49 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); |
50 | folders->setAutoDelete( false ); | ||
51 | QDir dir(MBOXPath); | 50 | QDir dir(MBOXPath); |
52 | if (!dir.exists()) return folders; | 51 | if (!dir.exists()) return folders; |
@@ -55,5 +54,5 @@ QList<Folder>* MBOXwrapper::listFolders() | |||
55 | QStringList::ConstIterator it = entries.begin(); | 54 | QStringList::ConstIterator it = entries.begin(); |
56 | for (;it!=entries.end();++it) { | 55 | for (;it!=entries.end();++it) { |
57 | Folder*inb=new Folder(*it,"/"); | 56 | FolderP inb=new Folder(*it,"/"); |
58 | folders->append(inb); | 57 | folders->append(inb); |
59 | } | 58 | } |
@@ -136,5 +135,5 @@ void MBOXwrapper::mbox_progress( size_t current, size_t maximum ) | |||
136 | } | 135 | } |
137 | 136 | ||
138 | int MBOXwrapper::createMbox(const QString&folder,const Folder*,const QString&,bool ) | 137 | int MBOXwrapper::createMbox(const QString&folder,const FolderP&,const QString&,bool ) |
139 | { | 138 | { |
140 | QString p = MBOXPath+"/"; | 139 | QString p = MBOXPath+"/"; |
@@ -244,5 +243,5 @@ void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target) | |||
244 | } | 243 | } |
245 | 244 | ||
246 | int MBOXwrapper::deleteAllMail(const Folder*tfolder) | 245 | int MBOXwrapper::deleteAllMail(const FolderP&tfolder) |
247 | { | 246 | { |
248 | if (!tfolder) return 0; | 247 | if (!tfolder) return 0; |
@@ -287,5 +286,5 @@ int MBOXwrapper::deleteAllMail(const Folder*tfolder) | |||
287 | } | 286 | } |
288 | 287 | ||
289 | int MBOXwrapper::deleteMbox(const Folder*tfolder) | 288 | int MBOXwrapper::deleteMbox(const FolderP&tfolder) |
290 | { | 289 | { |
291 | if (!tfolder) return 0; | 290 | if (!tfolder) return 0; |
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.h b/noncore/net/mail/libmailwrapper/mboxwrapper.h index 7e7f359..c3d9b50 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.h +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.h | |||
@@ -19,5 +19,5 @@ public: | |||
19 | 19 | ||
20 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 20 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
21 | virtual QList<Folder>* listFolders(); | 21 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); |
22 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 22 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
23 | 23 | ||
@@ -25,6 +25,7 @@ public: | |||
25 | virtual void answeredMail(const RecMail&mail); | 25 | virtual void answeredMail(const RecMail&mail); |
26 | 26 | ||
27 | virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); | 27 | virtual int createMbox(const QString&folder,const Opie::osmart_pointer<Folder>&f=0, |
28 | virtual int deleteMbox(const Folder*); | 28 | const QString&d="",bool s=false); |
29 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&); | ||
29 | 30 | ||
30 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 31 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
@@ -35,5 +36,5 @@ public: | |||
35 | virtual encodedString* fetchRawBody(const RecMail&mail); | 36 | virtual encodedString* fetchRawBody(const RecMail&mail); |
36 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); | 37 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); |
37 | virtual int deleteAllMail(const Folder*); | 38 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); |
38 | virtual MAILLIB::ATYPE getType()const; | 39 | virtual MAILLIB::ATYPE getType()const; |
39 | virtual const QString&getName()const; | 40 | virtual const QString&getName()const; |
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp index 560eab0..aaaa20a 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp | |||
@@ -77,8 +77,7 @@ void MHwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) | |||
77 | } | 77 | } |
78 | 78 | ||
79 | QList<Folder>* MHwrapper::listFolders() | 79 | QValueList<Opie::osmart_pointer<Folder> >* MHwrapper::listFolders() |
80 | { | 80 | { |
81 | QList<Folder> * folders = new QList<Folder>(); | 81 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); |
82 | folders->setAutoDelete( false ); | ||
83 | /* this is needed! */ | 82 | /* this is needed! */ |
84 | if (m_storage) mailstorage_disconnect(m_storage); | 83 | if (m_storage) mailstorage_disconnect(m_storage); |
@@ -170,5 +169,5 @@ QString MHwrapper::buildPath(const QString&p) | |||
170 | } | 169 | } |
171 | 170 | ||
172 | int MHwrapper::createMbox(const QString&folder,const Folder*pfolder,const QString&,bool ) | 171 | int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QString&,bool ) |
173 | { | 172 | { |
174 | init_storage(); | 173 | init_storage(); |
@@ -264,5 +263,5 @@ void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) | |||
264 | } | 263 | } |
265 | 264 | ||
266 | int MHwrapper::deleteAllMail(const Folder*tfolder) | 265 | int MHwrapper::deleteAllMail(const FolderP&tfolder) |
267 | { | 266 | { |
268 | init_storage(); | 267 | init_storage(); |
@@ -299,5 +298,5 @@ int MHwrapper::deleteAllMail(const Folder*tfolder) | |||
299 | } | 298 | } |
300 | 299 | ||
301 | int MHwrapper::deleteMbox(const Folder*tfolder) | 300 | int MHwrapper::deleteMbox(const FolderP&tfolder) |
302 | { | 301 | { |
303 | init_storage(); | 302 | init_storage(); |
@@ -402,5 +401,6 @@ void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractM | |||
402 | } | 401 | } |
403 | 402 | ||
404 | void MHwrapper::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 403 | void MHwrapper::mvcpAllMails(const FolderP&fromFolder, |
404 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | ||
405 | { | 405 | { |
406 | init_storage(); | 406 | init_storage(); |
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.h b/noncore/net/mail/libmailwrapper/mhwrapper.h index b7c23af..c7c8183 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.h +++ b/noncore/net/mail/libmailwrapper/mhwrapper.h | |||
@@ -21,5 +21,5 @@ public: | |||
21 | 21 | ||
22 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 22 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
23 | virtual QList<Folder>* listFolders(); | 23 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); |
24 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 24 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
25 | 25 | ||
@@ -27,8 +27,10 @@ public: | |||
27 | virtual void answeredMail(const RecMail&mail); | 27 | virtual void answeredMail(const RecMail&mail); |
28 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 28 | virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
29 | virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 29 | virtual void mvcpAllMails(const Opie::osmart_pointer<Folder>&fromFolder, |
30 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | ||
30 | 31 | ||
31 | virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); | 32 | virtual int createMbox(const QString&folder,const Opie::osmart_pointer<Folder>&f=0, |
32 | virtual int deleteMbox(const Folder*); | 33 | const QString&d="",bool s=false); |
34 | virtual int deleteMbox(const Opie::osmart_pointer<Folder>&); | ||
33 | 35 | ||
34 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 36 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
@@ -39,5 +41,5 @@ public: | |||
39 | virtual encodedString* fetchRawBody(const RecMail&mail); | 41 | virtual encodedString* fetchRawBody(const RecMail&mail); |
40 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); | 42 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); |
41 | virtual int deleteAllMail(const Folder*); | 43 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); |
42 | virtual MAILLIB::ATYPE getType()const; | 44 | virtual MAILLIB::ATYPE getType()const; |
43 | virtual const QString&getName()const; | 45 | virtual const QString&getName()const; |
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp index 1956c61..2ec052c 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp | |||
@@ -189,8 +189,7 @@ void NNTPwrapper::logout() | |||
189 | } | 189 | } |
190 | 190 | ||
191 | QList<Folder>* NNTPwrapper::listFolders() { | 191 | QValueList<Opie::osmart_pointer<Folder> >* NNTPwrapper::listFolders() { |
192 | 192 | ||
193 | QList<Folder> * folders = new QList<Folder>(); | 193 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); |
194 | folders->setAutoDelete( false ); | ||
195 | QStringList groups; | 194 | QStringList groups; |
196 | if (account) { | 195 | if (account) { |
@@ -281,4 +280,4 @@ void NNTPwrapper::deleteMail(const RecMail&) { | |||
281 | } | 280 | } |
282 | 281 | ||
283 | int NNTPwrapper::deleteAllMail(const Folder*) { | 282 | int NNTPwrapper::deleteAllMail(const FolderP&) { |
284 | } | 283 | } |
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.h b/noncore/net/mail/libmailwrapper/nntpwrapper.h index 955b9f1..d3a384a 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.h +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.h | |||
@@ -23,5 +23,5 @@ public: | |||
23 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 23 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
24 | /* should only get the subscribed one */ | 24 | /* should only get the subscribed one */ |
25 | virtual QList<Folder>* listFolders(); | 25 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); |
26 | /* mailbox will be ignored */ | 26 | /* mailbox will be ignored */ |
27 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 27 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
@@ -29,5 +29,5 @@ public: | |||
29 | virtual void deleteMail(const RecMail&mail); | 29 | virtual void deleteMail(const RecMail&mail); |
30 | virtual void answeredMail(const RecMail&mail); | 30 | virtual void answeredMail(const RecMail&mail); |
31 | virtual int deleteAllMail(const Folder*); | 31 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); |
32 | 32 | ||
33 | virtual RecBody fetchBody( const RecMail &mail ); | 33 | virtual RecBody fetchBody( const RecMail &mail ); |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 0939b22..7bf7ed2 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -178,8 +178,7 @@ void POP3wrapper::logout() | |||
178 | 178 | ||
179 | 179 | ||
180 | QList<Folder>* POP3wrapper::listFolders() { | 180 | QValueList<Opie::osmart_pointer<Folder> >* POP3wrapper::listFolders() { |
181 | QList<Folder> * folders = new QList<Folder>(); | 181 | QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<FolderP>(); |
182 | folders->setAutoDelete( false ); | 182 | FolderP inb=new Folder("INBOX","/"); |
183 | Folder*inb=new Folder("INBOX","/"); | ||
184 | folders->append(inb); | 183 | folders->append(inb); |
185 | return folders; | 184 | return folders; |
@@ -198,5 +197,5 @@ void POP3wrapper::deleteMail(const RecMail&mail) { | |||
198 | void POP3wrapper::answeredMail(const RecMail&) {} | 197 | void POP3wrapper::answeredMail(const RecMail&) {} |
199 | 198 | ||
200 | int POP3wrapper::deleteAllMail(const Folder*) { | 199 | int POP3wrapper::deleteAllMail(const FolderP&) { |
201 | login(); | 200 | login(); |
202 | if (!m_pop3) | 201 | if (!m_pop3) |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h index 391c841..e4afb94 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.h +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h | |||
@@ -19,5 +19,5 @@ public: | |||
19 | /* mailbox will be ignored */ | 19 | /* mailbox will be ignored */ |
20 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 20 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
21 | virtual QList<Folder>* listFolders(); | 21 | virtual QValueList<Opie::osmart_pointer<Folder> >* listFolders(); |
22 | /* mailbox will be ignored */ | 22 | /* mailbox will be ignored */ |
23 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 23 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
@@ -25,5 +25,5 @@ public: | |||
25 | virtual void deleteMail(const RecMail&mail); | 25 | virtual void deleteMail(const RecMail&mail); |
26 | virtual void answeredMail(const RecMail&mail); | 26 | virtual void answeredMail(const RecMail&mail); |
27 | virtual int deleteAllMail(const Folder*); | 27 | virtual int deleteAllMail(const Opie::osmart_pointer<Folder>&); |
28 | 28 | ||
29 | virtual RecBody fetchBody( const RecMail &mail ); | 29 | virtual RecBody fetchBody( const RecMail &mail ); |
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index aa8f37a..78652d7 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -134,4 +134,5 @@ void ViewMail::setBody( RecBody body ) | |||
134 | for (unsigned int i = 0; i < body.Parts().count();++i) | 134 | for (unsigned int i = 0; i < body.Parts().count();++i) |
135 | { | 135 | { |
136 | filename = ""; | ||
136 | type = body.Parts()[i].Type()+"/"+body.Parts()[i].Subtype(); | 137 | type = body.Parts()[i].Type()+"/"+body.Parts()[i].Subtype(); |
137 | part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin(); | 138 | part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin(); |