author | zautrix <zautrix> | 2004-09-11 10:30:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-11 10:30:57 (UTC) |
commit | d7a273f40838f56205c1377ed0bcc5457bd46ea3 (patch) (unidiff) | |
tree | 9f01120382589404ff8dca3170f9472bdd0f18fb | |
parent | 0f45c977d7530b6ca827b7a7c7da7469f01800ca (diff) | |
download | kdepimpi-d7a273f40838f56205c1377ed0bcc5457bd46ea3.zip kdepimpi-d7a273f40838f56205c1377ed0bcc5457bd46ea3.tar.gz kdepimpi-d7a273f40838f56205c1377ed0bcc5457bd46ea3.tar.bz2 |
More mail settings
-rw-r--r-- | kmicromail/editaccounts.cpp | 17 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.cpp | 85 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.h | 3 |
3 files changed, 80 insertions, 25 deletions
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index e7d2750..d43d23b 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp | |||
@@ -363,2 +363,12 @@ void IMAPconfig::fillValues() | |||
363 | prefixLine->setText(data->getPrefix()); | 363 | prefixLine->setText(data->getPrefix()); |
364 | localFolder->setText( data->getLocalFolder() ); | ||
365 | int max = data->getMaxMailSize() ; | ||
366 | if ( max ) { | ||
367 | CheckBoxDown->setChecked( true ); | ||
368 | SpinBoxDown->setValue ( max ); | ||
369 | } else { | ||
370 | CheckBoxDown->setChecked( false ); | ||
371 | SpinBoxDown->setValue ( 5 ); | ||
372 | } | ||
373 | CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() ); | ||
364 | } | 374 | } |
@@ -373,3 +383,6 @@ void IMAPconfig::accept() | |||
373 | data->setPassword( passLine->text() ); | 383 | data->setPassword( passLine->text() ); |
374 | data->setPrefix(prefixLine->text()); | 384 | data->setPrefix(prefixLine->text()); |
385 | data->setLocalFolder( localFolder->text() ); | ||
386 | data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; | ||
387 | data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); | ||
375 | 388 | ||
@@ -432,2 +445,3 @@ void POP3config::fillValues() | |||
432 | } | 445 | } |
446 | CheckBoxLeaveOn->setChecked( data->getLeaveOnServer() ); | ||
433 | } | 447 | } |
@@ -444,2 +458,3 @@ void POP3config::accept() | |||
444 | data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; | 458 | data->setMaxMailSize( CheckBoxDown->isChecked()?SpinBoxDown->value():0 ) ; |
459 | data->setLeaveOnServer( CheckBoxLeaveOn->isChecked() ); | ||
445 | 460 | ||
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index f996d9c..766eba0 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp | |||
@@ -4,3 +4,3 @@ | |||
4 | //#include <opie2/odebug.h> | 4 | //#include <opie2/odebug.h> |
5 | #include <qpe/config.h> | 5 | #include <kconfig.h> |
6 | 6 | ||
@@ -114,3 +114,6 @@ Account::Account() | |||
114 | connectionType = 1; | 114 | connectionType = 1; |
115 | offline = false; | 115 | offline = false; |
116 | maxMailSize = 0; | ||
117 | lastFetch; | ||
118 | leaveOnServer = false; | ||
116 | } | 119 | } |
@@ -123,2 +126,26 @@ void Account::remove() | |||
123 | 126 | ||
127 | void Account::setPasswordList(const QStringList &str) | ||
128 | { | ||
129 | password = ""; | ||
130 | int i; | ||
131 | for ( i = 0; i < str.count() ; ++i ) { | ||
132 | QChar c ( (str[i].toUInt()-131)/(str.count()- (i%3))); | ||
133 | password.append( c ); | ||
134 | } | ||
135 | //qDebug("password %s ", password.latin1()); | ||
136 | } | ||
137 | QStringList Account::getPasswordList() | ||
138 | { | ||
139 | int i; | ||
140 | int len = password.length(); | ||
141 | QStringList str; | ||
142 | |||
143 | for ( i = 0; i < len ; ++i ) { | ||
144 | int val = password.at(i).unicode()*(len-(i%3))+131; | ||
145 | str.append( QString::number( val ) ); | ||
146 | // qDebug("append %s ", str[i].latin1()); | ||
147 | } | ||
148 | return str; | ||
149 | } | ||
150 | |||
124 | IMAPaccount::IMAPaccount() | 151 | IMAPaccount::IMAPaccount() |
@@ -162,3 +189,3 @@ void IMAPaccount::read() | |||
162 | { | 189 | { |
163 | Config *conf = new Config( getFileName(), Config::File ); | 190 | KConfig *conf = new KConfig( getFileName() ); |
164 | conf->setGroup( "IMAP Account" ); | 191 | conf->setGroup( "IMAP Account" ); |
@@ -174,3 +201,4 @@ void IMAPaccount::read() | |||
174 | if (user.isNull()) user = ""; | 201 | if (user.isNull()) user = ""; |
175 | password = conf->readEntryCrypt( "Password","" ); | 202 | //password = conf->readEntryCrypt( "Password","" ); |
203 | setPasswordList( conf->readListEntry( "FolderHistory")); | ||
176 | if (password.isNull()) password = ""; | 204 | if (password.isNull()) password = ""; |
@@ -184,2 +212,4 @@ void IMAPaccount::read() | |||
184 | leaveOnServer = conf->readBoolEntry("LeaveOnServer",false); | 212 | leaveOnServer = conf->readBoolEntry("LeaveOnServer",false); |
213 | qDebug("reading last fetch: %d ", lf); | ||
214 | if ( lf < 0 ) lf = 0; | ||
185 | lastFetch = dt.addSecs( lf ); | 215 | lastFetch = dt.addSecs( lf ); |
@@ -193,3 +223,3 @@ void IMAPaccount::save() | |||
193 | 223 | ||
194 | Config *conf = new Config( getFileName(), Config::File ); | 224 | KConfig *conf = new KConfig( getFileName() ); |
195 | conf->setGroup( "IMAP Account" ); | 225 | conf->setGroup( "IMAP Account" ); |
@@ -201,3 +231,4 @@ void IMAPaccount::save() | |||
201 | conf->writeEntry( "User", user ); | 231 | conf->writeEntry( "User", user ); |
202 | conf->writeEntryCrypt( "Password", password ); | 232 | //conf->writeEntryCrypt( "Password", password ); |
233 | conf->writeEntry( "FolderHistory",getPasswordList() ); | ||
203 | conf->writeEntry( "MailPrefix",prefix); | 234 | conf->writeEntry( "MailPrefix",prefix); |
@@ -210,3 +241,3 @@ void IMAPaccount::save() | |||
210 | conf->writeEntry( "LeaveOnServer", leaveOnServer); | 241 | conf->writeEntry( "LeaveOnServer", leaveOnServer); |
211 | conf->write(); | 242 | conf->sync(); |
212 | delete conf; | 243 | delete conf; |
@@ -259,3 +290,3 @@ void POP3account::read() | |||
259 | { | 290 | { |
260 | Config *conf = new Config( getFileName(), Config::File ); | 291 | KConfig *conf = new KConfig( getFileName()); |
261 | conf->setGroup( "POP3 Account" ); | 292 | conf->setGroup( "POP3 Account" ); |
@@ -267,3 +298,4 @@ void POP3account::read() | |||
267 | user = conf->readEntry( "User" ); | 298 | user = conf->readEntry( "User" ); |
268 | password = conf->readEntryCrypt( "Password" ); | 299 | //password = conf->readEntryCrypt( "Password" ); |
300 | setPasswordList( conf->readListEntry( "FolderHistory")); | ||
269 | offline = conf->readBoolEntry("Offline",false); | 301 | offline = conf->readBoolEntry("Offline",false); |
@@ -282,3 +314,3 @@ void POP3account::save() | |||
282 | 314 | ||
283 | Config *conf = new Config( getFileName(), Config::File ); | 315 | KConfig *conf = new KConfig( getFileName() ); |
284 | conf->setGroup( "POP3 Account" ); | 316 | conf->setGroup( "POP3 Account" ); |
@@ -290,3 +322,4 @@ void POP3account::save() | |||
290 | conf->writeEntry( "User", user ); | 322 | conf->writeEntry( "User", user ); |
291 | conf->writeEntryCrypt( "Password", password ); | 323 | //conf->writeEntryCrypt( "Password", password ); |
324 | conf->writeEntry( "FolderHistory",getPasswordList() ); | ||
292 | conf->writeEntry( "Offline",offline); | 325 | conf->writeEntry( "Offline",offline); |
@@ -298,3 +331,3 @@ void POP3account::save() | |||
298 | conf->writeEntry( "LeaveOnServer", leaveOnServer); | 331 | conf->writeEntry( "LeaveOnServer", leaveOnServer); |
299 | conf->write(); | 332 | conf->sync(); |
300 | delete conf; | 333 | delete conf; |
@@ -352,3 +385,3 @@ void SMTPaccount::read() | |||
352 | { | 385 | { |
353 | Config *conf = new Config( getFileName(), Config::File ); | 386 | KConfig *conf = new KConfig( getFileName() ); |
354 | conf->setGroup( "SMTP Account" ); | 387 | conf->setGroup( "SMTP Account" ); |
@@ -361,3 +394,4 @@ void SMTPaccount::read() | |||
361 | user = conf->readEntry( "User" ); | 394 | user = conf->readEntry( "User" ); |
362 | password = conf->readEntryCrypt( "Password" ); | 395 | //password = conf->readEntryCrypt( "Password" ); |
396 | setPasswordList( conf->readListEntry( "FolderHistory")); | ||
363 | delete conf; | 397 | delete conf; |
@@ -369,3 +403,3 @@ void SMTPaccount::save() | |||
369 | 403 | ||
370 | Config *conf = new Config( getFileName(), Config::File ); | 404 | KConfig *conf = new KConfig( getFileName() ); |
371 | conf->setGroup( "SMTP Account" ); | 405 | conf->setGroup( "SMTP Account" ); |
@@ -378,4 +412,5 @@ void SMTPaccount::save() | |||
378 | conf->writeEntry( "User", user ); | 412 | conf->writeEntry( "User", user ); |
379 | conf->writeEntryCrypt( "Password", password ); | 413 | //conf->writeEntryCrypt( "Password", password ); |
380 | conf->write(); | 414 | conf->writeEntry( "FolderHistory",getPasswordList() ); |
415 | conf->sync(); | ||
381 | delete conf; | 416 | delete conf; |
@@ -428,3 +463,3 @@ void NNTPaccount::read() | |||
428 | { | 463 | { |
429 | Config *conf = new Config( getFileName(), Config::File ); | 464 | KConfig *conf = new KConfig( getFileName() ); |
430 | conf->setGroup( "NNTP Account" ); | 465 | conf->setGroup( "NNTP Account" ); |
@@ -436,4 +471,5 @@ void NNTPaccount::read() | |||
436 | user = conf->readEntry( "User" ); | 471 | user = conf->readEntry( "User" ); |
437 | password = conf->readEntryCrypt( "Password" ); | 472 | //password = conf->readEntryCrypt( "Password" ); |
438 | subscribedGroups = conf->readListEntry( "Subscribed", ',' ); | 473 | setPasswordList( conf->readListEntry( "FolderHistory")); |
474 | subscribedGroups = conf->readListEntry( "Subscribed"); | ||
439 | delete conf; | 475 | delete conf; |
@@ -445,3 +481,3 @@ void NNTPaccount::save() | |||
445 | 481 | ||
446 | Config *conf = new Config( getFileName(), Config::File ); | 482 | KConfig *conf = new KConfig( getFileName() ); |
447 | conf->setGroup( "NNTP Account" ); | 483 | conf->setGroup( "NNTP Account" ); |
@@ -453,5 +489,6 @@ void NNTPaccount::save() | |||
453 | conf->writeEntry( "User", user ); | 489 | conf->writeEntry( "User", user ); |
454 | conf->writeEntryCrypt( "Password", password ); | 490 | //conf->writeEntryCrypt( "Password", password ); |
455 | conf->writeEntry( "Subscribed" , subscribedGroups, ',' ); | 491 | conf->writeEntry( "FolderHistory",getPasswordList() ); |
456 | conf->write(); | 492 | conf->writeEntry( "Subscribed" , subscribedGroups ); |
493 | conf->sync(); | ||
457 | delete conf; | 494 | delete conf; |
diff --git a/kmicromail/libmailwrapper/settings.h b/kmicromail/libmailwrapper/settings.h index 85b817c..61051dd 100644 --- a/kmicromail/libmailwrapper/settings.h +++ b/kmicromail/libmailwrapper/settings.h | |||
@@ -39,2 +39,5 @@ public: | |||
39 | 39 | ||
40 | void setPasswordList(const QStringList &str); | ||
41 | QStringList getPasswordList(); | ||
42 | |||
40 | void setSSL( bool b ) { ssl = b; } | 43 | void setSSL( bool b ) { ssl = b; } |