summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/abstractmail.cpp
Unidiff
Diffstat (limited to 'kmicromail/libmailwrapper/abstractmail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/abstractmail.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp
index 128a7c0..3998abd 100644
--- a/kmicromail/libmailwrapper/abstractmail.cpp
+++ b/kmicromail/libmailwrapper/abstractmail.cpp
@@ -1,6 +1,7 @@
1// CHANGED 2004-09-31 Lutz Rogowski
1#include "abstractmail.h" 2#include "abstractmail.h"
2#include "imapwrapper.h" 3#include "imapwrapper.h"
3#include "pop3wrapper.h" 4#include "pop3wrapper.h"
4#include "nntpwrapper.h" 5#include "nntpwrapper.h"
5#include "mhwrapper.h" 6#include "mhwrapper.h"
6#include "mailtypes.h" 7#include "mailtypes.h"
@@ -134,30 +135,44 @@ QString AbstractMail::draftFolder()
134} 135}
135 136
136/* temporary - will be removed when implemented in all classes */ 137/* temporary - will be removed when implemented in all classes */
137void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &) 138void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &)
138{ 139{
139} 140}
141void AbstractMail::deleteMailList(const QValueList<RecMailP>&target)
142{
143 qDebug("AbstractMail::deleteMailList:: Please reimplement! ");
140 144
145}
141void AbstractMail::mvcpAllMails(const FolderP&fromFolder, 146void AbstractMail::mvcpAllMails(const FolderP&fromFolder,
142 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 147 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb)
143{ 148{
144 QValueList<RecMailP> t; 149 QValueList<RecMailP> t;
145 listMessages(fromFolder->getName(),t); 150 listMessages(fromFolder->getName(),t, maxSizeInKb);
151 mvcpMailList( t,targetFolder,targetWrapper,moveit);
152
153}
154void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t,
155 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
156{
157
146 encodedString*st = 0; 158 encodedString*st = 0;
147 while (t.count()>0) { 159 int iii = 0;
148 RecMailP r = (*t.begin()); 160 int count = t.count();
161 while (iii < count ) {
162 RecMailP r = (*t.at( iii ));
149 st = fetchRawBody(r); 163 st = fetchRawBody(r);
150 if (st) { 164 if (st) {
151 targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); 165 targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder);
152 delete st; 166 delete st;
153 } 167 }
154 t.remove(t.begin()); 168 ++iii;
155 } 169 }
156 if (moveit) { 170 if (moveit) {
157 deleteAllMail(fromFolder); 171 deleteMailList( t );
172 //deleteAllMail(fromFolder);
158 } 173 }
159} 174}
160 175
161void AbstractMail::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 176void AbstractMail::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
162{ 177{
163 encodedString*st = 0; 178 encodedString*st = 0;