author | alwin <alwin> | 2004-03-07 02:18:47 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-07 02:18:47 (UTC) |
commit | e1c0bbc4fafe709ceed8f4a046c4bff7d4ba30ff (patch) (unidiff) | |
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 | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <libmailwrapper/settings.h> | 3 | #include <libmailwrapper/settings.h> |
4 | 4 | ||
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | #include <qlineedit.h> | ||
6 | 7 | ||
7 | NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, WFlags fl) | 8 | NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, WFlags fl) |
8 | : NNTPGroupsUI(parent,name,fl),subscribedGroups() | 9 | : NNTPGroupsUI(parent,name,fl),subscribedGroups() |
@@ -21,12 +22,15 @@ void NNTPGroups::slotGetNG() | |||
21 | if (!m_Account) return; | 22 | if (!m_Account) return; |
22 | GroupListView->clear(); | 23 | GroupListView->clear(); |
23 | NNTPwrapper tmp( m_Account ); | 24 | NNTPwrapper tmp( m_Account ); |
24 | QStringList list = tmp.listAllNewsgroups(); | 25 | QString filter = Groupfilteredit->text(); |
26 | QStringList list = tmp.listAllNewsgroups(filter); | ||
27 | subscribedGroupsNotListed = subscribedGroups; | ||
25 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 28 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
26 | QCheckListItem *item; | 29 | QCheckListItem *item; |
27 | item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); | 30 | item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); |
28 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { | 31 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { |
29 | item->setOn( true ); | 32 | item->setOn( true ); |
33 | subscribedGroupsNotListed.remove((*it)); | ||
30 | } | 34 | } |
31 | } | 35 | } |
32 | } | 36 | } |
@@ -53,5 +57,6 @@ void NNTPGroups::storeValues() | |||
53 | subscribedGroups.append( list_it.current()->text(0) ); | 57 | subscribedGroups.append( list_it.current()->text(0) ); |
54 | } | 58 | } |
55 | } | 59 | } |
60 | subscribedGroups+=subscribedGroupsNotListed; | ||
56 | m_Account->setGroups( subscribedGroups ); | 61 | m_Account->setGroups( subscribedGroups ); |
57 | } | 62 | } |