summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper
authorzautrix <zautrix>2004-10-30 11:40:54 (UTC)
committer zautrix <zautrix>2004-10-30 11:40:54 (UTC)
commit632b43950f1ac2980c281eb8901d797deb0ba971 (patch) (side-by-side diff)
tree72534bf865fbef61a29d5e8b2e65672c15b432c0 /kmicromail/libmailwrapper
parent0057c2a8e90346583f606491730cae819d2313ac (diff)
downloadkdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.zip
kdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.tar.gz
kdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.tar.bz2
made ompi compiling on desktop
Diffstat (limited to 'kmicromail/libmailwrapper') (more/less context) (show 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.cpp20
-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, 89 insertions, 28 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,21 +1,22 @@
#ifndef __GENERATE_MAIL_H
#define __GENERATE_MAIL_H
-#include <qpe/applnk.h>
+//#include <qpe/applnk.h>
#include <qobject.h>
#include <libetpan/clist.h>
+#include "mailwrapper.h"
#include <opie2/osmartpointer.h>
class Mail;
class RecMail;
-class Attachment;
+
struct mailimf_fields;
struct mailimf_field;
struct mailimf_mailbox;
struct mailmime;
struct mailimf_address_list;
class progressMailSend;
struct mailsmtp;
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 @@
+TEMPLATE = lib
+CONFIG += qt warn_on
+
+HEADERS = mailwrapper.h \
+ imapwrapper.h \
+ mailtypes.h \
+ pop3wrapper.h \
+ abstractmail.h \
+ smtpwrapper.h \
+ genericwrapper.h \
+ mboxwrapper.h \
+ settings.h \
+ logindialog.h \
+ sendmailprogress.h \
+ statusmail.h \
+ mhwrapper.h \
+ nntpwrapper.h \
+ generatemail.h \
+ storemail.h \
+ ../qpe/global.h
+
+SOURCES = imapwrapper.cpp \
+ mailwrapper.cpp \
+ mailtypes.cpp \
+ pop3wrapper.cpp \
+ abstractmail.cpp \
+ smtpwrapper.cpp \
+ genericwrapper.cpp \
+ mboxwrapper.cpp \
+ settings.cpp \
+ logindialog.cpp \
+ sendmailprogress.cpp \
+ statusmail.cpp \
+ mhwrapper.cpp \
+ nntpwrapper.cpp \
+ generatemail.cpp \
+ storemail.cpp \
+ ../qpe/global.cpp
+
+INTERFACES = logindialogui.ui \
+ sendmailprogressui.ui
+
+INCLUDEPATH += .. ../../microkde ../../microkde/kdecore ../libetpan/include
+LIBS += -lssl -lcrypto
+
+#-lqpe -letpan
+
+DESTDIR = ../../bin
+TARGET = micromailwrapper
+
+DEFINES += DESKTOP_VERSION
+unix : {
+OBJECTS_DIR = obj/unix
+MOC_DIR = moc/unix
+}
+win32: {
+DEFINES += _WIN32_
+LIBS += mfc71u.lib
+QMAKE_LINK += /NODEFAULTLIB:LIBC
+#QMAKE_LINK += /NODEFAULTLIB:MSVCRT
+#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib
+OBJECTS_DIR = obj/win
+MOC_DIR = moc/win
+}
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,12 +1,12 @@
#ifndef MAILWRAPPER_H
#define MAILWRAPPER_H
-#include <qpe/applnk.h>
+//#include <qpe/applnk.h>
#include <qbitarray.h>
#include <qdatetime.h>
#include <qfileinfo.h>
#include <kiconloader.h>
#include "settings.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
@@ -2,18 +2,18 @@
#include "mhwrapper.h"
#include "mailtypes.h"
#include "mailwrapper.h"
#include <libetpan/libetpan.h>
#include <qdir.h>
#include <qmessagebox.h>
#include <stdlib.h>
#include <qpe/global.h>
-#include <oprocess.h>
#include <klocale.h>
+#include <kglobal.h>
//#include <opie2/odebug.h>
using namespace Opie::Core;
MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name)
: Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name)
{
if (MHPath.length()>0) {
if (MHPath[MHPath.length()-1]=='/') {
@@ -310,49 +310,43 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0;
int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
if (r != MAIL_NO_ERROR) {
qDebug("error deleting mail box ");
return 0;
}
+ QString delDir = locateLocal( "apps", "kopiemail")+ "localmail";
+ qDebug("*****************\ndel %s %s ", delDir.latin1(),tfolder->getName().latin1() );
+#if 0
QString cmd = "rm -rf "+tfolder->getName();
QStringList command;
command << "/bin/sh";
command << "-c";
command << cmd.latin1();
OProcess *process = new OProcess();
+ /*
connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
this, SLOT( processEnded(Opie::Core::OProcess*)));
connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)),
this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int)));
-
+ */
*process << command;
removeMboxfailed = false;
if(!process->start(OProcess::Block, OProcess::All) ) {
qDebug("could not start process ");
return 0;
}
+#endif
qDebug("mail box deleted ");
return 1;
}
-void MHwrapper::processEnded(OProcess *p)
-{
- if (p) delete p;
-}
-
-void MHwrapper::oprocessStderr(OProcess*, char *buffer, int )
-{
- QString lineStr = buffer;
- QMessageBox::warning( 0, i18n("Error"), lineStr ,i18n("Ok") );
- removeMboxfailed = true;
-}
void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
{
init_storage();
if (!m_storage) {
return;
}
target_stat.message_count = 0;
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
@@ -4,18 +4,16 @@
#include "maildefines.h"
#include "genericwrapper.h"
#include <qstring.h>
class encodedString;
struct mailmbox_folder;
-namespace Opie {namespace Core {class OProcess;}}
-
class MHwrapper : public Genericwrapper
{
Q_OBJECT
public:
MHwrapper(const QString & dir,const QString&name);
virtual ~MHwrapper();
virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 );
@@ -40,19 +38,17 @@ public:
virtual encodedString* fetchRawBody(const RecMailP&mail);
virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> > &target);
virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&);
virtual MAILLIB::ATYPE getType()const;
virtual const QString&getName()const;
virtual Account* getAccount() { return 0; };
public slots:
- /* for deleting maildirs we are using a system call */
- virtual void oprocessStderr(Opie::Core::OProcess*, char *buffer, int );
- virtual void processEnded(Opie::Core::OProcess *);
+
protected:
QString buildPath(const QString&p);
QString MHPath;
QString MHName;
void init_storage();
void clean_storage();
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
@@ -3,16 +3,17 @@
#include "maildefines.h"
/* OPIE */
/* QT */
#include <qobject.h>
#include <qlist.h>
+#include <qstringlist.h>
#include <qdatetime.h>
class Account
{
public:
Account();
virtual ~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
@@ -5,46 +5,51 @@
#include "mailtypes.h"
#include "sendmailprogress.h"
//#include <opie2/odebug.h>
//#include <qt.h>
#include <qapplication.h>
#include <qmessagebox.h>
#include <stdlib.h>
-#include <qpe/config.h>
+#ifndef DESKTOP_VERSION
+//#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
-
+#endif
#include <libetpan/libetpan.h>
#include <klocale.h>
+#include <kglobal.h>
+#include <kconfig.h>
using namespace Opie::Core;
progressMailSend*SMTPwrapper::sendProgress = 0;
SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp )
: Generatemail()
{
m_SmtpAccount = aSmtp;
- Config cfg( "mail" );
+ KConfig cfg( locateLocal("config", "kopiemail" ) );
cfg.setGroup( "Status" );
m_queuedMail = cfg.readNumEntry( "outgoing", 0 );
emit queuedMails( m_queuedMail );
connect( this, SIGNAL( queuedMails(int) ), this, SLOT( emitQCop(int) ) );
m_smtp = 0;
}
SMTPwrapper::~SMTPwrapper()
{
disc_server();
}
void SMTPwrapper::emitQCop( int queued ) {
+#ifndef DESKTOP_VERSION
QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" );
env << queued;
+#endif
}
QString SMTPwrapper::mailsmtpError( int errnum ) {
switch ( errnum ) {
case MAILSMTP_NO_ERROR:
return i18n( "No error" );
case MAILSMTP_ERROR_UNEXPECTED_CODE:
return i18n( "Unexpected error code" );
@@ -122,17 +127,17 @@ bool SMTPwrapper::smtpSend( mailmime *mail,bool later) {
qDebug("Error fetching mime... ");
return false;
}
msg = 0;
if (later) {
storeMail(data,size,"Outgoing");
if (data)
free( data );
- Config cfg( "mail" );
+ KConfig cfg( locateLocal("config", "kopiemail" ) );
cfg.setGroup( "Status" );
cfg.writeEntry( "outgoing", ++m_queuedMail );
emit queuedMails( m_queuedMail );
return true;
}
from = getFrom( mail );
rcpts = createRcptList( mail->mm_data.mm_message.mm_fields );
bool result = smtpSend(from,rcpts,data,size);
@@ -442,17 +447,17 @@ bool SMTPwrapper::flushOutbox() {
mailsToRemove.append((*mailsToSend.begin()));
mailsToSend.remove(mailsToSend.begin());
sendProgress->setCurrentMails(mailsToRemove.count());
}
if (reset_user_value) {
m_SmtpAccount->setUser(oldUser);
m_SmtpAccount->setPassword(oldPw);
}
- Config cfg( "mail" );
+ KConfig cfg( locateLocal("config", "kopiemail" ) );
cfg.setGroup( "Status" );
m_queuedMail = 0;
cfg.writeEntry( "outgoing", m_queuedMail );
emit queuedMails( m_queuedMail );
sendProgress->hide();
delete sendProgress;
sendProgress = 0;
wrap->deleteMails(mbox,mailsToRemove);
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,13 +1,13 @@
// -*- Mode: C++; -*-
#ifndef SMTPwrapper_H
#define SMTPwrapper_H
-#include <qpe/applnk.h>
+//#include <qpe/applnk.h>
#include <qbitarray.h>
#include <qdatetime.h>
#include <libetpan/clist.h>
#include "settings.h"
#include "generatemail.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,12 +1,12 @@
#ifndef __STORE_MAIL_H
#define __STORE_MAIL_H
-#include <qpe/applnk.h>
+//#include <qpe/applnk.h>
#include "generatemail.h"
class Account;
class Mail;
class AbstractMail;
class Storemail : public Generatemail