summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper
Unidiff
Diffstat (limited to 'kmicromail/libmailwrapper') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/generatemail.h5
-rw-r--r--kmicromail/libmailwrapper/libmailwrapper.pro64
-rw-r--r--kmicromail/libmailwrapper/mailwrapper.h2
-rw-r--r--kmicromail/libmailwrapper/mhwrapper.cpp22
-rw-r--r--kmicromail/libmailwrapper/mhwrapper.h6
-rw-r--r--kmicromail/libmailwrapper/settings.h1
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.cpp15
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.h2
-rw-r--r--kmicromail/libmailwrapper/storemail.h2
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,16 +1,17 @@
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
11class Mail; 12class Mail;
12class RecMail; 13class RecMail;
13class Attachment; 14
14struct mailimf_fields; 15struct mailimf_fields;
15struct mailimf_field; 16struct mailimf_field;
16struct mailimf_mailbox; 17struct mailimf_mailbox;
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 @@
1TEMPLATE = lib
2CONFIG += qt warn_on
3
4HEADERS = 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
22SOURCES = 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
40INTERFACES = logindialogui.ui \
41 sendmailprogressui.ui
42
43INCLUDEPATH += .. ../../microkde ../../microkde/kdecore ../libetpan/include
44LIBS += -lssl -lcrypto
45
46#-lqpe -letpan
47
48DESTDIR = ../../bin
49TARGET = micromailwrapper
50
51DEFINES += DESKTOP_VERSION
52unix : {
53OBJECTS_DIR = obj/unix
54MOC_DIR = moc/unix
55}
56win32: {
57DEFINES += _WIN32_
58LIBS += mfc71u.lib
59QMAKE_LINK += /NODEFAULTLIB:LIBC
60#QMAKE_LINK += /NODEFAULTLIB:MSVCRT
61#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib
62OBJECTS_DIR = obj/win
63MOC_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,7 +1,7 @@
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>
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
@@ -7,9 +7,9 @@
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
14using namespace Opie::Core; 14using namespace Opie::Core;
15MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) 15MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name)
@@ -315,6 +315,9 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
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";
@@ -322,32 +325,23 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
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
340void MHwrapper::processEnded(OProcess *p)
341{
342 if (p) delete p;
343}
344
345void 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
352void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) 346void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
353{ 347{
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
@@ -9,8 +9,6 @@
9 9
10class encodedString; 10class encodedString;
11struct mailmbox_folder; 11struct mailmbox_folder;
12namespace Opie {namespace Core {class OProcess;}}
13
14class MHwrapper : public Genericwrapper 12class MHwrapper : public Genericwrapper
15{ 13{
16 Q_OBJECT 14 Q_OBJECT
@@ -45,9 +43,7 @@ public:
45 virtual Account* getAccount() { return 0; }; 43 virtual Account* getAccount() { return 0; };
46 44
47public slots: 45public 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 *);
51protected: 47protected:
52 QString buildPath(const QString&p); 48 QString buildPath(const QString&p);
53 QString MHPath; 49 QString MHPath;
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
@@ -8,6 +8,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
13class Account 14class Account
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
@@ -10,11 +10,14 @@
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
20using namespace Opie::Core; 23using namespace Opie::Core;
@@ -24,7 +27,7 @@ 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 );
@@ -38,8 +41,10 @@ SMTPwrapper::~SMTPwrapper()
38} 41}
39 42
40void SMTPwrapper::emitQCop( int queued ) { 43void 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
45QString SMTPwrapper::mailsmtpError( int errnum ) { 50QString SMTPwrapper::mailsmtpError( int errnum ) {
@@ -127,7 +132,7 @@ bool SMTPwrapper::smtpSend( mailmime *mail,bool 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 );
@@ -447,7 +452,7 @@ bool SMTPwrapper::flushOutbox() {
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 );
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
@@ -2,7 +2,7 @@
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>
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,7 +1,7 @@
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