summaryrefslogtreecommitdiff
authoralwin <alwin>2004-03-07 02:18:47 (UTC)
committer alwin <alwin>2004-03-07 02:18:47 (UTC)
commite1c0bbc4fafe709ceed8f4a046c4bff7d4ba30ff (patch) (unidiff)
tree5c7bc290c2f2e262749c93023a4a5c2b7249bd92
parentdf4f3107d45976d9276ef96df4683822cf05d38c (diff)
downloadopie-e1c0bbc4fafe709ceed8f4a046c4bff7d4ba30ff.zip
opie-e1c0bbc4fafe709ceed8f4a046c4bff7d4ba30ff.tar.gz
opie-e1c0bbc4fafe709ceed8f4a046c4bff7d4ba30ff.tar.bz2
filter for newsgroups works
ToDo: we should cache the list of newsgroups!
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/nntpgroups.cpp7
-rw-r--r--noncore/net/mail/nntpgroups.h2
-rw-r--r--noncore/net/mail/nntpgroupsui.ui49
3 files changed, 52 insertions, 6 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
@@ -5,2 +5,3 @@
5#include <qlistview.h> 5#include <qlistview.h>
6#include <qlineedit.h>
6 7
@@ -23,3 +24,5 @@ void NNTPGroups::slotGetNG()
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 ) {
@@ -29,2 +32,3 @@ void NNTPGroups::slotGetNG()
29 item->setOn( true ); 32 item->setOn( true );
33 subscribedGroupsNotListed.remove((*it));
30 } 34 }
@@ -55,2 +59,3 @@ void NNTPGroups::storeValues()
55 } 59 }
60 subscribedGroups+=subscribedGroupsNotListed;
56 m_Account->setGroups( subscribedGroups ); 61 m_Account->setGroups( subscribedGroups );
diff --git a/noncore/net/mail/nntpgroups.h b/noncore/net/mail/nntpgroups.h
index 8cc2e8b..e5b7c35 100644
--- a/noncore/net/mail/nntpgroups.h
+++ b/noncore/net/mail/nntpgroups.h
@@ -29,3 +29,3 @@ protected:
29 NNTPaccount*m_Account; 29 NNTPaccount*m_Account;
30 QStringList subscribedGroups; 30 QStringList subscribedGroups,subscribedGroupsNotListed;
31}; 31};
diff --git a/noncore/net/mail/nntpgroupsui.ui b/noncore/net/mail/nntpgroupsui.ui
index 93f487b..2902731 100644
--- a/noncore/net/mail/nntpgroupsui.ui
+++ b/noncore/net/mail/nntpgroupsui.ui
@@ -13,4 +13,4 @@
13 <y>0</y> 13 <y>0</y>
14 <width>356</width> 14 <width>254</width>
15 <height>406</height> 15 <height>330</height>
16 </rect> 16 </rect>
@@ -30,3 +30,3 @@
30 <name>margin</name> 30 <name>margin</name>
31 <number>2</number> 31 <number>1</number>
32 </property> 32 </property>
@@ -34,3 +34,3 @@
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>2</number> 35 <number>1</number>
36 </property> 36 </property>
@@ -62,2 +62,43 @@
62 <widget> 62 <widget>
63 <class>QLayoutWidget</class>
64 <property stdset="1">
65 <name>name</name>
66 <cstring>Layout1</cstring>
67 </property>
68 <hbox>
69 <property stdset="1">
70 <name>margin</name>
71 <number>0</number>
72 </property>
73 <property stdset="1">
74 <name>spacing</name>
75 <number>6</number>
76 </property>
77 <widget>
78 <class>QLabel</class>
79 <property stdset="1">
80 <name>name</name>
81 <cstring>filterlabel</cstring>
82 </property>
83 <property stdset="1">
84 <name>text</name>
85 <string>Groupfilter:</string>
86 </property>
87 </widget>
88 <widget>
89 <class>QLineEdit</class>
90 <property stdset="1">
91 <name>name</name>
92 <cstring>Groupfilteredit</cstring>
93 </property>
94 <property>
95 <name>whatsThis</name>
96 <string>Enter a filter string here.
97Then hit "get newsgroup list" again and only groups starting
98with that filter will be listet.</string>
99 </property>
100 </widget>
101 </hbox>
102 </widget>
103 <widget>
63 <class>QPushButton</class> 104 <class>QPushButton</class>