author | alwin <alwin> | 2004-03-07 02:18:47 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-07 02:18:47 (UTC) |
commit | e1c0bbc4fafe709ceed8f4a046c4bff7d4ba30ff (patch) (side-by-side diff) | |
tree | 5c7bc290c2f2e262749c93023a4a5c2b7249bd92 /noncore/net/mail/nntpgroups.cpp | |
parent | df4f3107d45976d9276ef96df4683822cf05d38c (diff) | |
download | opie-e1c0bbc4fafe709ceed8f4a046c4bff7d4ba30ff.zip opie-e1c0bbc4fafe709ceed8f4a046c4bff7d4ba30ff.tar.gz opie-e1c0bbc4fafe709ceed8f4a046c4bff7d4ba30ff.tar.bz2 |
filter for newsgroups works
ToDo: we should cache the list of newsgroups!
Diffstat (limited to 'noncore/net/mail/nntpgroups.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/nntpgroups.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/net/mail/nntpgroups.cpp b/noncore/net/mail/nntpgroups.cpp index 97b1985..8741c4b 100644 --- a/noncore/net/mail/nntpgroups.cpp +++ b/noncore/net/mail/nntpgroups.cpp @@ -1,41 +1,45 @@ #include "nntpgroups.h" #include <libmailwrapper/settings.h> #include <qlistview.h> +#include <qlineedit.h> NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, WFlags fl) : NNTPGroupsUI(parent,name,fl),subscribedGroups() { m_Account = account; fillGroups(); } NNTPGroups::~NNTPGroups() { } void NNTPGroups::slotGetNG() { if (!m_Account) return; GroupListView->clear(); NNTPwrapper tmp( m_Account ); - QStringList list = tmp.listAllNewsgroups(); + QString filter = Groupfilteredit->text(); + QStringList list = tmp.listAllNewsgroups(filter); + subscribedGroupsNotListed = subscribedGroups; for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { QCheckListItem *item; item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); if ( subscribedGroups.contains( (*it) ) >= 1 ) { item->setOn( true ); + subscribedGroupsNotListed.remove((*it)); } } } void NNTPGroups::fillGroups() { if (!m_Account) return; subscribedGroups = m_Account->getGroups(); for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { QCheckListItem *item; item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); item->setOn( true ); @@ -44,14 +48,15 @@ void NNTPGroups::fillGroups() void NNTPGroups::storeValues() { if (!m_Account) return; QListViewItemIterator list_it( GroupListView ); subscribedGroups.clear(); for ( ; list_it.current(); ++list_it ) { if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { qDebug(list_it.current()->text(0) ); subscribedGroups.append( list_it.current()->text(0) ); } } + subscribedGroups+=subscribedGroupsNotListed; m_Account->setGroups( subscribedGroups ); } |