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,25 +1,26 @@
#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;
class Generatemail : public QObject
{
Q_OBJECT
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 @@
+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,16 +1,16 @@
#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"
#include <opie2/osmartpointer.h>
/*
class Attachment
{
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,23 +1,23 @@
// CHANGED 2004-09-31 Lutz Rogowski
#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]=='/') {
MHPath=MHPath.left(MHPath.length()-1);
}
//odebug << MHPath << oendl;
QDir dir(MHPath);
@@ -306,57 +306,51 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
if (!m_storage) {
return 0;
}
if (!tfolder) return 0;
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;
target_stat.message_unseen = 0;
target_stat.message_recent = 0;
QString f = buildPath(mailbox);
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 @@
// CHANGED 2004-09-31 Lutz Rogowski
#ifndef __MH_WRAPPER_H
#define __MH_WRAPPER_H
#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 );
virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders();
virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
virtual void deleteMail(const RecMailP&mail);
@@ -36,27 +34,25 @@ public:
virtual RecBodyP fetchBody( const RecMailP &mail );
static void mbox_progress( size_t current, size_t maximum );
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();
bool removeMboxfailed;
};
#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 @@
#ifndef SETTINGS_H
#define SETTINGS_H
#include "maildefines.h"
/* OPIE */
/* QT */
#include <qobject.h>
#include <qlist.h>
+#include <qstringlist.h>
#include <qdatetime.h>
class Account
{
public:
Account();
virtual ~Account() {}
void remove();
void setAccountName( QString name ) { accountName = name; }
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 @@
#include "smtpwrapper.h"
#include "mailwrapper.h"
#include "abstractmail.h"
#include "logindialog.h"
#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" );
case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE:
return i18n( "Service not available" );
case MAILSMTP_ERROR_STREAM:
return i18n( "Stream error" );
@@ -118,25 +123,25 @@ bool SMTPwrapper::smtpSend( mailmime *mail,bool later) {
mailmessage_free(msg);
if (r != MAIL_NO_ERROR || !data) {
if (data)
free(data);
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);
if (data) {
free(data);
}
if (from) {
@@ -438,24 +443,24 @@ bool SMTPwrapper::flushOutbox() {
i18n("Error sending queued mail - breaking"));
returnValue = false;
break;
}
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);
delete wrap;
return returnValue;
}
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 @@
// -*- 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"
#include <opie2/osmartpointer.h>
class SMTPaccount;
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 @@
#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
{
Q_OBJECT
public:
Storemail(Account*aAccount,const QString&aFolder);