author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kmicromail/libmailwrapper | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
25 files changed, 159 insertions, 115 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 | |||
@@ -5,19 +5,21 @@ | |||
5 | #include "nntpwrapper.h" | 5 | #include "nntpwrapper.h" |
6 | #include "mhwrapper.h" | 6 | #include "mhwrapper.h" |
7 | #include "mailtypes.h" | 7 | #include "mailtypes.h" |
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> |
21 | 23 | ||
22 | using namespace Opie::Core; | 24 | using namespace Opie::Core; |
23 | AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) | 25 | AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) |
@@ -108,16 +110,16 @@ QString AbstractMail::convert_String(const char*text) | |||
108 | } | 110 | } |
109 | 111 | ||
110 | /* cp & paste from launcher */ | 112 | /* cp & paste from launcher */ |
111 | QString AbstractMail::gen_attachment_id() | 113 | QString 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 | } |
121 | 123 | ||
122 | int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool) | 124 | int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool) |
123 | { | 125 | { |
@@ -135,22 +137,22 @@ QString AbstractMail::defaultLocalfolder() | |||
135 | QString AbstractMail::draftFolder() | 137 | QString AbstractMail::draftFolder() |
136 | { | 138 | { |
137 | return QString("Drafts"); | 139 | return QString("Drafts"); |
138 | } | 140 | } |
139 | 141 | ||
140 | /* temporary - will be removed when implemented in all classes */ | 142 | /* temporary - will be removed when implemented in all classes */ |
141 | void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &) | 143 | void AbstractMail::deleteMails(const QString &,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &) |
142 | { | 144 | { |
143 | } | 145 | } |
144 | void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) | 146 | void 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 ) { |
154 | Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); | 156 | Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); |
155 | wid.setProgress( iii ); | 157 | wid.setProgress( iii ); |
156 | wid.raise(); | 158 | wid.raise(); |
@@ -174,26 +176,26 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe | |||
174 | if ( !targetMail->createMbox(lfName)) | 176 | if ( !targetMail->createMbox(lfName)) |
175 | { | 177 | { |
176 | QMessageBox::critical(0,i18n("Error creating new Folder"), | 178 | QMessageBox::critical(0,i18n("Error creating new Folder"), |
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()); |
184 | Global::statusMessage(i18n("There are no new messages")); | 186 | Global::statusMessage(i18n("There are no new messages")); |
185 | return; | 187 | return; |
186 | } | 188 | } |
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 ) { |
197 | RecMailP r = (*t.at( iii )); | 199 | RecMailP r = (*t.at( iii )); |
198 | bool found = false; | 200 | bool found = false; |
199 | int jjj = 0; | 201 | int jjj = 0; |
@@ -218,38 +220,38 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe | |||
218 | return; | 220 | return; |
219 | } | 221 | } |
220 | mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer()); | 222 | mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer()); |
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 |
228 | 230 | ||
229 | } | 231 | } |
230 | void AbstractMail::mvcpAllMails(const FolderP&fromFolder, | 232 | void 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 | } |
238 | void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, | 240 | void 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; |
242 | int iii = 0; | 244 | int iii = 0; |
243 | int count = t.count(); | 245 | int count = t.count(); |
244 | if ( count == 0 ) | 246 | if ( count == 0 ) |
245 | return; | 247 | return; |
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 ) { |
253 | Global::statusMessage(i18n("Copy message %1 of %2").arg(iii).arg(count)); | 255 | Global::statusMessage(i18n("Copy message %1 of %2").arg(iii).arg(count)); |
254 | wid.setProgress( iii ); | 256 | wid.setProgress( iii ); |
255 | wid.raise(); | 257 | wid.raise(); |
diff --git a/kmicromail/libmailwrapper/abstractmail.h b/kmicromail/libmailwrapper/abstractmail.h index 2069ca1..f606b1f 100644 --- a/kmicromail/libmailwrapper/abstractmail.h +++ b/kmicromail/libmailwrapper/abstractmail.h | |||
@@ -4,12 +4,14 @@ | |||
4 | 4 | ||
5 | #include "maildefines.h" | 5 | #include "maildefines.h" |
6 | 6 | ||
7 | #include "settings.h" | 7 | #include "settings.h" |
8 | 8 | ||
9 | #include <qobject.h> | 9 | #include <qobject.h> |
10 | //Added by qt3to4: | ||
11 | #include <Q3ValueList> | ||
10 | #include <opie2/osmartpointer.h> | 12 | #include <opie2/osmartpointer.h> |
11 | #include "mailtypes.h" | 13 | #include "mailtypes.h" |
12 | 14 | ||
13 | 15 | ||
14 | #include "mailwrapper.h" | 16 | #include "mailwrapper.h" |
15 | 17 | ||
@@ -22,32 +24,32 @@ struct folderStat; | |||
22 | class AbstractMail:public QObject | 24 | class AbstractMail:public QObject |
23 | { | 25 | { |
24 | Q_OBJECT | 26 | Q_OBJECT |
25 | public: | 27 | public: |
26 | AbstractMail(){}; | 28 | AbstractMail(){}; |
27 | virtual ~AbstractMail(){} | 29 | virtual ~AbstractMail(){} |
28 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0; | 30 | virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0; |
29 | virtual void listMessages(const QString & mailbox,QValueList<RecMailP>&target, int sizeInKb = 0 )=0; | 31 | virtual void listMessages(const QString & mailbox,Q3ValueList<RecMailP>&target, int sizeInKb = 0 )=0; |
30 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; | 32 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; |
31 | virtual RecBodyP fetchBody(const RecMailP&mail)=0; | 33 | virtual RecBodyP fetchBody(const RecMailP&mail)=0; |
32 | virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part)=0; | 34 | virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part)=0; |
33 | virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part)=0; | 35 | virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part)=0; |
34 | virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part)=0; | 36 | virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part)=0; |
35 | virtual encodedString* fetchRawBody(const RecMailP&mail)=0; | 37 | virtual encodedString* fetchRawBody(const RecMailP&mail)=0; |
36 | 38 | ||
37 | virtual void deleteMail(const RecMailP&mail)=0; | 39 | virtual void deleteMail(const RecMailP&mail)=0; |
38 | virtual void deleteMailList(const QValueList<RecMailP>&target); | 40 | virtual void deleteMailList(const Q3ValueList<RecMailP>&target); |
39 | virtual void answeredMail(const RecMailP&mail)=0; | 41 | virtual void answeredMail(const RecMailP&mail)=0; |
40 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&)=0; | 42 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&)=0; |
41 | virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> >&target); | 43 | virtual void deleteMails(const QString & FolderName,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target); |
42 | virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&)=0; | 44 | virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&)=0; |
43 | virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; | 45 | virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; |
44 | void downloadNewMails(const FolderP&fromFolder,AbstractMail*targetWrapper ); | 46 | void downloadNewMails(const FolderP&fromFolder,AbstractMail*targetWrapper ); |
45 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, | 47 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, |
46 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int sizeInKb = 0); | 48 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int sizeInKb = 0); |
47 | virtual void mvcpMailList(const QValueList<RecMailP>& t, | 49 | virtual void mvcpMailList(const Q3ValueList<RecMailP>& t, |
48 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 50 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
49 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 51 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
50 | 52 | ||
51 | virtual void cleanMimeCache(){}; | 53 | virtual void cleanMimeCache(){}; |
52 | /* mail box methods */ | 54 | /* mail box methods */ |
53 | /* parameter is the box to create. | 55 | /* parameter is the box to create. |
diff --git a/kmicromail/libmailwrapper/generatemail.cpp b/kmicromail/libmailwrapper/generatemail.cpp index 2d213fe..ddad21b 100644 --- a/kmicromail/libmailwrapper/generatemail.cpp +++ b/kmicromail/libmailwrapper/generatemail.cpp | |||
@@ -4,12 +4,14 @@ | |||
4 | #include <libetpan/libetpan.h> | 4 | #include <libetpan/libetpan.h> |
5 | 5 | ||
6 | //#include <qt.h> | 6 | //#include <qt.h> |
7 | 7 | ||
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <qfileinfo.h> | 9 | #include <qfileinfo.h> |
10 | //Added by qt3to4: | ||
11 | #include <Q3CString> | ||
10 | 12 | ||
11 | using namespace Opie::Core; | 13 | using namespace Opie::Core; |
12 | const char* Generatemail::USER_AGENT="KOpieMail 33 1/3"; | 14 | const char* Generatemail::USER_AGENT="KOpieMail 33 1/3"; |
13 | 15 | ||
14 | Generatemail::Generatemail() | 16 | Generatemail::Generatemail() |
15 | { | 17 | { |
@@ -225,13 +227,13 @@ void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files | |||
225 | mailmime *Generatemail::buildTxtPart(const QString&str ) { | 227 | mailmime *Generatemail::buildTxtPart(const QString&str ) { |
226 | mailmime *txtPart; | 228 | mailmime *txtPart; |
227 | mailmime_fields *fields; | 229 | mailmime_fields *fields; |
228 | mailmime_content *content; | 230 | mailmime_content *content; |
229 | mailmime_parameter *param; | 231 | mailmime_parameter *param; |
230 | int err; | 232 | int err; |
231 | QCString __str; | 233 | Q3CString __str; |
232 | //qDebug(" Generatemail::buildTxtPart %s", str.latin1()); | 234 | //qDebug(" Generatemail::buildTxtPart %s", str.latin1()); |
233 | param = mailmime_parameter_new( strdup( "charset" ), | 235 | param = mailmime_parameter_new( strdup( "charset" ), |
234 | strdup( mCharset.latin1() ) ); | 236 | strdup( mCharset.latin1() ) ); |
235 | if ( param == NULL ) | 237 | if ( param == NULL ) |
236 | goto err_free; | 238 | goto err_free; |
237 | 239 | ||
@@ -249,13 +251,13 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) { | |||
249 | 251 | ||
250 | txtPart = mailmime_new_empty( content, fields ); | 252 | txtPart = mailmime_new_empty( content, fields ); |
251 | if ( txtPart == NULL ) | 253 | if ( txtPart == NULL ) |
252 | goto err_free_fields; | 254 | goto err_free_fields; |
253 | { | 255 | { |
254 | //__str = str.utf8(); | 256 | //__str = str.utf8(); |
255 | __str = QCString (str.latin1()); | 257 | __str = Q3CString (str.latin1()); |
256 | err = mailmime_set_body_text( txtPart, strdup(__str.data()), __str.length() ); | 258 | err = mailmime_set_body_text( txtPart, strdup(__str.data()), __str.length() ); |
257 | } | 259 | } |
258 | if ( err != MAILIMF_NO_ERROR ) | 260 | if ( err != MAILIMF_NO_ERROR ) |
259 | goto err_free_txtPart; | 261 | goto err_free_txtPart; |
260 | 262 | ||
261 | return txtPart; // Success :) | 263 | return txtPart; // Success :) |
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index 0b6adf7..633ab42 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp | |||
@@ -3,12 +3,14 @@ | |||
3 | #include <libetpan/libetpan.h> | 3 | #include <libetpan/libetpan.h> |
4 | #include "mailtypes.h" | 4 | #include "mailtypes.h" |
5 | 5 | ||
6 | #include <kconfig.h> | 6 | #include <kconfig.h> |
7 | #include <kglobal.h> | 7 | #include <kglobal.h> |
8 | #include <kstandarddirs.h> | 8 | #include <kstandarddirs.h> |
9 | //Added by qt3to4: | ||
10 | #include <Q3ValueList> | ||
9 | 11 | ||
10 | 12 | ||
11 | using namespace Opie::Core; | 13 | using namespace Opie::Core; |
12 | Genericwrapper::Genericwrapper() | 14 | Genericwrapper::Genericwrapper() |
13 | : AbstractMail() | 15 | : AbstractMail() |
14 | { | 16 | { |
@@ -179,13 +181,13 @@ QString Genericwrapper::getencoding(mailmime_mechanism*aEnc) | |||
179 | } | 181 | } |
180 | break; | 182 | break; |
181 | } | 183 | } |
182 | return enc; | 184 | return enc; |
183 | } | 185 | } |
184 | 186 | ||
185 | void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count) | 187 | void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueList<int>recList,unsigned int current_rec,int current_count) |
186 | { | 188 | { |
187 | if (current_rec >= 10) { | 189 | if (current_rec >= 10) { |
188 | ; // odebug << "too deep recursion!" << oendl; | 190 | ; // odebug << "too deep recursion!" << oendl; |
189 | } | 191 | } |
190 | if (!message || !mime) { | 192 | if (!message || !mime) { |
191 | return; | 193 | return; |
@@ -197,13 +199,13 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m | |||
197 | QString b; | 199 | QString b; |
198 | RecPartP part = new RecPart(); | 200 | RecPartP part = new RecPart(); |
199 | 201 | ||
200 | switch (mime->mm_type) { | 202 | switch (mime->mm_type) { |
201 | case MAILMIME_SINGLE: | 203 | case MAILMIME_SINGLE: |
202 | { | 204 | { |
203 | QValueList<int>countlist = recList; | 205 | Q3ValueList<int>countlist = recList; |
204 | countlist.append(current_count); | 206 | countlist.append(current_count); |
205 | r = mailmessage_fetch_section(message,mime,&data,&len); | 207 | r = mailmessage_fetch_section(message,mime,&data,&len); |
206 | part->setSize(len); | 208 | part->setSize(len); |
207 | part->setPositionlist(countlist); | 209 | part->setPositionlist(countlist); |
208 | b = gen_attachment_id(); | 210 | b = gen_attachment_id(); |
209 | part->setIdentifier(b); | 211 | part->setIdentifier(b); |
@@ -247,13 +249,13 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m | |||
247 | } | 249 | } |
248 | break; | 250 | break; |
249 | case MAILMIME_MULTIPLE: | 251 | case MAILMIME_MULTIPLE: |
250 | { | 252 | { |
251 | unsigned int ccount = 1; | 253 | unsigned int ccount = 1; |
252 | mailmime*cbody=0; | 254 | mailmime*cbody=0; |
253 | QValueList<int>countlist = recList; | 255 | Q3ValueList<int>countlist = recList; |
254 | for (cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list) ; cur != NULL ; cur = clist_next(cur)) { | 256 | for (cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list) ; cur != NULL ; cur = clist_next(cur)) { |
255 | cbody = (mailmime*)clist_content(cur); | 257 | cbody = (mailmime*)clist_content(cur); |
256 | if (cbody->mm_type==MAILMIME_MULTIPLE) { | 258 | if (cbody->mm_type==MAILMIME_MULTIPLE) { |
257 | RecPartP targetPart = new RecPart(); | 259 | RecPartP targetPart = new RecPart(); |
258 | targetPart->setType("multipart"); | 260 | targetPart->setType("multipart"); |
259 | countlist.append(current_count); | 261 | countlist.append(current_count); |
@@ -267,13 +269,13 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m | |||
267 | ++ccount; | 269 | ++ccount; |
268 | } | 270 | } |
269 | } | 271 | } |
270 | break; | 272 | break; |
271 | case MAILMIME_MESSAGE: | 273 | case MAILMIME_MESSAGE: |
272 | { | 274 | { |
273 | QValueList<int>countlist = recList; | 275 | Q3ValueList<int>countlist = recList; |
274 | countlist.append(current_count); | 276 | countlist.append(current_count); |
275 | /* the own header is always at recursion 0 - we don't need that */ | 277 | /* the own header is always at recursion 0 - we don't need that */ |
276 | if (current_rec > 0) { | 278 | if (current_rec > 0) { |
277 | part->setPositionlist(countlist); | 279 | part->setPositionlist(countlist); |
278 | r = mailmessage_fetch_section(message,mime,&data,&len); | 280 | r = mailmessage_fetch_section(message,mime,&data,&len); |
279 | part->setSize(len); | 281 | part->setSize(len); |
@@ -299,13 +301,13 @@ RecBodyP Genericwrapper::parseMail( mailmessage * msg ) | |||
299 | //mailmime_single_fields fields; | 301 | //mailmime_single_fields fields; |
300 | /* is bound to msg and will be freed there */ | 302 | /* is bound to msg and will be freed there */ |
301 | mailmime * mime=0; | 303 | mailmime * mime=0; |
302 | RecBodyP body = new RecBody(); | 304 | RecBodyP body = new RecBody(); |
303 | //memset(&fields, 0, sizeof(struct mailmime_single_fields)); | 305 | //memset(&fields, 0, sizeof(struct mailmime_single_fields)); |
304 | err = mailmessage_get_bodystructure(msg,&mime); | 306 | err = mailmessage_get_bodystructure(msg,&mime); |
305 | QValueList<int>recList; | 307 | Q3ValueList<int>recList; |
306 | traverseBody(body,msg,mime,recList); | 308 | traverseBody(body,msg,mime,recList); |
307 | return body; | 309 | return body; |
308 | } | 310 | } |
309 | 311 | ||
310 | 312 | ||
311 | QString Genericwrapper::parseAddressList( mailimf_address_list *list ) | 313 | QString Genericwrapper::parseAddressList( mailimf_address_list *list ) |
@@ -444,13 +446,13 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) | |||
444 | res.append(h); | 446 | res.append(h); |
445 | } | 447 | } |
446 | } | 448 | } |
447 | return res; | 449 | return res; |
448 | } | 450 | } |
449 | 451 | ||
450 | void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) | 452 | void Genericwrapper::parseList(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) |
451 | { | 453 | { |
452 | int r; | 454 | int r; |
453 | mailmessage_list * env_list = 0; | 455 | mailmessage_list * env_list = 0; |
454 | r = mailsession_get_messages_list(session,&env_list); | 456 | r = mailsession_get_messages_list(session,&env_list); |
455 | if (r != MAIL_NO_ERROR) { | 457 | if (r != MAIL_NO_ERROR) { |
456 | ; // odebug << "Error message list" << oendl; | 458 | ; // odebug << "Error message list" << oendl; |
diff --git a/kmicromail/libmailwrapper/genericwrapper.h b/kmicromail/libmailwrapper/genericwrapper.h index c35a6da..a50161d 100644 --- a/kmicromail/libmailwrapper/genericwrapper.h +++ b/kmicromail/libmailwrapper/genericwrapper.h | |||
@@ -2,12 +2,14 @@ | |||
2 | #ifndef __GENERIC_WRAPPER_H | 2 | #ifndef __GENERIC_WRAPPER_H |
3 | #define __GENERIC_WRAPPER_H | 3 | #define __GENERIC_WRAPPER_H |
4 | 4 | ||
5 | #include "abstractmail.h" | 5 | #include "abstractmail.h" |
6 | #include <qmap.h> | 6 | #include <qmap.h> |
7 | #include <qstring.h> | 7 | #include <qstring.h> |
8 | //Added by qt3to4: | ||
9 | #include <Q3ValueList> | ||
8 | #include <libetpan/clist.h> | 10 | #include <libetpan/clist.h> |
9 | 11 | ||
10 | class RecMail; | 12 | class RecMail; |
11 | class RecBody; | 13 | class RecBody; |
12 | class encodedString; | 14 | class encodedString; |
13 | struct mailpop3; | 15 | struct mailpop3; |
@@ -48,17 +50,17 @@ protected: | |||
48 | RecBodyP parseMail( mailmessage * msg ); | 50 | RecBodyP parseMail( mailmessage * msg ); |
49 | QString parseMailboxList( mailimf_mailbox_list *list ); | 51 | QString parseMailboxList( mailimf_mailbox_list *list ); |
50 | QString parseMailbox( mailimf_mailbox *box ); | 52 | QString parseMailbox( mailimf_mailbox *box ); |
51 | QString parseGroup( mailimf_group *group ); | 53 | QString parseGroup( mailimf_group *group ); |
52 | QString parseAddressList( mailimf_address_list *list ); | 54 | QString parseAddressList( mailimf_address_list *list ); |
53 | 55 | ||
54 | void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1); | 56 | void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueList<int>recList,unsigned int current_rek=0,int current_count=1); |
55 | static void fillSingleBody(RecPartP&target,mailmessage*message,mailmime*mime); | 57 | static void fillSingleBody(RecPartP&target,mailmessage*message,mailmime*mime); |
56 | static void fillParameters(RecPartP&target,clist*parameters); | 58 | static void fillParameters(RecPartP&target,clist*parameters); |
57 | static QString getencoding(mailmime_mechanism*aEnc); | 59 | static QString getencoding(mailmime_mechanism*aEnc); |
58 | virtual void parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0); | 60 | virtual void parseList(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0); |
59 | QStringList parseInreplies(mailimf_in_reply_to * in_replies); | 61 | QStringList parseInreplies(mailimf_in_reply_to * in_replies); |
60 | 62 | ||
61 | QString msgTempName; | 63 | QString msgTempName; |
62 | unsigned int last_msg_id; | 64 | unsigned int last_msg_id; |
63 | QMap<QString,encodedString*> bodyCache; | 65 | QMap<QString,encodedString*> bodyCache; |
64 | mailstorage * m_storage; | 66 | mailstorage * m_storage; |
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 4f0c849..f73f4cc 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -1,15 +1,17 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <libetpan/libetpan.h> | 3 | #include <libetpan/libetpan.h> |
4 | #include <qpe/global.h> | 4 | #include <qpe/global.h> |
5 | #include <qapplication.h> | 5 | #include <qapplication.h> |
6 | //Added by qt3to4: | ||
7 | #include <Q3ValueList> | ||
6 | #include "imapwrapper.h" | 8 | #include "imapwrapper.h" |
7 | #include "mailtypes.h" | 9 | #include "mailtypes.h" |
8 | #include "logindialog.h" | 10 | #include "logindialog.h" |
9 | #include <qprogressbar.h> | 11 | #include <q3progressbar.h> |
10 | #include "genericwrapper.h" | 12 | #include "genericwrapper.h" |
11 | #include <kglobal.h> | 13 | #include <kglobal.h> |
12 | 14 | ||
13 | using namespace Opie::Core; | 15 | using namespace Opie::Core; |
14 | int IMAPwrapper::mMax = 0; | 16 | int IMAPwrapper::mMax = 0; |
15 | int IMAPwrapper::mCurrent = 0; | 17 | int IMAPwrapper::mCurrent = 0; |
@@ -236,13 +238,13 @@ void IMAPwrapper::logout() | |||
236 | err = mailimap_close( m_imap ); | 238 | err = mailimap_close( m_imap ); |
237 | mailimap_free( m_imap ); | 239 | mailimap_free( m_imap ); |
238 | m_imap = 0; | 240 | m_imap = 0; |
239 | m_Lastmbox = ""; | 241 | m_Lastmbox = ""; |
240 | } | 242 | } |
241 | 243 | ||
242 | void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) | 244 | void IMAPwrapper::listMessages(const QString&mailbox,Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) |
243 | { | 245 | { |
244 | 246 | ||
245 | int tryAgain = 1; | 247 | int tryAgain = 1; |
246 | while ( tryAgain >= 0 ) { | 248 | while ( tryAgain >= 0 ) { |
247 | int err = MAILIMAP_NO_ERROR; | 249 | int err = MAILIMAP_NO_ERROR; |
248 | clist *result = 0; | 250 | clist *result = 0; |
@@ -317,22 +319,22 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma | |||
317 | } | 319 | } |
318 | 320 | ||
319 | if (result) mailimap_fetch_list_free(result); | 321 | if (result) mailimap_fetch_list_free(result); |
320 | } | 322 | } |
321 | } | 323 | } |
322 | 324 | ||
323 | QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() | 325 | Q3ValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() |
324 | { | 326 | { |
325 | const char *path, *mask; | 327 | const char *path, *mask; |
326 | int err = MAILIMAP_NO_ERROR; | 328 | int err = MAILIMAP_NO_ERROR; |
327 | clist *result = 0; | 329 | clist *result = 0; |
328 | clistcell *current = 0; | 330 | clistcell *current = 0; |
329 | clistcell*cur_flag = 0; | 331 | clistcell*cur_flag = 0; |
330 | mailimap_mbx_list_flags*bflags = 0; | 332 | mailimap_mbx_list_flags*bflags = 0; |
331 | 333 | ||
332 | QValueList<FolderP>* folders = new QValueList<FolderP>(); | 334 | Q3ValueList<FolderP>* folders = new Q3ValueList<FolderP>(); |
333 | login(); | 335 | login(); |
334 | if (!m_imap) { | 336 | if (!m_imap) { |
335 | return folders; | 337 | return folders; |
336 | } | 338 | } |
337 | 339 | ||
338 | /* | 340 | /* |
@@ -610,13 +612,13 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) | |||
610 | mailimap_fetch_type_free( fetchType ); | 612 | mailimap_fetch_type_free( fetchType ); |
611 | 613 | ||
612 | if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { | 614 | if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { |
613 | mailimap_msg_att * msg_att; | 615 | mailimap_msg_att * msg_att; |
614 | msg_att = (mailimap_msg_att*)current->data; | 616 | msg_att = (mailimap_msg_att*)current->data; |
615 | mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data; | 617 | mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data; |
616 | QValueList<int> path; | 618 | Q3ValueList<int> path; |
617 | body_desc = item->att_data.att_static->att_data.att_body; | 619 | body_desc = item->att_data.att_static->att_data.att_body; |
618 | traverseBody(mail,body_desc,body,0,path); | 620 | traverseBody(mail,body_desc,body,0,path); |
619 | } else { | 621 | } else { |
620 | qDebug("error fetching body %d (%d): %s", err, MAILIMAP_NO_ERROR, m_imap->imap_response ); | 622 | qDebug("error fetching body %d (%d): %s", err, MAILIMAP_NO_ERROR, m_imap->imap_response ); |
621 | } | 623 | } |
622 | if (result) mailimap_fetch_list_free(result); | 624 | if (result) mailimap_fetch_list_free(result); |
@@ -661,13 +663,13 @@ QStringList IMAPwrapper::address_list_to_stringlist(clist*list) | |||
661 | break; | 663 | break; |
662 | } | 664 | } |
663 | } | 665 | } |
664 | return l; | 666 | return l; |
665 | } | 667 | } |
666 | 668 | ||
667 | encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call) | 669 | encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call) |
668 | { | 670 | { |
669 | encodedString*res=new encodedString; | 671 | encodedString*res=new encodedString; |
670 | int err; | 672 | int err; |
671 | mailimap_fetch_type *fetchType; | 673 | mailimap_fetch_type *fetchType; |
672 | mailimap_set *set; | 674 | mailimap_set *set; |
673 | clistcell*current,*cur; | 675 | clistcell*current,*cur; |
@@ -735,21 +737,21 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int | |||
735 | return res; | 737 | return res; |
736 | } | 738 | } |
737 | 739 | ||
738 | /* current_recursion is for recursive calls. | 740 | /* current_recursion is for recursive calls. |
739 | current_count means the position inside the internal loop! */ | 741 | current_count means the position inside the internal loop! */ |
740 | void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body, | 742 | void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body, |
741 | int current_recursion,QValueList<int>recList,int current_count) | 743 | int current_recursion,Q3ValueList<int>recList,int current_count) |
742 | { | 744 | { |
743 | if (!body || current_recursion>=10) { | 745 | if (!body || current_recursion>=10) { |
744 | return; | 746 | return; |
745 | } | 747 | } |
746 | switch (body->bd_type) { | 748 | switch (body->bd_type) { |
747 | case MAILIMAP_BODY_1PART: | 749 | case MAILIMAP_BODY_1PART: |
748 | { | 750 | { |
749 | QValueList<int>countlist = recList; | 751 | Q3ValueList<int>countlist = recList; |
750 | countlist.append(current_count); | 752 | countlist.append(current_count); |
751 | RecPartP currentPart = new RecPart(); | 753 | RecPartP currentPart = new RecPart(); |
752 | mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; | 754 | mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; |
753 | QString id(""); | 755 | QString id(""); |
754 | currentPart->setPositionlist(countlist); | 756 | currentPart->setPositionlist(countlist); |
755 | for (unsigned int j = 0; j < countlist.count();++j) { | 757 | for (unsigned int j = 0; j < countlist.count();++j) { |
@@ -796,13 +798,13 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t | |||
796 | traverseBody(mail,part1->bd_data.bd_type_msg->bd_body,target_body,current_recursion+1,countlist); | 798 | traverseBody(mail,part1->bd_data.bd_type_msg->bd_body,target_body,current_recursion+1,countlist); |
797 | } | 799 | } |
798 | } | 800 | } |
799 | break; | 801 | break; |
800 | case MAILIMAP_BODY_MPART: | 802 | case MAILIMAP_BODY_MPART: |
801 | { | 803 | { |
802 | QValueList<int>countlist = recList; | 804 | Q3ValueList<int>countlist = recList; |
803 | clistcell*current=0; | 805 | clistcell*current=0; |
804 | mailimap_body*current_body=0; | 806 | mailimap_body*current_body=0; |
805 | unsigned int ccount = 1; | 807 | unsigned int ccount = 1; |
806 | mailimap_body_type_mpart*mailDescription = body->bd_data.bd_body_mpart; | 808 | mailimap_body_type_mpart*mailDescription = body->bd_data.bd_body_mpart; |
807 | for (current=clist_begin(mailDescription->bd_list);current!=0;current=clist_next(current)) { | 809 | for (current=clist_begin(mailDescription->bd_list);current!=0;current=clist_next(current)) { |
808 | current_body = (mailimap_body*)current->data; | 810 | current_body = (mailimap_body*)current->data; |
@@ -982,13 +984,13 @@ void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which | |||
982 | if (which->bd_description) { | 984 | if (which->bd_description) { |
983 | target_part->setDescription(QString(which->bd_description)); | 985 | target_part->setDescription(QString(which->bd_description)); |
984 | } | 986 | } |
985 | target_part->setEncoding(encoding); | 987 | target_part->setEncoding(encoding); |
986 | target_part->setSize(which->bd_size); | 988 | target_part->setSize(which->bd_size); |
987 | } | 989 | } |
988 | void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) | 990 | void IMAPwrapper::deleteMailList(const Q3ValueList<RecMailP>&target) |
989 | { | 991 | { |
990 | //#if 0 | 992 | //#if 0 |
991 | mailimap_flag_list*flist; | 993 | mailimap_flag_list*flist; |
992 | mailimap_set *set; | 994 | mailimap_set *set; |
993 | mailimap_store_att_flags * store_flags; | 995 | mailimap_store_att_flags * store_flags; |
994 | int err; | 996 | int err; |
@@ -1002,13 +1004,13 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) | |||
1002 | // qDebug("imap remove count %d ", count); | 1004 | // qDebug("imap remove count %d ", count); |
1003 | 1005 | ||
1004 | 1006 | ||
1005 | mMax = count; | 1007 | mMax = count; |
1006 | progress( i18n("Delete")); | 1008 | progress( i18n("Delete")); |
1007 | 1009 | ||
1008 | QProgressBar wid ( count ); | 1010 | Q3ProgressBar wid ( count ); |
1009 | wid.setCaption( i18n("Deleting ...")); | 1011 | wid.setCaption( i18n("Deleting ...")); |
1010 | wid.show(); | 1012 | wid.show(); |
1011 | while (iii < count ) { | 1013 | while (iii < count ) { |
1012 | Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); | 1014 | Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); |
1013 | wid.setProgress( iii ); | 1015 | wid.setProgress( iii ); |
1014 | wid.raise(); | 1016 | wid.raise(); |
@@ -1111,13 +1113,13 @@ void IMAPwrapper::answeredMail(const RecMailP&mail) | |||
1111 | if (err != MAILIMAP_NO_ERROR) { | 1113 | if (err != MAILIMAP_NO_ERROR) { |
1112 | // odebug << "error marking mail: " << m_imap->imap_response << "" << oendl; | 1114 | // odebug << "error marking mail: " << m_imap->imap_response << "" << oendl; |
1113 | return; | 1115 | return; |
1114 | } | 1116 | } |
1115 | } | 1117 | } |
1116 | 1118 | ||
1117 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) | 1119 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call,const QString&enc) |
1118 | { | 1120 | { |
1119 | QString body(""); | 1121 | QString body(""); |
1120 | encodedString*res = fetchRawPart(mail,path,internal_call); | 1122 | encodedString*res = fetchRawPart(mail,path,internal_call); |
1121 | encodedString*r = decode_String(res,enc); | 1123 | encodedString*r = decode_String(res,enc); |
1122 | delete res; | 1124 | delete res; |
1123 | if (r) { | 1125 | if (r) { |
@@ -1296,13 +1298,13 @@ const QString&IMAPwrapper::getName()const | |||
1296 | return account->getAccountName(); | 1298 | return account->getAccountName(); |
1297 | } | 1299 | } |
1298 | 1300 | ||
1299 | encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) | 1301 | encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) |
1300 | { | 1302 | { |
1301 | // dummy | 1303 | // dummy |
1302 | QValueList<int> path; | 1304 | Q3ValueList<int> path; |
1303 | return fetchRawPart(mail,path,false); | 1305 | return fetchRawPart(mail,path,false); |
1304 | } | 1306 | } |
1305 | 1307 | ||
1306 | void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, | 1308 | void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, |
1307 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) | 1309 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) |
1308 | { | 1310 | { |
diff --git a/kmicromail/libmailwrapper/imapwrapper.h b/kmicromail/libmailwrapper/imapwrapper.h index 31c60a8..d3d3ecd 100644 --- a/kmicromail/libmailwrapper/imapwrapper.h +++ b/kmicromail/libmailwrapper/imapwrapper.h | |||
@@ -1,11 +1,13 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | #ifndef __IMAPWRAPPER | 2 | #ifndef __IMAPWRAPPER |
3 | #define __IMAPWRAPPER | 3 | #define __IMAPWRAPPER |
4 | 4 | ||
5 | #include <qlist.h> | 5 | #include <qlist.h> |
6 | //Added by qt3to4: | ||
7 | #include <Q3ValueList> | ||
6 | #include "mailwrapper.h" | 8 | #include "mailwrapper.h" |
7 | #include "abstractmail.h" | 9 | #include "abstractmail.h" |
8 | #include <libetpan/clist.h> | 10 | #include <libetpan/clist.h> |
9 | 11 | ||
10 | struct mailimap; | 12 | struct mailimap; |
11 | struct mailimap_body; | 13 | struct mailimap_body; |
@@ -21,18 +23,18 @@ class encodedString; | |||
21 | class IMAPwrapper : public AbstractMail | 23 | class IMAPwrapper : public AbstractMail |
22 | { | 24 | { |
23 | Q_OBJECT | 25 | Q_OBJECT |
24 | public: | 26 | public: |
25 | IMAPwrapper( IMAPaccount *a ); | 27 | IMAPwrapper( IMAPaccount *a ); |
26 | virtual ~IMAPwrapper(); | 28 | virtual ~IMAPwrapper(); |
27 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); | 29 | virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); |
28 | virtual void listMessages(const QString & mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); | 30 | virtual void listMessages(const QString & mailbox,Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); |
29 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 31 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
30 | 32 | ||
31 | virtual void deleteMail(const RecMailP&mail); | 33 | virtual void deleteMail(const RecMailP&mail); |
32 | void deleteMailList(const QValueList<RecMailP>&target); | 34 | void deleteMailList(const Q3ValueList<RecMailP>&target); |
33 | virtual void answeredMail(const RecMailP&mail); | 35 | virtual void answeredMail(const RecMailP&mail); |
34 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&folder); | 36 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&folder); |
35 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 37 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
36 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, | 38 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, |
37 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit,int sizeInKb = 0); | 39 | const QString&targetFolder,AbstractMail*targetWrapper,bool moveit,int sizeInKb = 0); |
38 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 40 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
@@ -56,22 +58,22 @@ public: | |||
56 | 58 | ||
57 | protected: | 59 | protected: |
58 | RecMail*parse_list_result(mailimap_msg_att*); | 60 | RecMail*parse_list_result(mailimap_msg_att*); |
59 | void login(bool tryTLS = true); | 61 | void login(bool tryTLS = true); |
60 | bool start_tls(bool force=true); | 62 | bool start_tls(bool force=true); |
61 | 63 | ||
62 | virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); | 64 | virtual QString fetchTextPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call=false,const QString&enc=""); |
63 | virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call); | 65 | virtual encodedString*fetchRawPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call); |
64 | int selectMbox(const QString&mbox); | 66 | int selectMbox(const QString&mbox); |
65 | 67 | ||
66 | void fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description); | 68 | void fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description); |
67 | void fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which); | 69 | void fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which); |
68 | void fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which); | 70 | void fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which); |
69 | void fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which); | 71 | void fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which); |
70 | void fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which); | 72 | void fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which); |
71 | void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,QValueList<int>recList,int current_count=1); | 73 | void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,Q3ValueList<int>recList,int current_count=1); |
72 | 74 | ||
73 | /* just helpers */ | 75 | /* just helpers */ |
74 | static void fillBodyFields(RecPartP&target_part,mailimap_body_fields*which); | 76 | static void fillBodyFields(RecPartP&target_part,mailimap_body_fields*which); |
75 | static QStringList address_list_to_stringlist(clist*list); | 77 | static QStringList address_list_to_stringlist(clist*list); |
76 | 78 | ||
77 | static void progress(QString mess = QString::null); | 79 | static void progress(QString mess = QString::null); |
diff --git a/kmicromail/libmailwrapper/libmailwrapper.pro b/kmicromail/libmailwrapper/libmailwrapper.pro index 646630b..6b595ab 100644 --- a/kmicromail/libmailwrapper/libmailwrapper.pro +++ b/kmicromail/libmailwrapper/libmailwrapper.pro | |||
@@ -35,13 +35,14 @@ SOURCES = imapwrapper.cpp \ | |||
35 | nntpwrapper.cpp \ | 35 | nntpwrapper.cpp \ |
36 | generatemail.cpp \ | 36 | generatemail.cpp \ |
37 | storemail.cpp \ | 37 | storemail.cpp \ |
38 | ../qpe/qdialog_hacked.cpp \ | 38 | ../qpe/qdialog_hacked.cpp \ |
39 | ../qpe/global.cpp | 39 | ../qpe/global.cpp |
40 | 40 | ||
41 | INTERFACES = logindialogui.ui \ | 41 | #The following line was changed from INTERFACES to FORMS3 by qt3to4 |
42 | FORMS3 = logindialogui.ui \ | ||
42 | sendmailprogressui.ui | 43 | sendmailprogressui.ui |
43 | 44 | ||
44 | INCLUDEPATH += ../qpe .. ../../microkde ../../microkde/kdecore ../../libetpan/include | 45 | INCLUDEPATH += ../qpe .. ../../microkde ../../microkde/kdecore ../../libetpan/include |
45 | LIBS += -lssl -lcrypto | 46 | LIBS += -lssl -lcrypto |
46 | 47 | ||
47 | #-lqpe -letpan | 48 | #-lqpe -letpan |
@@ -60,6 +61,11 @@ LIBS += mfc71u.lib | |||
60 | QMAKE_LINK += /NODEFAULTLIB:LIBC | 61 | QMAKE_LINK += /NODEFAULTLIB:LIBC |
61 | #QMAKE_LINK += /NODEFAULTLIB:MSVCRT | 62 | #QMAKE_LINK += /NODEFAULTLIB:MSVCRT |
62 | #QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib | 63 | #QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib |
63 | OBJECTS_DIR = obj/win | 64 | OBJECTS_DIR = obj/win |
64 | MOC_DIR = moc/win | 65 | MOC_DIR = moc/win |
65 | } | 66 | } |
67 | #The following line was inserted by qt3to4 | ||
68 | QT += xml qt3support | ||
69 | #The following line was inserted by qt3to4 | ||
70 | CONFIG += uic3 | ||
71 | |||
diff --git a/kmicromail/libmailwrapper/logindialog.cpp b/kmicromail/libmailwrapper/logindialog.cpp index 31b75d0..d1f4b5d 100644 --- a/kmicromail/libmailwrapper/logindialog.cpp +++ b/kmicromail/libmailwrapper/logindialog.cpp | |||
@@ -3,13 +3,13 @@ | |||
3 | #include "logindialog.h" | 3 | #include "logindialog.h" |
4 | 4 | ||
5 | 5 | ||
6 | 6 | ||
7 | //using namespace Opie::Core; | 7 | //using namespace Opie::Core; |
8 | 8 | ||
9 | LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, WFlags flags ) | 9 | LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) |
10 | : LoginDialogUI( parent, name, modal, flags ) | 10 | : LoginDialogUI( parent, name, modal, flags ) |
11 | { | 11 | { |
12 | userLine->setText( (user.isEmpty()?QString(""):user) ); | 12 | userLine->setText( (user.isEmpty()?QString(""):user) ); |
13 | passLine->setText( (pass.isEmpty()?QString(""):pass) ); | 13 | passLine->setText( (pass.isEmpty()?QString(""):pass) ); |
14 | _user = user; | 14 | _user = user; |
15 | _pass = pass; | 15 | _pass = pass; |
diff --git a/kmicromail/libmailwrapper/logindialog.h b/kmicromail/libmailwrapper/logindialog.h index f406f2c..a18daa5 100644 --- a/kmicromail/libmailwrapper/logindialog.h +++ b/kmicromail/libmailwrapper/logindialog.h | |||
@@ -5,13 +5,13 @@ | |||
5 | 5 | ||
6 | class LoginDialog : public LoginDialogUI | 6 | class LoginDialog : public LoginDialogUI |
7 | { | 7 | { |
8 | Q_OBJECT | 8 | Q_OBJECT |
9 | 9 | ||
10 | public: | 10 | public: |
11 | LoginDialog(const QString&user,const QString&pass, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); | 11 | LoginDialog(const QString&user,const QString&pass, QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags flags = 0 ); |
12 | QString getUser() { return _user; } | 12 | QString getUser() { return _user; } |
13 | QString getPassword() { return _pass; } | 13 | QString getPassword() { return _pass; } |
14 | 14 | ||
15 | protected slots: | 15 | protected slots: |
16 | void accept(); | 16 | void accept(); |
17 | 17 | ||
diff --git a/kmicromail/libmailwrapper/mailtypes.cpp b/kmicromail/libmailwrapper/mailtypes.cpp index 70a0ab5..84ccf9f 100644 --- a/kmicromail/libmailwrapper/mailtypes.cpp +++ b/kmicromail/libmailwrapper/mailtypes.cpp | |||
@@ -1,11 +1,13 @@ | |||
1 | #include "mailtypes.h" | 1 | #include "mailtypes.h" |
2 | 2 | ||
3 | //#include <opie2/odebug.h> | 3 | //#include <opie2/odebug.h> |
4 | 4 | ||
5 | #include <stdlib.h> | 5 | #include <stdlib.h> |
6 | //Added by qt3to4: | ||
7 | #include <Q3ValueList> | ||
6 | 8 | ||
7 | using namespace Opie::Core; | 9 | using namespace Opie::Core; |
8 | RecMail::RecMail() | 10 | RecMail::RecMail() |
9 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) | 11 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) |
10 | { | 12 | { |
11 | init(); | 13 | init(); |
@@ -280,18 +282,18 @@ const QString RecPart::searchParamter(const QString&key)const | |||
280 | if (it != m_Parameters.end()) { | 282 | if (it != m_Parameters.end()) { |
281 | value = it.data(); | 283 | value = it.data(); |
282 | } | 284 | } |
283 | return value; | 285 | return value; |
284 | } | 286 | } |
285 | 287 | ||
286 | void RecPart::setPositionlist(const QValueList<int>&poslist) | 288 | void RecPart::setPositionlist(const Q3ValueList<int>&poslist) |
287 | { | 289 | { |
288 | m_poslist = poslist; | 290 | m_poslist = poslist; |
289 | } | 291 | } |
290 | 292 | ||
291 | const QValueList<int>& RecPart::Positionlist()const | 293 | const Q3ValueList<int>& RecPart::Positionlist()const |
292 | { | 294 | { |
293 | return m_poslist; | 295 | return m_poslist; |
294 | } | 296 | } |
295 | 297 | ||
296 | RecBody::RecBody() | 298 | RecBody::RecBody() |
297 | : Opie::Core::ORefCount(),m_BodyText(),m_description(new RecPart()) | 299 | : Opie::Core::ORefCount(),m_BodyText(),m_description(new RecPart()) |
@@ -320,19 +322,19 @@ void RecBody::setBodytext(const QString&bodyText) | |||
320 | 322 | ||
321 | const QString& RecBody::Bodytext()const | 323 | const QString& RecBody::Bodytext()const |
322 | { | 324 | { |
323 | return m_BodyText; | 325 | return m_BodyText; |
324 | } | 326 | } |
325 | 327 | ||
326 | void RecBody::setParts(const QValueList<RecPartP>&parts) | 328 | void RecBody::setParts(const Q3ValueList<RecPartP>&parts) |
327 | { | 329 | { |
328 | m_PartsList.clear(); | 330 | m_PartsList.clear(); |
329 | m_PartsList = parts; | 331 | m_PartsList = parts; |
330 | } | 332 | } |
331 | 333 | ||
332 | const QValueList<RecPartP>& RecBody::Parts()const | 334 | const Q3ValueList<RecPartP>& RecBody::Parts()const |
333 | { | 335 | { |
334 | return m_PartsList; | 336 | return m_PartsList; |
335 | } | 337 | } |
336 | 338 | ||
337 | void RecBody::addPart(const RecPartP& part) | 339 | void RecBody::addPart(const RecPartP& part) |
338 | { | 340 | { |
diff --git a/kmicromail/libmailwrapper/mailtypes.h b/kmicromail/libmailwrapper/mailtypes.h index 97f10d7..ac7f8da 100644 --- a/kmicromail/libmailwrapper/mailtypes.h +++ b/kmicromail/libmailwrapper/mailtypes.h | |||
@@ -11,13 +11,13 @@ | |||
11 | #include <opie2/osmartpointer.h> | 11 | #include <opie2/osmartpointer.h> |
12 | 12 | ||
13 | #include <qbitarray.h> | 13 | #include <qbitarray.h> |
14 | #include <qstring.h> | 14 | #include <qstring.h> |
15 | #include <qstringlist.h> | 15 | #include <qstringlist.h> |
16 | #include <qmap.h> | 16 | #include <qmap.h> |
17 | #include <qvaluelist.h> | 17 | #include <q3valuelist.h> |
18 | 18 | ||
19 | class AbstractMail; | 19 | class AbstractMail; |
20 | /* a class to describe mails in a mailbox */ | 20 | /* a class to describe mails in a mailbox */ |
21 | /* Attention! | 21 | /* Attention! |
22 | From programmers point of view it would make sense to | 22 | From programmers point of view it would make sense to |
23 | store the mail body into this class, too. | 23 | store the mail body into this class, too. |
@@ -106,13 +106,13 @@ class RecPart:public Opie::Core::ORefCount | |||
106 | { | 106 | { |
107 | protected: | 107 | protected: |
108 | QString m_type,m_subtype,m_identifier,m_encoding,m_description; | 108 | QString m_type,m_subtype,m_identifier,m_encoding,m_description; |
109 | unsigned int m_lines,m_size; | 109 | unsigned int m_lines,m_size; |
110 | part_plist_t m_Parameters; | 110 | part_plist_t m_Parameters; |
111 | /* describes the position in the mail */ | 111 | /* describes the position in the mail */ |
112 | QValueList<int> m_poslist; | 112 | Q3ValueList<int> m_poslist; |
113 | 113 | ||
114 | public: | 114 | public: |
115 | RecPart(); | 115 | RecPart(); |
116 | RecPart(const RecPart&); | 116 | RecPart(const RecPart&); |
117 | virtual ~RecPart(); | 117 | virtual ~RecPart(); |
118 | 118 | ||
@@ -133,24 +133,24 @@ public: | |||
133 | 133 | ||
134 | 134 | ||
135 | void setParameters(const part_plist_t&list); | 135 | void setParameters(const part_plist_t&list); |
136 | const part_plist_t&Parameters()const; | 136 | const part_plist_t&Parameters()const; |
137 | void addParameter(const QString&key,const QString&value); | 137 | void addParameter(const QString&key,const QString&value); |
138 | const QString searchParamter(const QString&key)const; | 138 | const QString searchParamter(const QString&key)const; |
139 | void setPositionlist(const QValueList<int>&poslist); | 139 | void setPositionlist(const Q3ValueList<int>&poslist); |
140 | const QValueList<int>& Positionlist()const; | 140 | const Q3ValueList<int>& Positionlist()const; |
141 | }; | 141 | }; |
142 | 142 | ||
143 | typedef Opie::Core::OSmartPointer<RecPart> RecPartP; | 143 | typedef Opie::Core::OSmartPointer<RecPart> RecPartP; |
144 | 144 | ||
145 | class RecBody:public Opie::Core::ORefCount | 145 | class RecBody:public Opie::Core::ORefCount |
146 | { | 146 | { |
147 | protected: | 147 | protected: |
148 | QString m_BodyText; | 148 | QString m_BodyText; |
149 | QString mCharset; | 149 | QString mCharset; |
150 | QValueList<RecPartP> m_PartsList; | 150 | Q3ValueList<RecPartP> m_PartsList; |
151 | RecPartP m_description; | 151 | RecPartP m_description; |
152 | 152 | ||
153 | public: | 153 | public: |
154 | RecBody(); | 154 | RecBody(); |
155 | RecBody(const RecBody&old); | 155 | RecBody(const RecBody&old); |
156 | virtual ~RecBody(); | 156 | virtual ~RecBody(); |
@@ -159,14 +159,14 @@ public: | |||
159 | void setCharset(const QString&); | 159 | void setCharset(const QString&); |
160 | QString getCharset()const; | 160 | QString getCharset()const; |
161 | 161 | ||
162 | void setDescription(const RecPartP&des); | 162 | void setDescription(const RecPartP&des); |
163 | const RecPartP& Description()const; | 163 | const RecPartP& Description()const; |
164 | 164 | ||
165 | void setParts(const QValueList<RecPartP>&parts); | 165 | void setParts(const Q3ValueList<RecPartP>&parts); |
166 | const QValueList<RecPartP>& Parts()const; | 166 | const Q3ValueList<RecPartP>& Parts()const; |
167 | void addPart(const RecPartP&part); | 167 | void addPart(const RecPartP&part); |
168 | }; | 168 | }; |
169 | 169 | ||
170 | typedef Opie::Core::OSmartPointer<RecBody> RecBodyP; | 170 | typedef Opie::Core::OSmartPointer<RecBody> RecBodyP; |
171 | 171 | ||
172 | class encodedString | 172 | class encodedString |
diff --git a/kmicromail/libmailwrapper/mailwrapper.cpp b/kmicromail/libmailwrapper/mailwrapper.cpp index 2ee1ab3..9c299e8 100644 --- a/kmicromail/libmailwrapper/mailwrapper.cpp +++ b/kmicromail/libmailwrapper/mailwrapper.cpp | |||
@@ -2,12 +2,14 @@ | |||
2 | #include <sys/stat.h> | 2 | #include <sys/stat.h> |
3 | #include <sys/types.h> | 3 | #include <sys/types.h> |
4 | #include <unistd.h> | 4 | #include <unistd.h> |
5 | #include <fcntl.h> | 5 | #include <fcntl.h> |
6 | #include <string.h> | 6 | #include <string.h> |
7 | #include <qdir.h> | 7 | #include <qdir.h> |
8 | //Added by qt3to4: | ||
9 | #include <Q3CString> | ||
8 | 10 | ||
9 | #include "mailwrapper.h" | 11 | #include "mailwrapper.h" |
10 | //#include "logindialog.h" | 12 | //#include "logindialog.h" |
11 | //#include "defines.h" | 13 | //#include "defines.h" |
12 | 14 | ||
13 | #define UNDEFINED 64 | 15 | #define UNDEFINED 64 |
@@ -78,37 +80,37 @@ static unsigned char base64chars[] = | |||
78 | QString IMAPFolder::decodeFolderName( const QString &name ) | 80 | QString IMAPFolder::decodeFolderName( const QString &name ) |
79 | { | 81 | { |
80 | unsigned char c, i, bitcount; | 82 | unsigned char c, i, bitcount; |
81 | unsigned long ucs4, utf16, bitbuf; | 83 | unsigned long ucs4, utf16, bitbuf; |
82 | unsigned char base64[256], utf8[6]; | 84 | unsigned char base64[256], utf8[6]; |
83 | unsigned long srcPtr = 0; | 85 | unsigned long srcPtr = 0; |
84 | QCString dst = ""; | 86 | Q3CString dst = ""; |
85 | QCString src = name.ascii(); | 87 | Q3CString src = name.ascii(); |
86 | 88 | ||
87 | /* initialize modified base64 decoding table */ | 89 | /* initialize modified base64 decoding table */ |
88 | memset(base64, UNDEFINED, sizeof(base64)); | 90 | memset(base64, UNDEFINED, sizeof(base64)); |
89 | for (i = 0; i < sizeof(base64chars); ++i) { | 91 | for (i = 0; i < sizeof(base64chars); ++i) { |
90 | base64[(int)base64chars[i]] = i; | 92 | base64[(int)base64chars[i]] = i; |
91 | } | 93 | } |
92 | 94 | ||
93 | /* loop until end of string */ | 95 | /* loop until end of string */ |
94 | while (srcPtr < src.length ()) { | 96 | while (srcPtr < src.length ()) { |
95 | c = src[srcPtr++]; | 97 | c = src.at(srcPtr++); |
96 | /* deal with literal characters and &- */ | 98 | /* deal with literal characters and &- */ |
97 | if (c != '&' || src[srcPtr] == '-') { | 99 | if (c != '&' || src.at(srcPtr) == '-') { |
98 | /* encode literally */ | 100 | /* encode literally */ |
99 | dst += c; | 101 | dst += c; |
100 | /* skip over the '-' if this is an &- sequence */ | 102 | /* skip over the '-' if this is an &- sequence */ |
101 | if (c == '&') | 103 | if (c == '&') |
102 | srcPtr++; | 104 | srcPtr++; |
103 | } else { | 105 | } else { |
104 | /* convert modified UTF-7 -> UTF-16 -> UCS-4 -> UTF-8 -> HEX */ | 106 | /* convert modified UTF-7 -> UTF-16 -> UCS-4 -> UTF-8 -> HEX */ |
105 | bitbuf = 0; | 107 | bitbuf = 0; |
106 | bitcount = 0; | 108 | bitcount = 0; |
107 | ucs4 = 0; | 109 | ucs4 = 0; |
108 | while ((c = base64[(unsigned char) src[srcPtr]]) != UNDEFINED) { | 110 | while ((c = base64[(unsigned char) src.at(srcPtr)]) != UNDEFINED) { |
109 | ++srcPtr; | 111 | ++srcPtr; |
110 | bitbuf = (bitbuf << 6) | c; | 112 | bitbuf = (bitbuf << 6) | c; |
111 | bitcount += 6; | 113 | bitcount += 6; |
112 | /* enough bits for a UTF-16 character? */ | 114 | /* enough bits for a UTF-16 character? */ |
113 | if (bitcount >= 16) { | 115 | if (bitcount >= 16) { |
114 | bitcount -= 16; | 116 | bitcount -= 16; |
@@ -146,13 +148,13 @@ QString IMAPFolder::decodeFolderName( const QString &name ) | |||
146 | for (c = 0; c < i; ++c) { | 148 | for (c = 0; c < i; ++c) { |
147 | dst += utf8[c]; | 149 | dst += utf8[c]; |
148 | } | 150 | } |
149 | } | 151 | } |
150 | } | 152 | } |
151 | /* skip over trailing '-' in modified UTF-7 encoding */ | 153 | /* skip over trailing '-' in modified UTF-7 encoding */ |
152 | if (src[srcPtr] == '-') | 154 | if (src.at(srcPtr) == '-') |
153 | ++srcPtr; | 155 | ++srcPtr; |
154 | } | 156 | } |
155 | } | 157 | } |
156 | 158 | ||
157 | return QString::fromUtf8( dst.data() ); | 159 | return QString::fromUtf8( dst.data() ); |
158 | } | 160 | } |
diff --git a/kmicromail/libmailwrapper/mailwrapper.h b/kmicromail/libmailwrapper/mailwrapper.h index 3e8b51f..bebabf4 100644 --- a/kmicromail/libmailwrapper/mailwrapper.h +++ b/kmicromail/libmailwrapper/mailwrapper.h | |||
@@ -3,12 +3,14 @@ | |||
3 | 3 | ||
4 | //#include <qpe/applnk.h> | 4 | //#include <qpe/applnk.h> |
5 | 5 | ||
6 | #include <qbitarray.h> | 6 | #include <qbitarray.h> |
7 | #include <qdatetime.h> | 7 | #include <qdatetime.h> |
8 | #include <qfileinfo.h> | 8 | #include <qfileinfo.h> |
9 | //Added by qt3to4: | ||
10 | #include <QPixmap> | ||
9 | #include <kiconloader.h> | 11 | #include <kiconloader.h> |
10 | 12 | ||
11 | #include "settings.h" | 13 | #include "settings.h" |
12 | 14 | ||
13 | #include <opie2/osmartpointer.h> | 15 | #include <opie2/osmartpointer.h> |
14 | /* | 16 | /* |
@@ -58,13 +60,13 @@ public: | |||
58 | * 'cause it seems that it will never have some child classes. | 60 | * 'cause it seems that it will never have some child classes. |
59 | * in this case this object will not get a virtual table -> memory and | 61 | * in this case this object will not get a virtual table -> memory and |
60 | * speed will be a little bit better? | 62 | * speed will be a little bit better? |
61 | */ | 63 | */ |
62 | virtual ~Mail(){} | 64 | virtual ~Mail(){} |
63 | void addAttachment( Attachment *att ) { attList.append( att ); } | 65 | void addAttachment( Attachment *att ) { attList.append( att ); } |
64 | const QList<Attachment>& getAttachments()const { return attList; } | 66 | const QList<Attachment*>& getAttachments()const { return attList; } |
65 | void removeAttachment( Attachment *att ) { attList.remove( att ); } | 67 | void removeAttachment( Attachment *att ) { attList.remove( att ); } |
66 | const QString&getName()const { return name; } | 68 | const QString&getName()const { return name; } |
67 | void setName( QString s ) { name = s; } | 69 | void setName( QString s ) { name = s; } |
68 | const QString&getMail()const{ return mail; } | 70 | const QString&getMail()const{ return mail; } |
69 | void setMail( const QString&s ) { mail = s; } | 71 | void setMail( const QString&s ) { mail = s; } |
70 | const QString&getTo()const{ return to; } | 72 | const QString&getTo()const{ return to; } |
@@ -83,13 +85,13 @@ public: | |||
83 | const QStringList&Inreply()const{return m_in_reply_to;} | 85 | const QStringList&Inreply()const{return m_in_reply_to;} |
84 | 86 | ||
85 | void setCharset( const QString&a ) { charset= a; } | 87 | void setCharset( const QString&a ) { charset= a; } |
86 | const QString& getCharset() const { return charset; } | 88 | const QString& getCharset() const { return charset; } |
87 | 89 | ||
88 | private: | 90 | private: |
89 | QList<Attachment> attList; | 91 | QList<Attachment*> attList; |
90 | QString name, mail, to, cc, bcc, reply, subject, message, charset; | 92 | QString name, mail, to, cc, bcc, reply, subject, message, charset; |
91 | QStringList m_in_reply_to; | 93 | QStringList m_in_reply_to; |
92 | }; | 94 | }; |
93 | 95 | ||
94 | class Folder:public Opie::Core::ORefCount | 96 | class Folder:public Opie::Core::ORefCount |
95 | { | 97 | { |
diff --git a/kmicromail/libmailwrapper/mboxwrapper.cpp b/kmicromail/libmailwrapper/mboxwrapper.cpp index 87f8c8a..888cae2 100644 --- a/kmicromail/libmailwrapper/mboxwrapper.cpp +++ b/kmicromail/libmailwrapper/mboxwrapper.cpp | |||
@@ -1,11 +1,13 @@ | |||
1 | #include "mboxwrapper.h" | 1 | #include "mboxwrapper.h" |
2 | #include "mailtypes.h" | 2 | #include "mailtypes.h" |
3 | #include "mailwrapper.h" | 3 | #include "mailwrapper.h" |
4 | #include <libetpan/libetpan.h> | 4 | #include <libetpan/libetpan.h> |
5 | #include <qdir.h> | 5 | #include <qdir.h> |
6 | //Added by qt3to4: | ||
7 | #include <Q3ValueList> | ||
6 | #include <stdlib.h> | 8 | #include <stdlib.h> |
7 | #include <klocale.h> | 9 | #include <klocale.h> |
8 | 10 | ||
9 | 11 | ||
10 | #include <qpe/global.h> | 12 | #include <qpe/global.h> |
11 | 13 | ||
@@ -20,13 +22,13 @@ MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) | |||
20 | } | 22 | } |
21 | 23 | ||
22 | MBOXwrapper::~MBOXwrapper() | 24 | MBOXwrapper::~MBOXwrapper() |
23 | { | 25 | { |
24 | } | 26 | } |
25 | 27 | ||
26 | void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target ) | 28 | void MBOXwrapper::listMessages(const QString & mailbox, Q3ValueList<RecMailP> &target ) |
27 | { | 29 | { |
28 | mailstorage*storage = mailstorage_new(NULL); | 30 | mailstorage*storage = mailstorage_new(NULL); |
29 | QString p = MBOXPath+"/"; | 31 | QString p = MBOXPath+"/"; |
30 | p+=mailbox; | 32 | p+=mailbox; |
31 | 33 | ||
32 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 34 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
@@ -45,15 +47,15 @@ void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &ta | |||
45 | mailfolder_disconnect(folder); | 47 | mailfolder_disconnect(folder); |
46 | mailfolder_free(folder); | 48 | mailfolder_free(folder); |
47 | mailstorage_free(storage); | 49 | mailstorage_free(storage); |
48 | Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); | 50 | Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); |
49 | } | 51 | } |
50 | 52 | ||
51 | QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() | 53 | Q3ValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() |
52 | { | 54 | { |
53 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); | 55 | Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); |
54 | QDir dir(MBOXPath); | 56 | QDir dir(MBOXPath); |
55 | if (!dir.exists()) return folders; | 57 | if (!dir.exists()) return folders; |
56 | dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); | 58 | dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); |
57 | QStringList entries = dir.entryList(); | 59 | QStringList entries = dir.entryList(); |
58 | QStringList::ConstIterator it = entries.begin(); | 60 | QStringList::ConstIterator it = entries.begin(); |
59 | for (;it!=entries.end();++it) { | 61 | for (;it!=entries.end();++it) { |
@@ -214,13 +216,13 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail) | |||
214 | mailfolder_free(folder); | 216 | mailfolder_free(folder); |
215 | mailstorage_free(storage); | 217 | mailstorage_free(storage); |
216 | mailmessage_free(msg); | 218 | mailmessage_free(msg); |
217 | return result; | 219 | return result; |
218 | } | 220 | } |
219 | 221 | ||
220 | void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) | 222 | void MBOXwrapper::deleteMails(const QString & mailbox,const Q3ValueList<RecMailP> &target) |
221 | { | 223 | { |
222 | QString p = MBOXPath+"/"; | 224 | QString p = MBOXPath+"/"; |
223 | p+=mailbox; | 225 | p+=mailbox; |
224 | mailmbox_folder*f = 0; | 226 | mailmbox_folder*f = 0; |
225 | int r = mailmbox_init(p.latin1(),0,1,0,&f); | 227 | int r = mailmbox_init(p.latin1(),0,1,0,&f); |
226 | if (r != MAIL_NO_ERROR) { | 228 | if (r != MAIL_NO_ERROR) { |
@@ -228,17 +230,17 @@ void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> | |||
228 | return; | 230 | return; |
229 | } | 231 | } |
230 | deleteMails(f,target); | 232 | deleteMails(f,target); |
231 | mailmbox_done(f); | 233 | mailmbox_done(f); |
232 | } | 234 | } |
233 | 235 | ||
234 | void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target) | 236 | void MBOXwrapper::deleteMails(mailmbox_folder*f,const Q3ValueList<RecMailP> &target) |
235 | { | 237 | { |
236 | if (!f) return; | 238 | if (!f) return; |
237 | int r; | 239 | int r; |
238 | QValueList<RecMailP>::ConstIterator it; | 240 | Q3ValueList<RecMailP>::ConstIterator it; |
239 | for (it=target.begin(); it != target.end();++it) { | 241 | for (it=target.begin(); it != target.end();++it) { |
240 | r = mailmbox_delete_msg(f,(*it)->getNumber()); | 242 | r = mailmbox_delete_msg(f,(*it)->getNumber()); |
241 | if (r!=MAILMBOX_NO_ERROR) { | 243 | if (r!=MAILMBOX_NO_ERROR) { |
242 | ; // << "error delete mail" << oendl; | 244 | ; // << "error delete mail" << oendl; |
243 | } | 245 | } |
244 | } | 246 | } |
diff --git a/kmicromail/libmailwrapper/mboxwrapper.h b/kmicromail/libmailwrapper/mboxwrapper.h index d03940f..e658a71 100644 --- a/kmicromail/libmailwrapper/mboxwrapper.h +++ b/kmicromail/libmailwrapper/mboxwrapper.h | |||
@@ -1,25 +1,27 @@ | |||
1 | #ifndef __MBOX_WRAPPER_H | 1 | #ifndef __MBOX_WRAPPER_H |
2 | #define __MBOX_WRAPPER_H | 2 | #define __MBOX_WRAPPER_H |
3 | 3 | ||
4 | #include "genericwrapper.h" | 4 | #include "genericwrapper.h" |
5 | #include <qstring.h> | 5 | #include <qstring.h> |
6 | //Added by qt3to4: | ||
7 | #include <Q3ValueList> | ||
6 | 8 | ||
7 | class encodedString; | 9 | class encodedString; |
8 | struct mailmbox_folder; | 10 | struct mailmbox_folder; |
9 | 11 | ||
10 | class MBOXwrapper : public Genericwrapper | 12 | class MBOXwrapper : public Genericwrapper |
11 | { | 13 | { |
12 | Q_OBJECT | 14 | Q_OBJECT |
13 | 15 | ||
14 | public: | 16 | public: |
15 | MBOXwrapper(const QString & dir,const QString&name); | 17 | MBOXwrapper(const QString & dir,const QString&name); |
16 | virtual ~MBOXwrapper(); | 18 | virtual ~MBOXwrapper(); |
17 | 19 | ||
18 | virtual void listMessages(const QString & mailbox, QValueList<RecMailP>&target ); | 20 | virtual void listMessages(const QString & mailbox, Q3ValueList<RecMailP>&target ); |
19 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); | 21 | virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); |
20 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 22 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
21 | 23 | ||
22 | virtual void deleteMail(const RecMailP&mail); | 24 | virtual void deleteMail(const RecMailP&mail); |
23 | virtual void answeredMail(const RecMailP&mail); | 25 | virtual void answeredMail(const RecMailP&mail); |
24 | 26 | ||
25 | virtual int createMbox(const QString&folder,const Opie::Core::OSmartPointer<Folder>&f=0, | 27 | virtual int createMbox(const QString&folder,const Opie::Core::OSmartPointer<Folder>&f=0, |
@@ -29,19 +31,19 @@ public: | |||
29 | 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); |
30 | 32 | ||
31 | virtual RecBodyP fetchBody( const RecMailP &mail ); | 33 | virtual RecBodyP fetchBody( const RecMailP &mail ); |
32 | static void mbox_progress( size_t current, size_t maximum ); | 34 | static void mbox_progress( size_t current, size_t maximum ); |
33 | 35 | ||
34 | virtual encodedString* fetchRawBody(const RecMailP&mail); | 36 | virtual encodedString* fetchRawBody(const RecMailP&mail); |
35 | virtual void deleteMails(const QString & FolderName,const QValueList<RecMailP> &target); | 37 | virtual void deleteMails(const QString & FolderName,const Q3ValueList<RecMailP> &target); |
36 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); | 38 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); |
37 | virtual MAILLIB::ATYPE getType()const; | 39 | virtual MAILLIB::ATYPE getType()const; |
38 | virtual const QString&getName()const; | 40 | virtual const QString&getName()const; |
39 | virtual Account* getAccount() { return 0; }; | 41 | virtual Account* getAccount() { return 0; }; |
40 | 42 | ||
41 | protected: | 43 | protected: |
42 | static void deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target); | 44 | static void deleteMails(mailmbox_folder*f,const Q3ValueList<RecMailP> &target); |
43 | QString MBOXPath; | 45 | QString MBOXPath; |
44 | QString MBOXName; | 46 | QString MBOXName; |
45 | }; | 47 | }; |
46 | 48 | ||
47 | #endif | 49 | #endif |
diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp index 787e85d..4cd7a94 100644 --- a/kmicromail/libmailwrapper/mhwrapper.cpp +++ b/kmicromail/libmailwrapper/mhwrapper.cpp | |||
@@ -2,12 +2,14 @@ | |||
2 | #include "mhwrapper.h" | 2 | #include "mhwrapper.h" |
3 | #include "mailtypes.h" | 3 | #include "mailtypes.h" |
4 | #include "mailwrapper.h" | 4 | #include "mailwrapper.h" |
5 | #include <libetpan/libetpan.h> | 5 | #include <libetpan/libetpan.h> |
6 | #include <qdir.h> | 6 | #include <qdir.h> |
7 | #include <qmessagebox.h> | 7 | #include <qmessagebox.h> |
8 | //Added by qt3to4: | ||
9 | #include <Q3ValueList> | ||
8 | #include <stdlib.h> | 10 | #include <stdlib.h> |
9 | #include <qpe/global.h> | 11 | #include <qpe/global.h> |
10 | #include <klocale.h> | 12 | #include <klocale.h> |
11 | #include <kglobal.h> | 13 | #include <kglobal.h> |
12 | //#include <opie2/odebug.h> | 14 | //#include <opie2/odebug.h> |
13 | 15 | ||
@@ -61,13 +63,13 @@ void MHwrapper::clean_storage() | |||
61 | 63 | ||
62 | MHwrapper::~MHwrapper() | 64 | MHwrapper::~MHwrapper() |
63 | { | 65 | { |
64 | clean_storage(); | 66 | clean_storage(); |
65 | } | 67 | } |
66 | 68 | ||
67 | void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) | 69 | void MHwrapper::listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) |
68 | { | 70 | { |
69 | init_storage(); | 71 | init_storage(); |
70 | if (!m_storage) { | 72 | if (!m_storage) { |
71 | return; | 73 | return; |
72 | } | 74 | } |
73 | QString f = buildPath(mailbox); | 75 | QString f = buildPath(mailbox); |
@@ -77,15 +79,15 @@ void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSm | |||
77 | return; | 79 | return; |
78 | } | 80 | } |
79 | parseList(target,m_storage->sto_session,f, false, maxSizeInKb ); | 81 | parseList(target,m_storage->sto_session,f, false, maxSizeInKb ); |
80 | Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); | 82 | Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); |
81 | } | 83 | } |
82 | 84 | ||
83 | QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() | 85 | Q3ValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() |
84 | { | 86 | { |
85 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); | 87 | Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); |
86 | /* this is needed! */ | 88 | /* this is needed! */ |
87 | if (m_storage) mailstorage_disconnect(m_storage); | 89 | if (m_storage) mailstorage_disconnect(m_storage); |
88 | init_storage(); | 90 | init_storage(); |
89 | if (!m_storage) { | 91 | if (!m_storage) { |
90 | return folders; | 92 | return folders; |
91 | } | 93 | } |
@@ -252,21 +254,21 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) | |||
252 | } | 254 | } |
253 | result = new encodedString(data,size); | 255 | result = new encodedString(data,size); |
254 | if (msg) mailmessage_free(msg); | 256 | if (msg) mailmessage_free(msg); |
255 | return result; | 257 | return result; |
256 | } | 258 | } |
257 | 259 | ||
258 | void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) | 260 | void MHwrapper::deleteMails(const QString & mailbox,const Q3ValueList<RecMailP> &target) |
259 | { | 261 | { |
260 | QString f = buildPath(mailbox); | 262 | QString f = buildPath(mailbox); |
261 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); | 263 | int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); |
262 | if (r!=MAIL_NO_ERROR) { | 264 | if (r!=MAIL_NO_ERROR) { |
263 | qDebug("deleteMails: error selecting folder! "); | 265 | qDebug("deleteMails: error selecting folder! "); |
264 | return; | 266 | return; |
265 | } | 267 | } |
266 | QValueList<RecMailP>::ConstIterator it; | 268 | Q3ValueList<RecMailP>::ConstIterator it; |
267 | for (it=target.begin(); it!=target.end();++it) { | 269 | for (it=target.begin(); it!=target.end();++it) { |
268 | r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); | 270 | r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); |
269 | if (r != MAIL_NO_ERROR) { | 271 | if (r != MAIL_NO_ERROR) { |
270 | qDebug("error deleting mail "); | 272 | qDebug("error deleting mail "); |
271 | break; | 273 | break; |
272 | } | 274 | } |
diff --git a/kmicromail/libmailwrapper/mhwrapper.h b/kmicromail/libmailwrapper/mhwrapper.h index 36a443a..6151ff1 100644 --- a/kmicromail/libmailwrapper/mhwrapper.h +++ b/kmicromail/libmailwrapper/mhwrapper.h | |||
@@ -3,24 +3,26 @@ | |||
3 | #define __MH_WRAPPER_H | 3 | #define __MH_WRAPPER_H |
4 | 4 | ||
5 | #include "maildefines.h" | 5 | #include "maildefines.h" |
6 | 6 | ||
7 | #include "genericwrapper.h" | 7 | #include "genericwrapper.h" |
8 | #include <qstring.h> | 8 | #include <qstring.h> |
9 | //Added by qt3to4: | ||
10 | #include <Q3ValueList> | ||
9 | 11 | ||
10 | class encodedString; | 12 | class encodedString; |
11 | struct mailmbox_folder; | 13 | struct mailmbox_folder; |
12 | class MHwrapper : public Genericwrapper | 14 | class MHwrapper : public Genericwrapper |
13 | { | 15 | { |
14 | Q_OBJECT | 16 | Q_OBJECT |
15 | public: | 17 | public: |
16 | MHwrapper(const QString & dir,const QString&name); | 18 | MHwrapper(const QString & dir,const QString&name); |
17 | virtual ~MHwrapper(); | 19 | virtual ~MHwrapper(); |
18 | 20 | ||
19 | virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); | 21 | virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); |
20 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); | 22 | virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); |
21 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 23 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
22 | 24 | ||
23 | virtual void deleteMail(const RecMailP&mail); | 25 | virtual void deleteMail(const RecMailP&mail); |
24 | virtual void answeredMail(const RecMailP&mail); | 26 | virtual void answeredMail(const RecMailP&mail); |
25 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); | 27 | virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); |
26 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, | 28 | virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, |
@@ -33,13 +35,13 @@ public: | |||
33 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); | 35 | virtual void storeMessage(const char*msg,size_t length, const QString&folder); |
34 | 36 | ||
35 | virtual RecBodyP fetchBody( const RecMailP &mail ); | 37 | virtual RecBodyP fetchBody( const RecMailP &mail ); |
36 | static void mbox_progress( size_t current, size_t maximum ); | 38 | static void mbox_progress( size_t current, size_t maximum ); |
37 | 39 | ||
38 | virtual encodedString* fetchRawBody(const RecMailP&mail); | 40 | virtual encodedString* fetchRawBody(const RecMailP&mail); |
39 | virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> > &target); | 41 | virtual void deleteMails(const QString & FolderName,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target); |
40 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); | 42 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); |
41 | virtual MAILLIB::ATYPE getType()const; | 43 | virtual MAILLIB::ATYPE getType()const; |
42 | virtual const QString&getName()const; | 44 | virtual const QString&getName()const; |
43 | virtual Account* getAccount() { return 0; }; | 45 | virtual Account* getAccount() { return 0; }; |
44 | 46 | ||
45 | public slots: | 47 | public slots: |
diff --git a/kmicromail/libmailwrapper/nntpwrapper.cpp b/kmicromail/libmailwrapper/nntpwrapper.cpp index 93cd2b5..b328ecd 100644 --- a/kmicromail/libmailwrapper/nntpwrapper.cpp +++ b/kmicromail/libmailwrapper/nntpwrapper.cpp | |||
@@ -1,12 +1,14 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | #include "nntpwrapper.h" | 2 | #include "nntpwrapper.h" |
3 | #include "logindialog.h" | 3 | #include "logindialog.h" |
4 | #include "mailtypes.h" | 4 | #include "mailtypes.h" |
5 | 5 | ||
6 | #include <qfile.h> | 6 | #include <qfile.h> |
7 | //Added by qt3to4: | ||
8 | #include <Q3ValueList> | ||
7 | 9 | ||
8 | #include <stdlib.h> | 10 | #include <stdlib.h> |
9 | 11 | ||
10 | #include <libetpan/libetpan.h> | 12 | #include <libetpan/libetpan.h> |
11 | 13 | ||
12 | 14 | ||
@@ -57,20 +59,20 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { | |||
57 | cleanMimeCache(); | 59 | cleanMimeCache(); |
58 | 60 | ||
59 | if (mail->getNumber()!=last_msg_id) { | 61 | if (mail->getNumber()!=last_msg_id) { |
60 | if (msg_cache.exists()) { | 62 | if (msg_cache.exists()) { |
61 | msg_cache.remove(); | 63 | msg_cache.remove(); |
62 | } | 64 | } |
63 | msg_cache.open(IO_ReadWrite|IO_Truncate); | 65 | msg_cache.open(QIODevice::ReadWrite|QIODevice::Truncate); |
64 | last_msg_id = mail->getNumber(); | 66 | last_msg_id = mail->getNumber(); |
65 | err = mailsession_get_message(m_nntp->sto_session, mail->getNumber(), &mailmsg); | 67 | err = mailsession_get_message(m_nntp->sto_session, mail->getNumber(), &mailmsg); |
66 | err = mailmessage_fetch(mailmsg,&message,&length); | 68 | err = mailmessage_fetch(mailmsg,&message,&length); |
67 | msg_cache.writeBlock(message,length); | 69 | msg_cache.writeBlock(message,length); |
68 | } else { | 70 | } else { |
69 | QString msg=""; | 71 | QString msg=""; |
70 | msg_cache.open(IO_ReadOnly); | 72 | msg_cache.open(QIODevice::ReadOnly); |
71 | message = new char[4096]; | 73 | message = new char[4096]; |
72 | memset(message,0,4096); | 74 | memset(message,0,4096); |
73 | while (msg_cache.readBlock(message,4095)>0) { | 75 | while (msg_cache.readBlock(message,4095)>0) { |
74 | msg+=message; | 76 | msg+=message; |
75 | memset(message,0,4096); | 77 | memset(message,0,4096); |
76 | } | 78 | } |
@@ -96,13 +98,13 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { | |||
96 | free(message); | 98 | free(message); |
97 | 99 | ||
98 | return body; | 100 | return body; |
99 | } | 101 | } |
100 | 102 | ||
101 | 103 | ||
102 | void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb) | 104 | void NNTPwrapper::listMessages(const QString & which, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb) |
103 | { | 105 | { |
104 | login(); | 106 | login(); |
105 | if (!m_nntp) | 107 | if (!m_nntp) |
106 | return; | 108 | return; |
107 | uint32_t res_messages,res_recent,res_unseen; | 109 | uint32_t res_messages,res_recent,res_unseen; |
108 | mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); | 110 | mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); |
@@ -183,15 +185,15 @@ void NNTPwrapper::logout() | |||
183 | if ( m_nntp == NULL ) | 185 | if ( m_nntp == NULL ) |
184 | return; | 186 | return; |
185 | mailstorage_free(m_nntp); | 187 | mailstorage_free(m_nntp); |
186 | m_nntp = 0; | 188 | m_nntp = 0; |
187 | } | 189 | } |
188 | 190 | ||
189 | QValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { | 191 | Q3ValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { |
190 | 192 | ||
191 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); | 193 | Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); |
192 | QStringList groups; | 194 | QStringList groups; |
193 | if (account) { | 195 | if (account) { |
194 | groups = account->getGroups(); | 196 | groups = account->getGroups(); |
195 | } | 197 | } |
196 | for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) { | 198 | for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) { |
197 | folders->append(new Folder((*it),".")); | 199 | folders->append(new Folder((*it),".")); |
diff --git a/kmicromail/libmailwrapper/nntpwrapper.h b/kmicromail/libmailwrapper/nntpwrapper.h index 8c54f12..7c8e671 100644 --- a/kmicromail/libmailwrapper/nntpwrapper.h +++ b/kmicromail/libmailwrapper/nntpwrapper.h | |||
@@ -2,12 +2,14 @@ | |||
2 | #ifndef __NNTPWRAPPER | 2 | #ifndef __NNTPWRAPPER |
3 | #define __NNTPWRAPPER | 3 | #define __NNTPWRAPPER |
4 | 4 | ||
5 | #include "mailwrapper.h" | 5 | #include "mailwrapper.h" |
6 | #include "genericwrapper.h" | 6 | #include "genericwrapper.h" |
7 | #include <qstring.h> | 7 | #include <qstring.h> |
8 | //Added by qt3to4: | ||
9 | #include <Q3ValueList> | ||
8 | #include <libetpan/clist.h> | 10 | #include <libetpan/clist.h> |
9 | 11 | ||
10 | class encodedString; | 12 | class encodedString; |
11 | struct mailstorage; | 13 | struct mailstorage; |
12 | struct mailfolder; | 14 | struct mailfolder; |
13 | 15 | ||
@@ -18,15 +20,15 @@ class NNTPwrapper : public Genericwrapper | |||
18 | 20 | ||
19 | public: | 21 | public: |
20 | NNTPwrapper( NNTPaccount *a ); | 22 | NNTPwrapper( NNTPaccount *a ); |
21 | virtual ~NNTPwrapper(); | 23 | virtual ~NNTPwrapper(); |
22 | 24 | ||
23 | /* mailbox will be ignored */ | 25 | /* mailbox will be ignored */ |
24 | virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); | 26 | virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); |
25 | /* should only get the subscribed one */ | 27 | /* should only get the subscribed one */ |
26 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); | 28 | virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); |
27 | /* mailbox will be ignored */ | 29 | /* mailbox will be ignored */ |
28 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 30 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
29 | QStringList listAllNewsgroups(const QString&mask = QString::null); | 31 | QStringList listAllNewsgroups(const QString&mask = QString::null); |
30 | virtual void deleteMail(const RecMailP&mail); | 32 | virtual void deleteMail(const RecMailP&mail); |
31 | virtual void answeredMail(const RecMailP&mail); | 33 | virtual void answeredMail(const RecMailP&mail); |
32 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); | 34 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); |
diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp index 2888f7c..ebeed71 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.cpp +++ b/kmicromail/libmailwrapper/pop3wrapper.cpp | |||
@@ -6,14 +6,16 @@ | |||
6 | #include <libetpan/libetpan.h> | 6 | #include <libetpan/libetpan.h> |
7 | 7 | ||
8 | #include <klocale.h> | 8 | #include <klocale.h> |
9 | 9 | ||
10 | #include <qpe/global.h> | 10 | #include <qpe/global.h> |
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qprogressbar.h> | 12 | #include <q3progressbar.h> |
13 | #include <qapplication.h> | 13 | #include <qapplication.h> |
14 | //Added by qt3to4: | ||
15 | #include <Q3ValueList> | ||
14 | 16 | ||
15 | /* we don't fetch messages larger than 5 MB */ | 17 | /* we don't fetch messages larger than 5 MB */ |
16 | #define HARD_MSG_SIZE_LIMIT 5242880 | 18 | #define HARD_MSG_SIZE_LIMIT 5242880 |
17 | 19 | ||
18 | using namespace Opie::Core; | 20 | using namespace Opie::Core; |
19 | POP3wrapper::POP3wrapper( POP3account *a ) | 21 | POP3wrapper::POP3wrapper( POP3account *a ) |
@@ -59,20 +61,20 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { | |||
59 | cleanMimeCache(); | 61 | cleanMimeCache(); |
60 | 62 | ||
61 | if (mail->getNumber()!=last_msg_id) { | 63 | if (mail->getNumber()!=last_msg_id) { |
62 | if (msg_cache.exists()) { | 64 | if (msg_cache.exists()) { |
63 | msg_cache.remove(); | 65 | msg_cache.remove(); |
64 | } | 66 | } |
65 | msg_cache.open(IO_ReadWrite|IO_Truncate); | 67 | msg_cache.open(QIODevice::ReadWrite|QIODevice::Truncate); |
66 | last_msg_id = mail->getNumber(); | 68 | last_msg_id = mail->getNumber(); |
67 | err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); | 69 | err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); |
68 | err = mailmessage_fetch(mailmsg,&message,&length); | 70 | err = mailmessage_fetch(mailmsg,&message,&length); |
69 | msg_cache.writeBlock(message,length); | 71 | msg_cache.writeBlock(message,length); |
70 | } else { | 72 | } else { |
71 | QString msg=""; | 73 | QString msg=""; |
72 | msg_cache.open(IO_ReadOnly); | 74 | msg_cache.open(QIODevice::ReadOnly); |
73 | message = new char[4096]; | 75 | message = new char[4096]; |
74 | memset(message,0,4096); | 76 | memset(message,0,4096); |
75 | while (msg_cache.readBlock(message,4095)>0) { | 77 | while (msg_cache.readBlock(message,4095)>0) { |
76 | msg+=message; | 78 | msg+=message; |
77 | memset(message,0,4096); | 79 | memset(message,0,4096); |
78 | } | 80 | } |
@@ -97,13 +99,13 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { | |||
97 | if (message) | 99 | if (message) |
98 | free(message); | 100 | free(message); |
99 | 101 | ||
100 | return body; | 102 | return body; |
101 | } | 103 | } |
102 | 104 | ||
103 | void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) | 105 | void POP3wrapper::listMessages(const QString &, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) |
104 | { | 106 | { |
105 | login(); | 107 | login(); |
106 | if (!m_pop3) | 108 | if (!m_pop3) |
107 | return; | 109 | return; |
108 | uint32_t res_messages,res_recent,res_unseen; | 110 | uint32_t res_messages,res_recent,res_unseen; |
109 | mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); | 111 | mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); |
@@ -184,28 +186,28 @@ void POP3wrapper::logout() | |||
184 | return; | 186 | return; |
185 | mailstorage_free(m_pop3); | 187 | mailstorage_free(m_pop3); |
186 | m_pop3 = 0; | 188 | m_pop3 = 0; |
187 | } | 189 | } |
188 | 190 | ||
189 | 191 | ||
190 | QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { | 192 | Q3ValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { |
191 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<FolderP>(); | 193 | Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<FolderP>(); |
192 | FolderP inb=new Folder("INBOX","/"); | 194 | FolderP inb=new Folder("INBOX","/"); |
193 | folders->append(inb); | 195 | folders->append(inb); |
194 | return folders; | 196 | return folders; |
195 | } | 197 | } |
196 | 198 | ||
197 | void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) | 199 | void POP3wrapper::deleteMailList(const Q3ValueList<RecMailP>&target) |
198 | { | 200 | { |
199 | login(); | 201 | login(); |
200 | if (!m_pop3) | 202 | if (!m_pop3) |
201 | return; | 203 | return; |
202 | int iii = 0; | 204 | int iii = 0; |
203 | int count = target.count(); | 205 | int count = target.count(); |
204 | 206 | ||
205 | QProgressBar wid ( count ); | 207 | Q3ProgressBar wid ( count ); |
206 | wid.setCaption( i18n("Deleting ...")); | 208 | wid.setCaption( i18n("Deleting ...")); |
207 | wid.show(); | 209 | wid.show(); |
208 | while (iii < count ) { | 210 | while (iii < count ) { |
209 | Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); | 211 | Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); |
210 | wid.setProgress( iii ); | 212 | wid.setProgress( iii ); |
211 | wid.raise(); | 213 | wid.raise(); |
@@ -243,13 +245,13 @@ int POP3wrapper::deleteAllMail(const FolderP&) { | |||
243 | Global::statusMessage(i18n("Error getting folder info")); | 245 | Global::statusMessage(i18n("Error getting folder info")); |
244 | return 0; | 246 | return 0; |
245 | } | 247 | } |
246 | 248 | ||
247 | 249 | ||
248 | 250 | ||
249 | QProgressBar wid ( result ); | 251 | Q3ProgressBar wid ( result ); |
250 | wid.setCaption( i18n("Deleting ...")); | 252 | wid.setCaption( i18n("Deleting ...")); |
251 | wid.show(); | 253 | wid.show(); |
252 | for (unsigned int i = 0; i < result; ++i) { | 254 | for (unsigned int i = 0; i < result; ++i) { |
253 | Global::statusMessage(i18n("Delete message %1 of %2").arg(i).arg(result)); | 255 | Global::statusMessage(i18n("Delete message %1 of %2").arg(i).arg(result)); |
254 | wid.setProgress( i ); | 256 | wid.setProgress( i ); |
255 | wid.raise(); | 257 | wid.raise(); |
diff --git a/kmicromail/libmailwrapper/pop3wrapper.h b/kmicromail/libmailwrapper/pop3wrapper.h index ebc2fc7..a077877 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.h +++ b/kmicromail/libmailwrapper/pop3wrapper.h | |||
@@ -2,12 +2,14 @@ | |||
2 | #ifndef __POP3WRAPPER | 2 | #ifndef __POP3WRAPPER |
3 | #define __POP3WRAPPER | 3 | #define __POP3WRAPPER |
4 | 4 | ||
5 | #include "mailwrapper.h" | 5 | #include "mailwrapper.h" |
6 | #include "genericwrapper.h" | 6 | #include "genericwrapper.h" |
7 | #include <qstring.h> | 7 | #include <qstring.h> |
8 | //Added by qt3to4: | ||
9 | #include <Q3ValueList> | ||
8 | 10 | ||
9 | class encodedString; | 11 | class encodedString; |
10 | struct mailstorage; | 12 | struct mailstorage; |
11 | struct mailfolder; | 13 | struct mailfolder; |
12 | 14 | ||
13 | class POP3wrapper : public Genericwrapper | 15 | class POP3wrapper : public Genericwrapper |
@@ -15,19 +17,19 @@ class POP3wrapper : public Genericwrapper | |||
15 | Q_OBJECT | 17 | Q_OBJECT |
16 | 18 | ||
17 | public: | 19 | public: |
18 | POP3wrapper( POP3account *a ); | 20 | POP3wrapper( POP3account *a ); |
19 | virtual ~POP3wrapper(); | 21 | virtual ~POP3wrapper(); |
20 | /* mailbox will be ignored */ | 22 | /* mailbox will be ignored */ |
21 | virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); | 23 | virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); |
22 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); | 24 | virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); |
23 | /* mailbox will be ignored */ | 25 | /* mailbox will be ignored */ |
24 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 26 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
25 | 27 | ||
26 | virtual void deleteMail(const RecMailP&mail); | 28 | virtual void deleteMail(const RecMailP&mail); |
27 | virtual void deleteMailList(const QValueList<RecMailP>&target); | 29 | virtual void deleteMailList(const Q3ValueList<RecMailP>&target); |
28 | virtual void answeredMail(const RecMailP&mail); | 30 | virtual void answeredMail(const RecMailP&mail); |
29 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); | 31 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); |
30 | 32 | ||
31 | virtual RecBodyP fetchBody( const RecMailP &mail ); | 33 | virtual RecBodyP fetchBody( const RecMailP &mail ); |
32 | virtual encodedString* fetchRawBody(const RecMailP&mail); | 34 | virtual encodedString* fetchRawBody(const RecMailP&mail); |
33 | virtual void logout(); | 35 | virtual void logout(); |
diff --git a/kmicromail/libmailwrapper/sendmailprogress.cpp b/kmicromail/libmailwrapper/sendmailprogress.cpp index 20dfe9b..6cd6409 100644 --- a/kmicromail/libmailwrapper/sendmailprogress.cpp +++ b/kmicromail/libmailwrapper/sendmailprogress.cpp | |||
@@ -1,8 +1,8 @@ | |||
1 | #include "sendmailprogress.h" | 1 | #include "sendmailprogress.h" |
2 | #include <qprogressbar.h> | 2 | #include <q3progressbar.h> |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <klocale.h> | 4 | #include <klocale.h> |
5 | 5 | ||
6 | progressMailSend::progressMailSend(QWidget*parent, const char * name) | 6 | progressMailSend::progressMailSend(QWidget*parent, const char * name) |
7 | :progressMailSendUI(parent,name,true),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0) | 7 | :progressMailSendUI(parent,name,true),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0) |
8 | { | 8 | { |
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index 9436d43..fc01528 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp | |||
@@ -1,11 +1,11 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <qdir.h> | 2 | #include <qdir.h> |
3 | 3 | ||
4 | #include <qtextcodec.h> | 4 | #include <qtextcodec.h> |
5 | #include <qtextstream.h> | 5 | #include <q3textstream.h> |
6 | #include <qfile.h> | 6 | #include <qfile.h> |
7 | 7 | ||
8 | //#include <opie2/odebug.h> | 8 | //#include <opie2/odebug.h> |
9 | #include <kconfig.h> | 9 | #include <kconfig.h> |
10 | 10 | ||
11 | #include <kstandarddirs.h> | 11 | #include <kstandarddirs.h> |
@@ -373,17 +373,17 @@ QString SMTPaccount::getSignature() | |||
373 | { | 373 | { |
374 | QFileInfo fi ( signature ); | 374 | QFileInfo fi ( signature ); |
375 | if ( ! fi.exists() ) | 375 | if ( ! fi.exists() ) |
376 | return QString(); | 376 | return QString(); |
377 | 377 | ||
378 | QFile file( signature ); | 378 | QFile file( signature ); |
379 | if (!file.open( IO_ReadOnly ) ) { | 379 | if (!file.open( QIODevice::ReadOnly ) ) { |
380 | return QString(); | 380 | return QString(); |
381 | 381 | ||
382 | } | 382 | } |
383 | QTextStream ts( &file ); | 383 | Q3TextStream ts( &file ); |
384 | ts.setCodec( QTextCodec::codecForName("utf8") ); | 384 | ts.setCodec( QTextCodec::codecForName("utf8") ); |
385 | QString text = ts.read(); | 385 | QString text = ts.read(); |
386 | file.close(); | 386 | file.close(); |
387 | 387 | ||
388 | return text; | 388 | return text; |
389 | 389 | ||
@@ -396,17 +396,17 @@ void SMTPaccount::setSignature( QString b ) | |||
396 | QString filedir( locateLocal("data", "kopiemail" ) ); | 396 | QString filedir( locateLocal("data", "kopiemail" ) ); |
397 | signature = filedir+ "/" + getAccountName() +".sig"; | 397 | signature = filedir+ "/" + getAccountName() +".sig"; |
398 | qDebug("new sig %s ", signature.latin1()); | 398 | qDebug("new sig %s ", signature.latin1()); |
399 | save(); | 399 | save(); |
400 | } | 400 | } |
401 | QFile fileIn( signature ); | 401 | QFile fileIn( signature ); |
402 | if (!fileIn.open( IO_WriteOnly ) ) { | 402 | if (!fileIn.open( QIODevice::WriteOnly ) ) { |
403 | qDebug("OM: Cannot write signature file %s ", signature.latin1() ); | 403 | qDebug("OM: Cannot write signature file %s ", signature.latin1() ); |
404 | return ; | 404 | return ; |
405 | } | 405 | } |
406 | QTextStream tsIn( &fileIn ); | 406 | Q3TextStream tsIn( &fileIn ); |
407 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | 407 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); |
408 | tsIn << b ; | 408 | tsIn << b ; |
409 | fileIn.close(); | 409 | fileIn.close(); |
410 | } | 410 | } |
411 | QString SMTPaccount::getUniqueFileName() | 411 | QString SMTPaccount::getUniqueFileName() |
412 | { | 412 | { |
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp index 7c813cc..2df55ff 100644 --- a/kmicromail/libmailwrapper/smtpwrapper.cpp +++ b/kmicromail/libmailwrapper/smtpwrapper.cpp | |||
@@ -6,12 +6,14 @@ | |||
6 | #include "sendmailprogress.h" | 6 | #include "sendmailprogress.h" |
7 | 7 | ||
8 | //#include <opie2/odebug.h> | 8 | //#include <opie2/odebug.h> |
9 | //#include <qt.h> | 9 | //#include <qt.h> |
10 | #include <qapplication.h> | 10 | #include <qapplication.h> |
11 | #include <qmessagebox.h> | 11 | #include <qmessagebox.h> |
12 | //Added by qt3to4: | ||
13 | #include <Q3ValueList> | ||
12 | #include <stdlib.h> | 14 | #include <stdlib.h> |
13 | #ifndef DESKTOP_VERSION | 15 | #ifndef DESKTOP_VERSION |
14 | //#include <qpe/config.h> | 16 | //#include <qpe/config.h> |
15 | #include <qpe/qcopenvelope_qws.h> | 17 | #include <qpe/qcopenvelope_qws.h> |
16 | #endif | 18 | #endif |
17 | #include <libetpan/libetpan.h> | 19 | #include <libetpan/libetpan.h> |
@@ -431,14 +433,14 @@ bool SMTPwrapper::flushOutbox() { | |||
431 | AbstractMail*wrap = AbstractMail::getWrapper(localfolders); | 433 | AbstractMail*wrap = AbstractMail::getWrapper(localfolders); |
432 | if (!wrap) { | 434 | if (!wrap) { |
433 | ; // odebug << "memory error" << oendl; | 435 | ; // odebug << "memory error" << oendl; |
434 | return false; | 436 | return false; |
435 | } | 437 | } |
436 | QString oldPw, oldUser; | 438 | QString oldPw, oldUser; |
437 | QValueList<RecMailP> mailsToSend; | 439 | Q3ValueList<RecMailP> mailsToSend; |
438 | QValueList<RecMailP> mailsToRemove; | 440 | Q3ValueList<RecMailP> mailsToRemove; |
439 | QString mbox("Outgoing"); | 441 | QString mbox("Outgoing"); |
440 | wrap->listMessages(mbox,mailsToSend); | 442 | wrap->listMessages(mbox,mailsToSend); |
441 | if (mailsToSend.count()==0) { | 443 | if (mailsToSend.count()==0) { |
442 | delete wrap; | 444 | delete wrap; |
443 | ; // odebug << "No mails to send" << oendl; | 445 | ; // odebug << "No mails to send" << oendl; |
444 | return false; | 446 | return false; |