author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kmicromail/nntpgroups.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | kmicromail/nntpgroups.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/kmicromail/nntpgroups.cpp b/kmicromail/nntpgroups.cpp index c729f79..d2213d4 100644 --- a/kmicromail/nntpgroups.cpp +++ b/kmicromail/nntpgroups.cpp | |||
@@ -1,62 +1,62 @@ | |||
1 | #include "nntpgroups.h" | 1 | #include "nntpgroups.h" |
2 | 2 | ||
3 | #include <libmailwrapper/settings.h> | 3 | #include <libmailwrapper/settings.h> |
4 | #include <qlistview.h> | 4 | #include <q3listview.h> |
5 | #include <qlineedit.h> | 5 | #include <qlineedit.h> |
6 | 6 | ||
7 | using namespace Opie::Core; | 7 | using namespace Opie::Core; |
8 | 8 | ||
9 | NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, WFlags fl) | 9 | NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, Qt::WFlags fl) |
10 | : NNTPGroupsUI(parent,name,fl),subscribedGroups() | 10 | : NNTPGroupsUI(parent,name,fl),subscribedGroups() |
11 | { | 11 | { |
12 | m_Account = account; | 12 | m_Account = account; |
13 | fillGroups(); | 13 | fillGroups(); |
14 | } | 14 | } |
15 | 15 | ||
16 | NNTPGroups::~NNTPGroups() | 16 | NNTPGroups::~NNTPGroups() |
17 | { | 17 | { |
18 | 18 | ||
19 | } | 19 | } |
20 | 20 | ||
21 | void NNTPGroups::slotGetNG() | 21 | void NNTPGroups::slotGetNG() |
22 | { | 22 | { |
23 | if (!m_Account) return; | 23 | if (!m_Account) return; |
24 | GroupListView->clear(); | 24 | GroupListView->clear(); |
25 | NNTPwrapper tmp( m_Account ); | 25 | NNTPwrapper tmp( m_Account ); |
26 | QString filter = Groupfilteredit->text(); | 26 | QString filter = Groupfilteredit->text(); |
27 | QStringList list = tmp.listAllNewsgroups(filter); | 27 | QStringList list = tmp.listAllNewsgroups(filter); |
28 | subscribedGroupsNotListed = subscribedGroups; | 28 | subscribedGroupsNotListed = subscribedGroups; |
29 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 29 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
30 | QCheckListItem *item; | 30 | Q3CheckListItem *item; |
31 | item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); | 31 | item = new Q3CheckListItem( GroupListView, (*it), Q3CheckListItem::CheckBox ); |
32 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { | 32 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { |
33 | item->setOn( true ); | 33 | item->setOn( true ); |
34 | subscribedGroupsNotListed.remove((*it)); | 34 | subscribedGroupsNotListed.remove((*it)); |
35 | } | 35 | } |
36 | } | 36 | } |
37 | } | 37 | } |
38 | 38 | ||
39 | void NNTPGroups::fillGroups() | 39 | void NNTPGroups::fillGroups() |
40 | { | 40 | { |
41 | if (!m_Account) return; | 41 | if (!m_Account) return; |
42 | subscribedGroups = m_Account->getGroups(); | 42 | subscribedGroups = m_Account->getGroups(); |
43 | for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { | 43 | for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { |
44 | QCheckListItem *item; | 44 | Q3CheckListItem *item; |
45 | item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); | 45 | item = new Q3CheckListItem( GroupListView, (*it), Q3CheckListItem::CheckBox ); |
46 | item->setOn( true ); | 46 | item->setOn( true ); |
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | void NNTPGroups::storeValues() | 50 | void NNTPGroups::storeValues() |
51 | { | 51 | { |
52 | if (!m_Account) return; | 52 | if (!m_Account) return; |
53 | QListViewItemIterator list_it( GroupListView ); | 53 | Q3ListViewItemIterator list_it( GroupListView ); |
54 | subscribedGroups.clear(); | 54 | subscribedGroups.clear(); |
55 | for ( ; list_it.current(); ++list_it ) { | 55 | for ( ; list_it.current(); ++list_it ) { |
56 | if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { | 56 | if ( ( (Q3CheckListItem*)list_it.current() )->isOn() ) { |
57 | subscribedGroups.append( list_it.current()->text(0) ); | 57 | subscribedGroups.append( list_it.current()->text(0) ); |
58 | } | 58 | } |
59 | } | 59 | } |
60 | subscribedGroups+=subscribedGroupsNotListed; | 60 | subscribedGroups+=subscribedGroupsNotListed; |
61 | m_Account->setGroups( subscribedGroups ); | 61 | m_Account->setGroups( subscribedGroups ); |
62 | } | 62 | } |