Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.cpp | 9 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.h | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 9 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.h | 6 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 12 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.h | 5 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.cpp | 10 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.h | 4 |
12 files changed, 58 insertions, 16 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index 80d0b52..3dd2fce 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp @@ -23,5 +23,5 @@ AbstractMail* AbstractMail::getWrapper(POP3account *a) -AbstractMail* AbstractMail::getWrapper(const QString&a) +AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name) { - return new MBOXwrapper(a); + return new MBOXwrapper(a,name); } @@ -101 +101,6 @@ QString AbstractMail::defaultLocalfolder() } + +/* temporary - will be removed when implemented in all classes */ +void AbstractMail::deleteMails(const QString &,QList<RecMail> &) +{ +} diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h index 9770991..15d83cb 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.h +++ b/noncore/net/mail/libmailwrapper/abstractmail.h @@ -33,2 +33,3 @@ public: virtual int deleteAllMail(const Folder*)=0; + virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); virtual int deleteMbox(const Folder*)=0; @@ -48,3 +49,3 @@ public: /* mbox only! */ - static AbstractMail* getWrapper(const QString&a); + static AbstractMail* getWrapper(const QString&a,const QString&name="Local Folders"); @@ -53,2 +54,3 @@ public: virtual const QString&getType()const=0; + virtual const QString&getName()const=0; diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index d252159..bb74de9 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp @@ -31,2 +31,3 @@ void IMAPwrapper::login() + if (account->getOffline()) return; /* we are connected this moment */ @@ -1008,2 +1009,7 @@ const QString&IMAPwrapper::getType()const +const QString&IMAPwrapper::getName()const +{ + return account->getAccountName(); +} + encodedString* IMAPwrapper::fetchRawBody(const RecMail&mail) diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h index b246f58..b2bd7e9 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.h +++ b/noncore/net/mail/libmailwrapper/imapwrapper.h @@ -47,2 +47,4 @@ public: virtual const QString&getType()const; + virtual const QString&getName()const; + protected: diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index bc496f7..97f301e 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp @@ -10,4 +10,4 @@ const QString MBOXwrapper::wrapperType="MBOX"; -MBOXwrapper::MBOXwrapper(const QString & mbox_dir) - : Genericwrapper(),MBOXPath(mbox_dir) +MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) + : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name) { @@ -332 +332,6 @@ const QString&MBOXwrapper::getType()const } + +const QString&MBOXwrapper::getName()const +{ + return MBOXName; +} diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.h b/noncore/net/mail/libmailwrapper/mboxwrapper.h index 2794014..194ff86 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.h +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.h @@ -15,3 +15,3 @@ class MBOXwrapper : public Genericwrapper public: - MBOXwrapper(const QString & dir); + MBOXwrapper(const QString & dir,const QString&name); virtual ~MBOXwrapper(); @@ -34,5 +34,6 @@ public: virtual encodedString* fetchRawBody(const RecMail&mail); - virtual void deleteMails(const QString & mailbox,QList<RecMail> &target); + virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); virtual int deleteAllMail(const Folder*); virtual const QString&getType()const; + virtual const QString&getName()const; @@ -41,2 +42,3 @@ protected: QString MBOXPath; + QString MBOXName; static const QString wrapperType; diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index cceb22e..67bde38 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp @@ -110,2 +110,3 @@ void POP3wrapper::login() { + if (account->getOffline()) return; /* we'll hold the line */ @@ -251 +252,6 @@ const QString&POP3wrapper::getType()const } + +const QString&POP3wrapper::getName()const +{ + return account->getAccountName(); +} diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h index f0307b6..d2b708d 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.h +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h @@ -32,2 +32,3 @@ public: virtual const QString&getType()const; + virtual const QString&getName()const; static void pop3_progress( size_t current, size_t maximum ); diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index c5187f5..02a80a3 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp @@ -170,2 +170,4 @@ void IMAPaccount::read() if (prefix.isNull()) prefix = ""; + offline = conf->readBoolEntry("Offline",false); + delete conf; } @@ -186,3 +188,5 @@ void IMAPaccount::save() conf->writeEntry( "MailPrefix",prefix); + conf->writeEntry( "Offline",offline); conf->write(); + delete conf; } @@ -240,2 +244,4 @@ void POP3account::read() password = conf->readEntryCrypt( "Password" ); + offline = conf->readBoolEntry("Offline",false); + delete conf; } @@ -255,3 +261,5 @@ void POP3account::save() conf->writeEntryCrypt( "Password", password ); + conf->writeEntry( "Offline",offline); conf->write(); + delete conf; } @@ -315,2 +323,3 @@ void SMTPaccount::read() password = conf->readEntryCrypt( "Password" ); + delete conf; } @@ -332,2 +341,3 @@ void SMTPaccount::save() conf->write(); + delete conf; } @@ -388,2 +398,3 @@ void NNTPaccount::read() password = conf->readEntryCrypt( "Password" ); + delete conf; } @@ -405,2 +416,3 @@ void NNTPaccount::save() conf->write(); + delete conf; } diff --git a/noncore/net/mail/libmailwrapper/settings.h b/noncore/net/mail/libmailwrapper/settings.h index caa5dfc..2104997 100644 --- a/noncore/net/mail/libmailwrapper/settings.h +++ b/noncore/net/mail/libmailwrapper/settings.h @@ -33,2 +33,5 @@ public: + void setOffline(bool b) {offline = b;} + bool getOffline()const{return offline;} + virtual QString getFileName() { return accountName; } @@ -40,3 +43,3 @@ protected: bool ssl; - + bool offline; }; diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index 4764b77..281b88e 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp @@ -491,3 +491,3 @@ void SMTPwrapper::storeMail(const char*mail, size_t length, const QString&box) QString localfolders = AbstractMail::defaultLocalfolder(); - MBOXwrapper*wrap = new MBOXwrapper(localfolders); + AbstractMail*wrap = AbstractMail::getWrapper(localfolders); wrap->storeMessage(mail,length,box); @@ -518,7 +518,5 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp ) } - QString tmp = data; - tmp.replace(QRegExp("\r+",true,false),""); msg = 0; if (later) { - storeMail((char*)tmp.data(),tmp.length(),"Outgoing"); + storeMail(data,size,"Outgoing"); if (data) free( data ); @@ -638,3 +636,3 @@ void SMTPwrapper::sendMail(const Mail&mail,SMTPaccount*aSmtp,bool later ) -int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which) +int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,SMTPaccount*smtp,RecMail*which) { @@ -687,3 +685,3 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) QString localfolders = AbstractMail::defaultLocalfolder(); - MBOXwrapper*wrap = new MBOXwrapper(localfolders); + AbstractMail*wrap = AbstractMail::getWrapper(localfolders); if (!wrap) { diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h index 04fc4b0..7dcdbfd 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.h +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h @@ -12,3 +12,3 @@ class Mail; -class MBOXwrapper; +class AbstractMail; class RecMail; @@ -61,3 +61,3 @@ protected: - int sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which); + int sendQueuedMail(AbstractMail*wrap,SMTPaccount*smtp,RecMail*which); |