-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 10 | ||||
-rw-r--r-- | noncore/net/mail/editaccounts.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.h | 4 |
4 files changed, 16 insertions, 1 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 @@ /* QT */ #include <qt.h> +#include <qstringlist.h> #include <libmailwrapper/nntpwrapper.h> @@ -512,8 +513,11 @@ void NNTPconfig::slotGetNG() { for ( current=clist_begin(list);current!=NULL;current=clist_next(current) ) { group = ( newsnntp_group_description* ) current->data; - qDebug( group->grp_name ); + // qDebug( group->grp_name ); QCheckListItem *item; item = new QCheckListItem( ListViewGroups, ( QString )group->grp_name, QCheckListItem::CheckBox ); + if ( subscribedGroups.contains( ( QString )group->grp_name ) >= 1 ) { + item->setSelected( true ); + } } } @@ -540,4 +544,5 @@ void NNTPconfig::fillValues() userLine->setText( data->getUser() ); passLine->setText( data->getPassword() ); + subscribedGroups = data->getGroups(); } @@ -554,7 +559,10 @@ void NNTPconfig::save() QListViewItemIterator list_it( ListViewGroups ); for ( ; list_it.current(); ++list_it ) { + QStringList groupList; if ( list_it.current()->isSelected() ) { qDebug( list_it.current()->text(0) ); + groupList.append( list_it.current()->text(0) ); } + data->setGroups( groupList ); } } 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: private: + QStringList subscribedGroups; void save(); 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() user = conf->readEntry( "User" ); password = conf->readEntryCrypt( "Password" ); + subscribedGroups = conf->readListEntry( "Subscribed", ',' ); delete conf; } @@ -428,4 +429,5 @@ void NNTPaccount::save() conf->writeEntry( "User", user ); conf->writeEntryCrypt( "Password", password ); + conf->writeEntry( "Subscribed" , subscribedGroups, ',' ); conf->write(); 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: bool getLogin() { return login; } + void setGroups( QStringList list ) { subscribedGroups = list; } + QStringList getGroups() { return subscribedGroups; } + private: QString file; bool login; + QStringList subscribedGroups; }; |