summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/abstractmail.cpp
Unidiff
Diffstat (limited to 'kmicromail/libmailwrapper/abstractmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/abstractmail.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp
index 870985e..746d2ae 100644
--- a/kmicromail/libmailwrapper/abstractmail.cpp
+++ b/kmicromail/libmailwrapper/abstractmail.cpp
@@ -8,13 +8,15 @@
8#include <qpe/global.h> 8#include <qpe/global.h>
9 9
10 10
11#include <qprogressbar.h> 11#include <q3progressbar.h>
12#include <qapplication.h> 12#include <qapplication.h>
13#include <qmessagebox.h> 13#include <qmessagebox.h>
14//Added by qt3to4:
15#include <Q3ValueList>
14#include <klocale.h> 16#include <klocale.h>
15#include <kdecore/kstandarddirs.h> 17#include <kdecore/kstandarddirs.h>
16#include <qfile.h> 18#include <qfile.h>
17#include <qtextstream.h> 19#include <q3textstream.h>
18#include <stdlib.h> 20#include <stdlib.h>
19#include <libetpan/mailmime_content.h> 21#include <libetpan/mailmime_content.h>
20#include <libetpan/mailmime.h> 22#include <libetpan/mailmime.h>
@@ -111,10 +113,10 @@ QString AbstractMail::convert_String(const char*text)
111QString AbstractMail::gen_attachment_id() 113QString AbstractMail::gen_attachment_id()
112{ 114{
113 QFile file( "/proc/sys/kernel/random/uuid" ); 115 QFile file( "/proc/sys/kernel/random/uuid" );
114 if (!file.open(IO_ReadOnly ) ) 116 if (!file.open(QIODevice::ReadOnly ) )
115 return QString::null; 117 return QString::null;
116 118
117 QTextStream stream(&file); 119 Q3TextStream stream(&file);
118 120
119 return "{" + stream.read().stripWhiteSpace() + "}"; 121 return "{" + stream.read().stripWhiteSpace() + "}";
120} 122}
@@ -138,16 +140,16 @@ QString AbstractMail::draftFolder()
138} 140}
139 141
140/* temporary - will be removed when implemented in all classes */ 142/* temporary - will be removed when implemented in all classes */
141void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &) 143void AbstractMail::deleteMails(const QString &,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &)
142{ 144{
143} 145}
144void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) 146void AbstractMail::deleteMailList(const Q3ValueList<RecMailP>&target)
145{ 147{
146 //qDebug("AbstractMail::deleteMailList:: Please reimplement! "); 148 //qDebug("AbstractMail::deleteMailList:: Please reimplement! ");
147 // this is currently re-implemented in pop3wrapper and imapwrapper 149 // this is currently re-implemented in pop3wrapper and imapwrapper
148 int iii = 0; 150 int iii = 0;
149 int count = target.count(); 151 int count = target.count();
150 QProgressBar wid ( count ); 152 Q3ProgressBar wid ( count );
151 wid.setCaption( i18n("Deleting ...")); 153 wid.setCaption( i18n("Deleting ..."));
152 wid.show(); 154 wid.show();
153 while (iii < count ) { 155 while (iii < count ) {
@@ -177,7 +179,7 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe
177 i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); 179 i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName));
178 return; 180 return;
179 } 181 }
180 QValueList<RecMailP> t; 182 Q3ValueList<RecMailP> t;
181 listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); 183 listMessages(fromFolder->getName(),t,acc->getMaxMailSize() );
182 if ( t.count() == 0 ) { 184 if ( t.count() == 0 ) {
183 qDebug("There are no new messages %s", fromFolder->getName().latin1()); 185 qDebug("There are no new messages %s", fromFolder->getName().latin1());
@@ -187,10 +189,10 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe
187 Global::statusMessage(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); 189 Global::statusMessage(i18n("%1 :Downloading mails..."). arg(acc->getAccountName()));
188 qDebug(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); 190 qDebug(i18n("%1 :Downloading mails..."). arg(acc->getAccountName()));
189 qApp->processEvents(); 191 qApp->processEvents();
190 QValueList<RecMailP> e; 192 Q3ValueList<RecMailP> e;
191 targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); 193 targetMail->listMessages(lfName,e,acc->getMaxMailSize() );
192 //qDebug("target has mails %d ", e.count()); 194 //qDebug("target has mails %d ", e.count());
193 QValueList<RecMailP> n; 195 Q3ValueList<RecMailP> n;
194 int iii = 0; 196 int iii = 0;
195 int count = t.count(); 197 int count = t.count();
196 while (iii < count ) { 198 while (iii < count ) {
@@ -221,7 +223,7 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe
221 Global::statusMessage(i18n("Downloaded %1 messages").arg(n.count())); 223 Global::statusMessage(i18n("Downloaded %1 messages").arg(n.count()));
222 224
223#if 0 225#if 0
224 QValueList<RecMailP> t; 226 Q3ValueList<RecMailP> t;
225 listMessages(fromFolder->getName(),t, maxSizeInKb); 227 listMessages(fromFolder->getName(),t, maxSizeInKb);
226 mvcpMailList( t,targetFolder,targetWrapper,moveit); 228 mvcpMailList( t,targetFolder,targetWrapper,moveit);
227#endif 229#endif
@@ -230,12 +232,12 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe
230void AbstractMail::mvcpAllMails(const FolderP&fromFolder, 232void AbstractMail::mvcpAllMails(const FolderP&fromFolder,
231 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) 233 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb)
232{ 234{
233 QValueList<RecMailP> t; 235 Q3ValueList<RecMailP> t;
234 listMessages(fromFolder->getName(),t, maxSizeInKb); 236 listMessages(fromFolder->getName(),t, maxSizeInKb);
235 mvcpMailList( t,targetFolder,targetWrapper,moveit); 237 mvcpMailList( t,targetFolder,targetWrapper,moveit);
236 238
237} 239}
238void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, 240void AbstractMail::mvcpMailList(const Q3ValueList<RecMailP>& t,
239 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 241 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
240{ 242{
241 encodedString*st = 0; 243 encodedString*st = 0;
@@ -246,7 +248,7 @@ void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t,
246 // wel, processevents is qite strange, we need a widget for getting 248 // wel, processevents is qite strange, we need a widget for getting
247 // Global::statusMessage(i18n("Copy2 message %1").arg(iii)); displaye 249 // Global::statusMessage(i18n("Copy2 message %1").arg(iii)); displaye
248 250
249 QProgressBar wid ( count ); 251 Q3ProgressBar wid ( count );
250 wid.setCaption( i18n("Copying...")); 252 wid.setCaption( i18n("Copying..."));
251 wid.show(); 253 wid.show();
252 while (iii < count ) { 254 while (iii < count ) {