summaryrefslogtreecommitdiff
authorharlekin <harlekin>2004-03-06 00:20:22 (UTC)
committer harlekin <harlekin>2004-03-06 00:20:22 (UTC)
commit7b10be8e0ed88afe9e8964e6b5f1fe449cee3609 (patch) (unidiff)
tree149f8aecef57768cd4cf9e0c35778a711c5b6cf4
parent6afcd375a640d5c6888bc111cd1d80a08f554136 (diff)
downloadopie-7b10be8e0ed88afe9e8964e6b5f1fe449cee3609.zip
opie-7b10be8e0ed88afe9e8964e6b5f1fe449cee3609.tar.gz
opie-7b10be8e0ed88afe9e8964e6b5f1fe449cee3609.tar.bz2
save selected newsgroups
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/editaccounts.cpp16
-rw-r--r--noncore/net/mail/editaccounts.h1
-rw-r--r--noncore/net/mail/libmailwrapper/settings.cpp2
-rw-r--r--noncore/net/mail/libmailwrapper/settings.h4
4 files changed, 19 insertions, 4 deletions
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp
index 2a1acc0..215380d 100644
--- a/noncore/net/mail/editaccounts.cpp
+++ b/noncore/net/mail/editaccounts.cpp
@@ -8,4 +8,5 @@
8/* QT */ 8/* QT */
9#include <qt.h> 9#include <qt.h>
10#include <qstringlist.h>
10 11
11#include <libmailwrapper/nntpwrapper.h> 12#include <libmailwrapper/nntpwrapper.h>
@@ -512,8 +513,11 @@ void NNTPconfig::slotGetNG() {
512 for ( current=clist_begin(list);current!=NULL;current=clist_next(current) ) { 513 for ( current=clist_begin(list);current!=NULL;current=clist_next(current) ) {
513 group = ( newsnntp_group_description* ) current->data; 514 group = ( newsnntp_group_description* ) current->data;
514 qDebug( group->grp_name ); 515 // qDebug( group->grp_name );
515 516
516 QCheckListItem *item; 517 QCheckListItem *item;
517 item = new QCheckListItem( ListViewGroups, ( QString )group->grp_name, QCheckListItem::CheckBox ); 518 item = new QCheckListItem( ListViewGroups, ( QString )group->grp_name, QCheckListItem::CheckBox );
519 if ( subscribedGroups.contains( ( QString )group->grp_name ) >= 1 ) {
520 item->setSelected( true );
521 }
518 } 522 }
519} 523}
@@ -540,4 +544,5 @@ void NNTPconfig::fillValues()
540 userLine->setText( data->getUser() ); 544 userLine->setText( data->getUser() );
541 passLine->setText( data->getPassword() ); 545 passLine->setText( data->getPassword() );
546 subscribedGroups = data->getGroups();
542} 547}
543 548
@@ -554,7 +559,10 @@ void NNTPconfig::save()
554 QListViewItemIterator list_it( ListViewGroups ); 559 QListViewItemIterator list_it( ListViewGroups );
555 for ( ; list_it.current(); ++list_it ) { 560 for ( ; list_it.current(); ++list_it ) {
561 QStringList groupList;
556 if ( list_it.current()->isSelected() ) { 562 if ( list_it.current()->isSelected() ) {
557 qDebug( list_it.current()->text(0) ); 563 qDebug(list_it.current()->text(0) );
564 groupList.append( list_it.current()->text(0) );
558 } 565 }
566 data->setGroups( groupList );
559 } 567 }
560} 568}
diff --git a/noncore/net/mail/editaccounts.h b/noncore/net/mail/editaccounts.h
index 438a984..a9eb19f 100644
--- a/noncore/net/mail/editaccounts.h
+++ b/noncore/net/mail/editaccounts.h
@@ -144,4 +144,5 @@ protected slots:
144 144
145private: 145private:
146 QStringList subscribedGroups;
146 void save(); 147 void save();
147 NNTPaccount *data; 148 NNTPaccount *data;
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp
index 65ca387..f64c17d 100644
--- a/noncore/net/mail/libmailwrapper/settings.cpp
+++ b/noncore/net/mail/libmailwrapper/settings.cpp
@@ -411,4 +411,5 @@ void NNTPaccount::read()
411 user = conf->readEntry( "User" ); 411 user = conf->readEntry( "User" );
412 password = conf->readEntryCrypt( "Password" ); 412 password = conf->readEntryCrypt( "Password" );
413 subscribedGroups = conf->readListEntry( "Subscribed", ',' );
413 delete conf; 414 delete conf;
414} 415}
@@ -428,4 +429,5 @@ void NNTPaccount::save()
428 conf->writeEntry( "User", user ); 429 conf->writeEntry( "User", user );
429 conf->writeEntryCrypt( "Password", password ); 430 conf->writeEntryCrypt( "Password", password );
431 conf->writeEntry( "Subscribed" , subscribedGroups, ',' );
430 conf->write(); 432 conf->write();
431 delete conf; 433 delete conf;
diff --git a/noncore/net/mail/libmailwrapper/settings.h b/noncore/net/mail/libmailwrapper/settings.h
index 8d7df92..1feedbf 100644
--- a/noncore/net/mail/libmailwrapper/settings.h
+++ b/noncore/net/mail/libmailwrapper/settings.h
@@ -127,7 +127,11 @@ public:
127 bool getLogin() { return login; } 127 bool getLogin() { return login; }
128 128
129 void setGroups( QStringList list ) { subscribedGroups = list; }
130 QStringList getGroups() { return subscribedGroups; }
131
129private: 132private:
130 QString file; 133 QString file;
131 bool login; 134 bool login;
135 QStringList subscribedGroups;
132 136
133}; 137};