author | zautrix <zautrix> | 2004-10-30 11:40:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-30 11:40:54 (UTC) |
commit | 632b43950f1ac2980c281eb8901d797deb0ba971 (patch) (unidiff) | |
tree | 72534bf865fbef61a29d5e8b2e65672c15b432c0 /kmicromail/libmailwrapper | |
parent | 0057c2a8e90346583f606491730cae819d2313ac (diff) | |
download | kdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.zip kdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.tar.gz kdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.tar.bz2 |
made ompi compiling on desktop
-rw-r--r-- | kmicromail/libmailwrapper/generatemail.h | 5 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/libmailwrapper.pro | 64 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mailwrapper.h | 2 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mhwrapper.cpp | 22 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mhwrapper.h | 6 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.h | 1 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/smtpwrapper.cpp | 15 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/smtpwrapper.h | 2 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/storemail.h | 2 |
9 files changed, 90 insertions, 29 deletions
diff --git a/kmicromail/libmailwrapper/generatemail.h b/kmicromail/libmailwrapper/generatemail.h index a767b61..b9f8285 100644 --- a/kmicromail/libmailwrapper/generatemail.h +++ b/kmicromail/libmailwrapper/generatemail.h | |||
@@ -1,25 +1,26 @@ | |||
1 | #ifndef __GENERATE_MAIL_H | 1 | #ifndef __GENERATE_MAIL_H |
2 | #define __GENERATE_MAIL_H | 2 | #define __GENERATE_MAIL_H |
3 | 3 | ||
4 | #include <qpe/applnk.h> | 4 | //#include <qpe/applnk.h> |
5 | 5 | ||
6 | #include <qobject.h> | 6 | #include <qobject.h> |
7 | #include <libetpan/clist.h> | 7 | #include <libetpan/clist.h> |
8 | #include "mailwrapper.h" | ||
8 | 9 | ||
9 | #include <opie2/osmartpointer.h> | 10 | #include <opie2/osmartpointer.h> |
10 | 11 | ||
11 | class Mail; | 12 | class Mail; |
12 | class RecMail; | 13 | class RecMail; |
13 | class Attachment; | 14 | |
14 | struct mailimf_fields; | 15 | struct mailimf_fields; |
15 | struct mailimf_field; | 16 | struct mailimf_field; |
16 | struct mailimf_mailbox; | 17 | struct mailimf_mailbox; |
17 | struct mailmime; | 18 | struct mailmime; |
18 | struct mailimf_address_list; | 19 | struct mailimf_address_list; |
19 | class progressMailSend; | 20 | class progressMailSend; |
20 | struct mailsmtp; | 21 | struct mailsmtp; |
21 | 22 | ||
22 | class Generatemail : public QObject | 23 | class Generatemail : public QObject |
23 | { | 24 | { |
24 | Q_OBJECT | 25 | Q_OBJECT |
25 | public: | 26 | public: |
diff --git a/kmicromail/libmailwrapper/libmailwrapper.pro b/kmicromail/libmailwrapper/libmailwrapper.pro new file mode 100644 index 0000000..2b005d8 --- a/dev/null +++ b/kmicromail/libmailwrapper/libmailwrapper.pro | |||
@@ -0,0 +1,64 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG += qt warn_on | ||
3 | |||
4 | HEADERS = mailwrapper.h \ | ||
5 | imapwrapper.h \ | ||
6 | mailtypes.h \ | ||
7 | pop3wrapper.h \ | ||
8 | abstractmail.h \ | ||
9 | smtpwrapper.h \ | ||
10 | genericwrapper.h \ | ||
11 | mboxwrapper.h \ | ||
12 | settings.h \ | ||
13 | logindialog.h \ | ||
14 | sendmailprogress.h \ | ||
15 | statusmail.h \ | ||
16 | mhwrapper.h \ | ||
17 | nntpwrapper.h \ | ||
18 | generatemail.h \ | ||
19 | storemail.h \ | ||
20 | ../qpe/global.h | ||
21 | |||
22 | SOURCES = imapwrapper.cpp \ | ||
23 | mailwrapper.cpp \ | ||
24 | mailtypes.cpp \ | ||
25 | pop3wrapper.cpp \ | ||
26 | abstractmail.cpp \ | ||
27 | smtpwrapper.cpp \ | ||
28 | genericwrapper.cpp \ | ||
29 | mboxwrapper.cpp \ | ||
30 | settings.cpp \ | ||
31 | logindialog.cpp \ | ||
32 | sendmailprogress.cpp \ | ||
33 | statusmail.cpp \ | ||
34 | mhwrapper.cpp \ | ||
35 | nntpwrapper.cpp \ | ||
36 | generatemail.cpp \ | ||
37 | storemail.cpp \ | ||
38 | ../qpe/global.cpp | ||
39 | |||
40 | INTERFACES = logindialogui.ui \ | ||
41 | sendmailprogressui.ui | ||
42 | |||
43 | INCLUDEPATH += .. ../../microkde ../../microkde/kdecore ../libetpan/include | ||
44 | LIBS += -lssl -lcrypto | ||
45 | |||
46 | #-lqpe -letpan | ||
47 | |||
48 | DESTDIR = ../../bin | ||
49 | TARGET = micromailwrapper | ||
50 | |||
51 | DEFINES += DESKTOP_VERSION | ||
52 | unix : { | ||
53 | OBJECTS_DIR = obj/unix | ||
54 | MOC_DIR = moc/unix | ||
55 | } | ||
56 | win32: { | ||
57 | DEFINES += _WIN32_ | ||
58 | LIBS += mfc71u.lib | ||
59 | QMAKE_LINK += /NODEFAULTLIB:LIBC | ||
60 | #QMAKE_LINK += /NODEFAULTLIB:MSVCRT | ||
61 | #QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib | ||
62 | OBJECTS_DIR = obj/win | ||
63 | MOC_DIR = moc/win | ||
64 | } | ||
diff --git a/kmicromail/libmailwrapper/mailwrapper.h b/kmicromail/libmailwrapper/mailwrapper.h index 2ba908b..88f10da 100644 --- a/kmicromail/libmailwrapper/mailwrapper.h +++ b/kmicromail/libmailwrapper/mailwrapper.h | |||
@@ -1,16 +1,16 @@ | |||
1 | #ifndef MAILWRAPPER_H | 1 | #ifndef MAILWRAPPER_H |
2 | #define MAILWRAPPER_H | 2 | #define MAILWRAPPER_H |
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 | #include <kiconloader.h> | 9 | #include <kiconloader.h> |
10 | 10 | ||
11 | #include "settings.h" | 11 | #include "settings.h" |
12 | 12 | ||
13 | #include <opie2/osmartpointer.h> | 13 | #include <opie2/osmartpointer.h> |
14 | /* | 14 | /* |
15 | class Attachment | 15 | class Attachment |
16 | { | 16 | { |
diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp index f4133c0..de6d220 100644 --- a/kmicromail/libmailwrapper/mhwrapper.cpp +++ b/kmicromail/libmailwrapper/mhwrapper.cpp | |||
@@ -1,24 +1,24 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
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 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <qpe/global.h> | 9 | #include <qpe/global.h> |
10 | #include <oprocess.h> | ||
11 | #include <klocale.h> | 10 | #include <klocale.h> |
12 | //#include <opie2/odebug.h> | 11 | #include <kglobal.h> |
12 | //#include <opie2/odebug.h> | ||
13 | 13 | ||
14 | using namespace Opie::Core; | 14 | using namespace Opie::Core; |
15 | MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) | 15 | MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) |
16 | : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) | 16 | : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) |
17 | { | 17 | { |
18 | if (MHPath.length()>0) { | 18 | if (MHPath.length()>0) { |
19 | if (MHPath[MHPath.length()-1]=='/') { | 19 | if (MHPath[MHPath.length()-1]=='/') { |
20 | MHPath=MHPath.left(MHPath.length()-1); | 20 | MHPath=MHPath.left(MHPath.length()-1); |
21 | } | 21 | } |
22 | //odebug << MHPath << oendl; | 22 | //odebug << MHPath << oendl; |
23 | QDir dir(MHPath); | 23 | QDir dir(MHPath); |
24 | if (!dir.exists()) { | 24 | if (!dir.exists()) { |
@@ -306,57 +306,51 @@ int MHwrapper::deleteMbox(const FolderP&tfolder) | |||
306 | if (!m_storage) { | 306 | if (!m_storage) { |
307 | return 0; | 307 | return 0; |
308 | } | 308 | } |
309 | if (!tfolder) return 0; | 309 | if (!tfolder) return 0; |
310 | if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; | 310 | if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; |
311 | 311 | ||
312 | int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); | 312 | int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); |
313 | 313 | ||
314 | if (r != MAIL_NO_ERROR) { | 314 | if (r != MAIL_NO_ERROR) { |
315 | qDebug("error deleting mail box "); | 315 | qDebug("error deleting mail box "); |
316 | return 0; | 316 | return 0; |
317 | } | 317 | } |
318 | QString delDir = locateLocal( "apps", "kopiemail")+ "localmail"; | ||
319 | qDebug("*****************\ndel %s %s ", delDir.latin1(),tfolder->getName().latin1() ); | ||
320 | #if 0 | ||
318 | QString cmd = "rm -rf "+tfolder->getName(); | 321 | QString cmd = "rm -rf "+tfolder->getName(); |
319 | QStringList command; | 322 | QStringList command; |
320 | command << "/bin/sh"; | 323 | command << "/bin/sh"; |
321 | command << "-c"; | 324 | command << "-c"; |
322 | command << cmd.latin1(); | 325 | command << cmd.latin1(); |
323 | OProcess *process = new OProcess(); | 326 | OProcess *process = new OProcess(); |
324 | 327 | ||
328 | /* | ||
325 | connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), | 329 | connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), |
326 | this, SLOT( processEnded(Opie::Core::OProcess*))); | 330 | this, SLOT( processEnded(Opie::Core::OProcess*))); |
327 | connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), | 331 | connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), |
328 | this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); | 332 | this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); |
329 | 333 | */ | |
330 | *process << command; | 334 | *process << command; |
331 | removeMboxfailed = false; | 335 | removeMboxfailed = false; |
332 | if(!process->start(OProcess::Block, OProcess::All) ) { | 336 | if(!process->start(OProcess::Block, OProcess::All) ) { |
333 | qDebug("could not start process "); | 337 | qDebug("could not start process "); |
334 | return 0; | 338 | return 0; |
335 | } | 339 | } |
340 | #endif | ||
336 | qDebug("mail box deleted "); | 341 | qDebug("mail box deleted "); |
337 | return 1; | 342 | return 1; |
338 | } | 343 | } |
339 | 344 | ||
340 | void MHwrapper::processEnded(OProcess *p) | ||
341 | { | ||
342 | if (p) delete p; | ||
343 | } | ||
344 | |||
345 | void MHwrapper::oprocessStderr(OProcess*, char *buffer, int ) | ||
346 | { | ||
347 | QString lineStr = buffer; | ||
348 | QMessageBox::warning( 0, i18n("Error"), lineStr ,i18n("Ok") ); | ||
349 | removeMboxfailed = true; | ||
350 | } | ||
351 | 345 | ||
352 | void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | 346 | void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) |
353 | { | 347 | { |
354 | init_storage(); | 348 | init_storage(); |
355 | if (!m_storage) { | 349 | if (!m_storage) { |
356 | return; | 350 | return; |
357 | } | 351 | } |
358 | target_stat.message_count = 0; | 352 | target_stat.message_count = 0; |
359 | target_stat.message_unseen = 0; | 353 | target_stat.message_unseen = 0; |
360 | target_stat.message_recent = 0; | 354 | target_stat.message_recent = 0; |
361 | QString f = buildPath(mailbox); | 355 | QString f = buildPath(mailbox); |
362 | int r = mailsession_status_folder(m_storage->sto_session,(char*)f.latin1(),&target_stat.message_count, | 356 | int r = mailsession_status_folder(m_storage->sto_session,(char*)f.latin1(),&target_stat.message_count, |
diff --git a/kmicromail/libmailwrapper/mhwrapper.h b/kmicromail/libmailwrapper/mhwrapper.h index d1b7d1f..87f8ca1 100644 --- a/kmicromail/libmailwrapper/mhwrapper.h +++ b/kmicromail/libmailwrapper/mhwrapper.h | |||
@@ -1,25 +1,23 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | #ifndef __MH_WRAPPER_H | 2 | #ifndef __MH_WRAPPER_H |
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 | 9 | ||
10 | class encodedString; | 10 | class encodedString; |
11 | struct mailmbox_folder; | 11 | struct mailmbox_folder; |
12 | namespace Opie {namespace Core {class OProcess;}} | ||
13 | |||
14 | class MHwrapper : public Genericwrapper | 12 | class MHwrapper : public Genericwrapper |
15 | { | 13 | { |
16 | Q_OBJECT | 14 | Q_OBJECT |
17 | public: | 15 | public: |
18 | MHwrapper(const QString & dir,const QString&name); | 16 | MHwrapper(const QString & dir,const QString&name); |
19 | virtual ~MHwrapper(); | 17 | virtual ~MHwrapper(); |
20 | 18 | ||
21 | virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); | 19 | virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); |
22 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); | 20 | virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); |
23 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | 21 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); |
24 | 22 | ||
25 | virtual void deleteMail(const RecMailP&mail); | 23 | virtual void deleteMail(const RecMailP&mail); |
@@ -36,27 +34,25 @@ public: | |||
36 | 34 | ||
37 | virtual RecBodyP fetchBody( const RecMailP &mail ); | 35 | virtual RecBodyP fetchBody( const RecMailP &mail ); |
38 | static void mbox_progress( size_t current, size_t maximum ); | 36 | static void mbox_progress( size_t current, size_t maximum ); |
39 | 37 | ||
40 | virtual encodedString* fetchRawBody(const RecMailP&mail); | 38 | virtual encodedString* fetchRawBody(const RecMailP&mail); |
41 | virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> > &target); | 39 | virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> > &target); |
42 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); | 40 | virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); |
43 | virtual MAILLIB::ATYPE getType()const; | 41 | virtual MAILLIB::ATYPE getType()const; |
44 | virtual const QString&getName()const; | 42 | virtual const QString&getName()const; |
45 | virtual Account* getAccount() { return 0; }; | 43 | virtual Account* getAccount() { return 0; }; |
46 | 44 | ||
47 | public slots: | 45 | public slots: |
48 | /* for deleting maildirs we are using a system call */ | 46 | |
49 | virtual void oprocessStderr(Opie::Core::OProcess*, char *buffer, int ); | ||
50 | virtual void processEnded(Opie::Core::OProcess *); | ||
51 | protected: | 47 | protected: |
52 | QString buildPath(const QString&p); | 48 | QString buildPath(const QString&p); |
53 | QString MHPath; | 49 | QString MHPath; |
54 | QString MHName; | 50 | QString MHName; |
55 | 51 | ||
56 | void init_storage(); | 52 | void init_storage(); |
57 | void clean_storage(); | 53 | void clean_storage(); |
58 | 54 | ||
59 | bool removeMboxfailed; | 55 | bool removeMboxfailed; |
60 | }; | 56 | }; |
61 | 57 | ||
62 | #endif | 58 | #endif |
diff --git a/kmicromail/libmailwrapper/settings.h b/kmicromail/libmailwrapper/settings.h index 61051dd..79567ef 100644 --- a/kmicromail/libmailwrapper/settings.h +++ b/kmicromail/libmailwrapper/settings.h | |||
@@ -1,22 +1,23 @@ | |||
1 | #ifndef SETTINGS_H | 1 | #ifndef SETTINGS_H |
2 | #define SETTINGS_H | 2 | #define SETTINGS_H |
3 | 3 | ||
4 | #include "maildefines.h" | 4 | #include "maildefines.h" |
5 | 5 | ||
6 | /* OPIE */ | 6 | /* OPIE */ |
7 | 7 | ||
8 | /* QT */ | 8 | /* QT */ |
9 | #include <qobject.h> | 9 | #include <qobject.h> |
10 | #include <qlist.h> | 10 | #include <qlist.h> |
11 | #include <qstringlist.h> | ||
11 | #include <qdatetime.h> | 12 | #include <qdatetime.h> |
12 | 13 | ||
13 | class Account | 14 | class Account |
14 | { | 15 | { |
15 | 16 | ||
16 | public: | 17 | public: |
17 | Account(); | 18 | Account(); |
18 | virtual ~Account() {} | 19 | virtual ~Account() {} |
19 | 20 | ||
20 | void remove(); | 21 | void remove(); |
21 | void setAccountName( QString name ) { accountName = name; } | 22 | void setAccountName( QString name ) { accountName = name; } |
22 | const QString&getAccountName()const{ return accountName; } | 23 | const QString&getAccountName()const{ return accountName; } |
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp index dee1477..eb07ef1 100644 --- a/kmicromail/libmailwrapper/smtpwrapper.cpp +++ b/kmicromail/libmailwrapper/smtpwrapper.cpp | |||
@@ -1,54 +1,59 @@ | |||
1 | #include "smtpwrapper.h" | 1 | #include "smtpwrapper.h" |
2 | #include "mailwrapper.h" | 2 | #include "mailwrapper.h" |
3 | #include "abstractmail.h" | 3 | #include "abstractmail.h" |
4 | #include "logindialog.h" | 4 | #include "logindialog.h" |
5 | #include "mailtypes.h" | 5 | #include "mailtypes.h" |
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 | #include <stdlib.h> | 12 | #include <stdlib.h> |
13 | #include <qpe/config.h> | 13 | #ifndef DESKTOP_VERSION |
14 | //#include <qpe/config.h> | ||
14 | #include <qpe/qcopenvelope_qws.h> | 15 | #include <qpe/qcopenvelope_qws.h> |
15 | 16 | #endif | |
16 | #include <libetpan/libetpan.h> | 17 | #include <libetpan/libetpan.h> |
17 | #include <klocale.h> | 18 | #include <klocale.h> |
19 | #include <kglobal.h> | ||
20 | #include <kconfig.h> | ||
18 | 21 | ||
19 | 22 | ||
20 | using namespace Opie::Core; | 23 | using namespace Opie::Core; |
21 | progressMailSend*SMTPwrapper::sendProgress = 0; | 24 | progressMailSend*SMTPwrapper::sendProgress = 0; |
22 | 25 | ||
23 | SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp ) | 26 | SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp ) |
24 | : Generatemail() | 27 | : Generatemail() |
25 | { | 28 | { |
26 | m_SmtpAccount = aSmtp; | 29 | m_SmtpAccount = aSmtp; |
27 | Config cfg( "mail" ); | 30 | KConfig cfg( locateLocal("config", "kopiemail" ) ); |
28 | cfg.setGroup( "Status" ); | 31 | cfg.setGroup( "Status" ); |
29 | m_queuedMail = cfg.readNumEntry( "outgoing", 0 ); | 32 | m_queuedMail = cfg.readNumEntry( "outgoing", 0 ); |
30 | emit queuedMails( m_queuedMail ); | 33 | emit queuedMails( m_queuedMail ); |
31 | connect( this, SIGNAL( queuedMails(int) ), this, SLOT( emitQCop(int) ) ); | 34 | connect( this, SIGNAL( queuedMails(int) ), this, SLOT( emitQCop(int) ) ); |
32 | m_smtp = 0; | 35 | m_smtp = 0; |
33 | } | 36 | } |
34 | 37 | ||
35 | SMTPwrapper::~SMTPwrapper() | 38 | SMTPwrapper::~SMTPwrapper() |
36 | { | 39 | { |
37 | disc_server(); | 40 | disc_server(); |
38 | } | 41 | } |
39 | 42 | ||
40 | void SMTPwrapper::emitQCop( int queued ) { | 43 | void SMTPwrapper::emitQCop( int queued ) { |
44 | #ifndef DESKTOP_VERSION | ||
41 | QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" ); | 45 | QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" ); |
42 | env << queued; | 46 | env << queued; |
47 | #endif | ||
43 | } | 48 | } |
44 | 49 | ||
45 | QString SMTPwrapper::mailsmtpError( int errnum ) { | 50 | QString SMTPwrapper::mailsmtpError( int errnum ) { |
46 | switch ( errnum ) { | 51 | switch ( errnum ) { |
47 | case MAILSMTP_NO_ERROR: | 52 | case MAILSMTP_NO_ERROR: |
48 | return i18n( "No error" ); | 53 | return i18n( "No error" ); |
49 | case MAILSMTP_ERROR_UNEXPECTED_CODE: | 54 | case MAILSMTP_ERROR_UNEXPECTED_CODE: |
50 | return i18n( "Unexpected error code" ); | 55 | return i18n( "Unexpected error code" ); |
51 | case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: | 56 | case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: |
52 | return i18n( "Service not available" ); | 57 | return i18n( "Service not available" ); |
53 | case MAILSMTP_ERROR_STREAM: | 58 | case MAILSMTP_ERROR_STREAM: |
54 | return i18n( "Stream error" ); | 59 | return i18n( "Stream error" ); |
@@ -118,25 +123,25 @@ bool SMTPwrapper::smtpSend( mailmime *mail,bool later) { | |||
118 | mailmessage_free(msg); | 123 | mailmessage_free(msg); |
119 | if (r != MAIL_NO_ERROR || !data) { | 124 | if (r != MAIL_NO_ERROR || !data) { |
120 | if (data) | 125 | if (data) |
121 | free(data); | 126 | free(data); |
122 | qDebug("Error fetching mime... "); | 127 | qDebug("Error fetching mime... "); |
123 | return false; | 128 | return false; |
124 | } | 129 | } |
125 | msg = 0; | 130 | msg = 0; |
126 | if (later) { | 131 | if (later) { |
127 | storeMail(data,size,"Outgoing"); | 132 | storeMail(data,size,"Outgoing"); |
128 | if (data) | 133 | if (data) |
129 | free( data ); | 134 | free( data ); |
130 | Config cfg( "mail" ); | 135 | KConfig cfg( locateLocal("config", "kopiemail" ) ); |
131 | cfg.setGroup( "Status" ); | 136 | cfg.setGroup( "Status" ); |
132 | cfg.writeEntry( "outgoing", ++m_queuedMail ); | 137 | cfg.writeEntry( "outgoing", ++m_queuedMail ); |
133 | emit queuedMails( m_queuedMail ); | 138 | emit queuedMails( m_queuedMail ); |
134 | return true; | 139 | return true; |
135 | } | 140 | } |
136 | from = getFrom( mail ); | 141 | from = getFrom( mail ); |
137 | rcpts = createRcptList( mail->mm_data.mm_message.mm_fields ); | 142 | rcpts = createRcptList( mail->mm_data.mm_message.mm_fields ); |
138 | bool result = smtpSend(from,rcpts,data,size); | 143 | bool result = smtpSend(from,rcpts,data,size); |
139 | if (data) { | 144 | if (data) { |
140 | free(data); | 145 | free(data); |
141 | } | 146 | } |
142 | if (from) { | 147 | if (from) { |
@@ -438,24 +443,24 @@ bool SMTPwrapper::flushOutbox() { | |||
438 | i18n("Error sending queued mail - breaking")); | 443 | i18n("Error sending queued mail - breaking")); |
439 | returnValue = false; | 444 | returnValue = false; |
440 | break; | 445 | break; |
441 | } | 446 | } |
442 | mailsToRemove.append((*mailsToSend.begin())); | 447 | mailsToRemove.append((*mailsToSend.begin())); |
443 | mailsToSend.remove(mailsToSend.begin()); | 448 | mailsToSend.remove(mailsToSend.begin()); |
444 | sendProgress->setCurrentMails(mailsToRemove.count()); | 449 | sendProgress->setCurrentMails(mailsToRemove.count()); |
445 | } | 450 | } |
446 | if (reset_user_value) { | 451 | if (reset_user_value) { |
447 | m_SmtpAccount->setUser(oldUser); | 452 | m_SmtpAccount->setUser(oldUser); |
448 | m_SmtpAccount->setPassword(oldPw); | 453 | m_SmtpAccount->setPassword(oldPw); |
449 | } | 454 | } |
450 | Config cfg( "mail" ); | 455 | KConfig cfg( locateLocal("config", "kopiemail" ) ); |
451 | cfg.setGroup( "Status" ); | 456 | cfg.setGroup( "Status" ); |
452 | m_queuedMail = 0; | 457 | m_queuedMail = 0; |
453 | cfg.writeEntry( "outgoing", m_queuedMail ); | 458 | cfg.writeEntry( "outgoing", m_queuedMail ); |
454 | emit queuedMails( m_queuedMail ); | 459 | emit queuedMails( m_queuedMail ); |
455 | sendProgress->hide(); | 460 | sendProgress->hide(); |
456 | delete sendProgress; | 461 | delete sendProgress; |
457 | sendProgress = 0; | 462 | sendProgress = 0; |
458 | wrap->deleteMails(mbox,mailsToRemove); | 463 | wrap->deleteMails(mbox,mailsToRemove); |
459 | delete wrap; | 464 | delete wrap; |
460 | return returnValue; | 465 | return returnValue; |
461 | } | 466 | } |
diff --git a/kmicromail/libmailwrapper/smtpwrapper.h b/kmicromail/libmailwrapper/smtpwrapper.h index ec42b56..bdca000 100644 --- a/kmicromail/libmailwrapper/smtpwrapper.h +++ b/kmicromail/libmailwrapper/smtpwrapper.h | |||
@@ -1,17 +1,17 @@ | |||
1 | // -*- Mode: C++; -*- | 1 | // -*- Mode: C++; -*- |
2 | #ifndef SMTPwrapper_H | 2 | #ifndef SMTPwrapper_H |
3 | #define SMTPwrapper_H | 3 | #define SMTPwrapper_H |
4 | 4 | ||
5 | #include <qpe/applnk.h> | 5 | //#include <qpe/applnk.h> |
6 | 6 | ||
7 | #include <qbitarray.h> | 7 | #include <qbitarray.h> |
8 | #include <qdatetime.h> | 8 | #include <qdatetime.h> |
9 | #include <libetpan/clist.h> | 9 | #include <libetpan/clist.h> |
10 | 10 | ||
11 | #include "settings.h" | 11 | #include "settings.h" |
12 | #include "generatemail.h" | 12 | #include "generatemail.h" |
13 | 13 | ||
14 | #include <opie2/osmartpointer.h> | 14 | #include <opie2/osmartpointer.h> |
15 | 15 | ||
16 | class SMTPaccount; | 16 | class SMTPaccount; |
17 | class AbstractMail; | 17 | class AbstractMail; |
diff --git a/kmicromail/libmailwrapper/storemail.h b/kmicromail/libmailwrapper/storemail.h index 4433de0..e449f57 100644 --- a/kmicromail/libmailwrapper/storemail.h +++ b/kmicromail/libmailwrapper/storemail.h | |||
@@ -1,16 +1,16 @@ | |||
1 | #ifndef __STORE_MAIL_H | 1 | #ifndef __STORE_MAIL_H |
2 | #define __STORE_MAIL_H | 2 | #define __STORE_MAIL_H |
3 | 3 | ||
4 | #include <qpe/applnk.h> | 4 | //#include <qpe/applnk.h> |
5 | 5 | ||
6 | #include "generatemail.h" | 6 | #include "generatemail.h" |
7 | 7 | ||
8 | class Account; | 8 | class Account; |
9 | class Mail; | 9 | class Mail; |
10 | class AbstractMail; | 10 | class AbstractMail; |
11 | 11 | ||
12 | class Storemail : public Generatemail | 12 | class Storemail : public Generatemail |
13 | { | 13 | { |
14 | Q_OBJECT | 14 | Q_OBJECT |
15 | public: | 15 | public: |
16 | Storemail(Account*aAccount,const QString&aFolder); | 16 | Storemail(Account*aAccount,const QString&aFolder); |