summaryrefslogtreecommitdiff
authoralwin <alwin>2004-01-04 12:22:24 (UTC)
committer alwin <alwin>2004-01-04 12:22:24 (UTC)
commit1f04dc232d4c0ddd17fc49b6c779bd6b97678e0a (patch) (side-by-side diff)
tree89e3a13e8dd806c82a0b25d6fd0d06ff7442272c
parentae4774bdbbe1e6c28f8e4238c5a98d1fb6677880 (diff)
downloadopie-1f04dc232d4c0ddd17fc49b6c779bd6b97678e0a.zip
opie-1f04dc232d4c0ddd17fc49b6c779bd6b97678e0a.tar.gz
opie-1f04dc232d4c0ddd17fc49b6c779bd6b97678e0a.tar.bz2
some cleanups
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountview.cpp5
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.cpp7
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.h2
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp6
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.h1
5 files changed, 15 insertions, 6 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index 2ce89db..77fa706 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -1,9 +1,9 @@
-#include <stdlib.h>
#include "accountview.h"
#include <libmailwrapper/mailtypes.h>
+#include <libmailwrapper/abstractmail.h>
#include "defines.h"
#include "newmaildir.h"
#include <qmessagebox.h>
#include <qpopupmenu.h>
/**
@@ -443,14 +443,13 @@ void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int)
}
void AccountView::populate( QList<Account> list )
{
clear();
- QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/");
- (void) new MBOXviewItem(localfolders,this);
+ (void) new MBOXviewItem(AbstractMail::defaultLocalfolder(),this);
Account *it;
for ( it = list.first(); it; it = list.next() ) {
if ( it->getType().compare( "IMAP" ) == 0 ) {
IMAPaccount *imap = static_cast<IMAPaccount *>(it);
qDebug( "added IMAP " + imap->getAccountName() );
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp
index f303d72..80d0b52 100644
--- a/noncore/net/mail/libmailwrapper/abstractmail.cpp
+++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp
@@ -89,6 +89,13 @@ QString AbstractMail::gen_attachment_id()
}
int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool)
{
return 0;
}
+
+QString AbstractMail::defaultLocalfolder()
+{
+ QString f = getenv( "HOME" );
+ f += "/Applications/opiemail/localmail";
+ return f;
+}
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h
index dab9e10..ca9caed 100644
--- a/noncore/net/mail/libmailwrapper/abstractmail.h
+++ b/noncore/net/mail/libmailwrapper/abstractmail.h
@@ -42,12 +42,14 @@ public:
static AbstractMail* getWrapper(IMAPaccount *a);
static AbstractMail* getWrapper(POP3account *a);
/* mbox only! */
static AbstractMail* getWrapper(const QString&a);
+ static QString defaultLocalfolder();
+
protected:
static encodedString*decode_String(const encodedString*text,const QString&enc);
static QString convert_String(const char*text);
static QString gen_attachment_id();
};
#endif
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index b9c4ff2..e054365 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
@@ -17,13 +17,13 @@
#include "mboxwrapper.h"
#include "logindialog.h"
#include "mailtypes.h"
//#include "defines.h"
#include "sendmailprogress.h"
-#define USER_AGENT "OpieMail v0.1"
+const char* SMTPwrapper::USER_AGENT="OpieMail v0.3";
progressMailSend*SMTPwrapper::sendProgress = 0;
SMTPwrapper::SMTPwrapper( Settings *s )
: QObject()
{
@@ -485,13 +485,13 @@ void SMTPwrapper::progress( size_t current, size_t maximum )
}
}
void SMTPwrapper::storeMail(char*mail, size_t length, const QString&box)
{
if (!mail) return;
- QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/");
+ QString localfolders = AbstractMail::defaultLocalfolder();
MBOXwrapper*wrap = new MBOXwrapper(localfolders);
wrap->storeMessage(mail,length,box);
delete wrap;
}
void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp )
@@ -686,13 +686,13 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which)
bool SMTPwrapper::flushOutbox(SMTPaccount*smtp)
{
bool returnValue = true;
if (!smtp) return false;
- QString localfolders = (QString) getenv( "HOME" ) + QString("/Applications/opiemail/localmail/");
+ QString localfolders = AbstractMail::defaultLocalfolder();
MBOXwrapper*wrap = new MBOXwrapper(localfolders);
if (!wrap) {
qDebug("memory error");
return false;
}
QList<RecMail> mailsToSend;
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h
index 05becf2..4a4352f 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.h
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h
@@ -59,12 +59,13 @@ protected:
void storeMail(mailmime*mail, const QString&box);
Settings *settings;
int sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which);
int m_queuedMail;
+ static const char* USER_AGENT;
protected slots:
void emitQCop( int queued );
};