summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/settings.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/settings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/settings.cpp47
1 files changed, 37 insertions, 10 deletions
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp
index 3c9b25c..09be91b 100644
--- a/noncore/net/mail/libmailwrapper/settings.cpp
+++ b/noncore/net/mail/libmailwrapper/settings.cpp
@@ -17,5 +17,4 @@
17#define NNTP_SSL_PORT "563" 17#define NNTP_SSL_PORT "563"
18 18
19
20Settings::Settings() 19Settings::Settings()
21 : QObject() 20 : QObject()
@@ -28,5 +27,5 @@ void Settings::checkDirectory()
28 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { 27 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) {
29 system( "mkdir -p $HOME/Applications/opiemail" ); 28 system( "mkdir -p $HOME/Applications/opiemail" );
30 odebug << "$HOME/Applications/opiemail created" << oendl; 29 odebug << "$HOME/Applications/opiemail created" << oendl;
31 } 30 }
32} 31}
@@ -56,5 +55,5 @@ void Settings::updateAccounts()
56 QStringList imap = dir.entryList( "imap-*" ); 55 QStringList imap = dir.entryList( "imap-*" );
57 for ( it = imap.begin(); it != imap.end(); it++ ) { 56 for ( it = imap.begin(); it != imap.end(); it++ ) {
58 odebug << "Added IMAP account" << oendl; 57 odebug << "Added IMAP account" << oendl;
59 IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); 58 IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") );
60 accounts.append( account ); 59 accounts.append( account );
@@ -63,5 +62,5 @@ void Settings::updateAccounts()
63 QStringList pop3 = dir.entryList( "pop3-*" ); 62 QStringList pop3 = dir.entryList( "pop3-*" );
64 for ( it = pop3.begin(); it != pop3.end(); it++ ) { 63 for ( it = pop3.begin(); it != pop3.end(); it++ ) {
65 odebug << "Added POP account" << oendl; 64 odebug << "Added POP account" << oendl;
66 POP3account *account = new POP3account( (*it).replace(0, 5, "") ); 65 POP3account *account = new POP3account( (*it).replace(0, 5, "") );
67 accounts.append( account ); 66 accounts.append( account );
@@ -70,5 +69,5 @@ void Settings::updateAccounts()
70 QStringList smtp = dir.entryList( "smtp-*" ); 69 QStringList smtp = dir.entryList( "smtp-*" );
71 for ( it = smtp.begin(); it != smtp.end(); it++ ) { 70 for ( it = smtp.begin(); it != smtp.end(); it++ ) {
72 odebug << "Added SMTP account" << oendl; 71 odebug << "Added SMTP account" << oendl;
73 SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); 72 SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") );
74 accounts.append( account ); 73 accounts.append( account );
@@ -77,5 +76,5 @@ void Settings::updateAccounts()
77 QStringList nntp = dir.entryList( "nntp-*" ); 76 QStringList nntp = dir.entryList( "nntp-*" );
78 for ( it = nntp.begin(); it != nntp.end(); it++ ) { 77 for ( it = nntp.begin(); it != nntp.end(); it++ ) {
79 odebug << "Added NNTP account" << oendl; 78 odebug << "Added NNTP account" << oendl;
80 NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); 79 NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") );
81 accounts.append( account ); 80 accounts.append( account );
@@ -181,5 +180,5 @@ void IMAPaccount::read()
181void IMAPaccount::save() 180void IMAPaccount::save()
182{ 181{
183 odebug << "saving " + getFileName() << oendl; 182 odebug << "saving " + getFileName() << oendl;
184 Settings::checkDirectory(); 183 Settings::checkDirectory();
185 184
@@ -214,4 +213,6 @@ POP3account::POP3account()
214 type = MAILLIB::A_POP3; 213 type = MAILLIB::A_POP3;
215 port = POP3_PORT; 214 port = POP3_PORT;
215 m_CheckSize = true;
216 m_MaxSize = 1024;
216} 217}
217 218
@@ -225,4 +226,6 @@ POP3account::POP3account( QString filename )
225 type = MAILLIB::A_POP3; 226 type = MAILLIB::A_POP3;
226 port = POP3_PORT; 227 port = POP3_PORT;
228 m_CheckSize = true;
229 m_MaxSize = 1024;
227} 230}
228 231
@@ -254,4 +257,6 @@ void POP3account::read()
254 password = conf->readEntryCrypt( "Password" ); 257 password = conf->readEntryCrypt( "Password" );
255 offline = conf->readBoolEntry("Offline",false); 258 offline = conf->readBoolEntry("Offline",false);
259 m_CheckSize = conf->readBoolEntry("Checkmaxsize",true);
260 m_MaxSize = conf->readNumEntry("Maxsize",1024);
256 delete conf; 261 delete conf;
257} 262}
@@ -259,5 +264,5 @@ void POP3account::read()
259void POP3account::save() 264void POP3account::save()
260{ 265{
261 odebug << "saving " + getFileName() << oendl; 266 odebug << "saving " + getFileName() << oendl;
262 Settings::checkDirectory(); 267 Settings::checkDirectory();
263 268
@@ -272,4 +277,6 @@ void POP3account::save()
272 conf->writeEntryCrypt( "Password", password ); 277 conf->writeEntryCrypt( "Password", password );
273 conf->writeEntry( "Offline",offline); 278 conf->writeEntry( "Offline",offline);
279 conf->writeEntry("Checkmaxsize",m_CheckSize);
280 conf->writeEntry("Maxsize",m_MaxSize);
274 conf->write(); 281 conf->write();
275 delete conf; 282 delete conf;
@@ -282,4 +289,24 @@ QString POP3account::getFileName()
282} 289}
283 290
291bool POP3account::getCheckMaxSize()const
292{
293 return m_CheckSize;
294}
295
296void POP3account::setCheckMaxSize(bool aValue)
297{
298 m_CheckSize = aValue;
299}
300
301int POP3account::getMaxSize()const
302{
303 return m_MaxSize;
304}
305
306void POP3account::setMaxSize(int aValue)
307{
308 m_MaxSize = aValue;
309}
310
284SMTPaccount::SMTPaccount() 311SMTPaccount::SMTPaccount()
285 : Account() 312 : Account()
@@ -341,5 +368,5 @@ void SMTPaccount::read()
341void SMTPaccount::save() 368void SMTPaccount::save()
342{ 369{
343 odebug << "saving " + getFileName() << oendl; 370 odebug << "saving " + getFileName() << oendl;
344 Settings::checkDirectory(); 371 Settings::checkDirectory();
345 372
@@ -418,5 +445,5 @@ void NNTPaccount::read()
418void NNTPaccount::save() 445void NNTPaccount::save()
419{ 446{
420 odebug << "saving " + getFileName() << oendl; 447 odebug << "saving " + getFileName() << oendl;
421 Settings::checkDirectory(); 448 Settings::checkDirectory();
422 449