summaryrefslogtreecommitdiff
path: root/noncore/net/mail/editaccounts.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/editaccounts.cpp16
1 files changed, 12 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
@@ -4,12 +4,13 @@
/* OPIE */
#include <qpe/qpeapplication.h>
/* QT */
#include <qt.h>
+#include <qstringlist.h>
#include <libmailwrapper/nntpwrapper.h>
#include <libetpan/nntpdriver.h>
AccountListItem::AccountListItem( QListView *parent, Account *a)
@@ -508,16 +509,19 @@ void NNTPconfig::slotGetNG() {
newsnntp_group_description *group;
// FIXME - test if not empty
current = list->first;
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 );
+ QCheckListItem *item;
+ item = new QCheckListItem( ListViewGroups, ( QString )group->grp_name, QCheckListItem::CheckBox );
+ if ( subscribedGroups.contains( ( QString )group->grp_name ) >= 1 ) {
+ item->setSelected( true );
+ }
}
}
void NNTPconfig::slotSSL( bool enabled )
{
if ( enabled )
@@ -536,12 +540,13 @@ void NNTPconfig::fillValues()
serverLine->setText( data->getServer() );
portLine->setText( data->getPort() );
sslBox->setChecked( data->getSSL() );
loginBox->setChecked( data->getLogin() );
userLine->setText( data->getUser() );
passLine->setText( data->getPassword() );
+ subscribedGroups = data->getGroups();
}
void NNTPconfig::save()
{
data->setAccountName( accountLine->text() );
data->setServer( serverLine->text() );
@@ -550,15 +555,18 @@ void NNTPconfig::save()
data->setLogin( loginBox->isChecked() );
data->setUser( userLine->text() );
data->setPassword( passLine->text() );
QListViewItemIterator list_it( ListViewGroups );
for ( ; list_it.current(); ++list_it ) {
+ QStringList groupList;
if ( list_it.current()->isSelected() ) {
- qDebug( list_it.current()->text(0) );
+ qDebug(list_it.current()->text(0) );
+ groupList.append( list_it.current()->text(0) );
}
+ data->setGroups( groupList );
}
}
void NNTPconfig::accept()
{
save();