summaryrefslogtreecommitdiffabout
path: root/libkdepim/categoryselectdialog.cpp
Unidiff
Diffstat (limited to 'libkdepim/categoryselectdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/categoryselectdialog.cpp43
1 files changed, 23 insertions, 20 deletions
diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp
index 2a9b43e..4f72880 100644
--- a/libkdepim/categoryselectdialog.cpp
+++ b/libkdepim/categoryselectdialog.cpp
@@ -21,11 +21,14 @@
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlistview.h> 24#include <q3listview.h>
25#include <qpushbutton.h> 25#include <qpushbutton.h>
26#include <qheader.h> 26#include <q3header.h>
27#include <qapp.h> 27#include <qapplication.h>
28#include <qmessagebox.h> 28#include <qmessagebox.h>
29//Added by qt3to4:
30#include <QPixmap>
31#include <QDesktopWidget>
29#include <kmessagebox.h> 32#include <kmessagebox.h>
30 33
31 34
@@ -38,7 +41,7 @@ using namespace KPIM;
38 41
39CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent, 42CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent,
40 const char* name, 43 const char* name,
41 bool modal, WFlags fl ) 44 bool modal, Qt::WFlags fl )
42 : CategorySelectDialog_base( parent, name, true, fl ), 45 : CategorySelectDialog_base( parent, name, true, fl ),
43 mPrefs( prefs ) 46 mPrefs( prefs )
44{ 47{
@@ -81,8 +84,8 @@ void CategorySelectDialog::setCategories()
81 QStringList::Iterator it; 84 QStringList::Iterator it;
82 for (it = mPrefs->mCustomCategories.begin(); 85 for (it = mPrefs->mCustomCategories.begin();
83 it != mPrefs->mCustomCategories.end(); ++it ) { 86 it != mPrefs->mCustomCategories.end(); ++it ) {
84 CategorySelectItem * item = new CategorySelectItem(mCategories,*it,QCheckListItem::CheckBox); 87 CategorySelectItem * item = new CategorySelectItem(mCategories,*it,Q3CheckListItem::CheckBox);
85 QObject::connect( item, SIGNAL( stateChanged(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) ); 88 QObject::connect( item, SIGNAL( stateChanged(Q3ListViewItem *) ), this, SLOT( clicked(Q3ListViewItem *) ) );
86 89
87 } 90 }
88} 91}
@@ -100,7 +103,7 @@ void CategorySelectDialog::setSelected(const QStringList &selList)
100 bool found = false; 103 bool found = false;
101 for (it=selList.begin();it!=selList.end();++it) { 104 for (it=selList.begin();it!=selList.end();++it) {
102 //qDebug(" CategorySelectDialog::setSelected("); 105 //qDebug(" CategorySelectDialog::setSelected(");
103 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 106 Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild();
104 while (item) { 107 while (item) {
105 if (item->text() == *it) { 108 if (item->text() == *it) {
106 item->setOn(true); 109 item->setOn(true);
@@ -109,7 +112,7 @@ void CategorySelectDialog::setSelected(const QStringList &selList)
109 found = true; 112 found = true;
110 break; 113 break;
111 } 114 }
112 item = (QCheckListItem *)item->nextSibling(); 115 item = (Q3CheckListItem *)item->nextSibling();
113 } 116 }
114// if ( ! found ) { 117// if ( ! found ) {
115 118
@@ -137,7 +140,7 @@ void CategorySelectDialog::setColorEnabled()
137} 140}
138void CategorySelectDialog::setColorCat() 141void CategorySelectDialog::setColorCat()
139{ 142{
140 QCheckListItem * newColorItem = (QCheckListItem * )mCategories->currentItem (); 143 Q3CheckListItem * newColorItem = (Q3CheckListItem * )mCategories->currentItem ();
141 if ( !newColorItem ) { 144 if ( !newColorItem ) {
142 KMessageBox::error(this,i18n("There is no current item.")); 145 KMessageBox::error(this,i18n("There is no current item."));
143 return; 146 return;
@@ -147,26 +150,26 @@ void CategorySelectDialog::setColorCat()
147 setColorItem( newColorItem ); 150 setColorItem( newColorItem );
148 151
149} 152}
150void CategorySelectDialog::clicked ( QListViewItem * it ) 153void CategorySelectDialog::clicked ( Q3ListViewItem * it )
151{ 154{
152 if ( ! it ) 155 if ( ! it )
153 return; 156 return;
154 QCheckListItem *i = (QCheckListItem *) it; 157 Q3CheckListItem *i = (Q3CheckListItem *) it;
155 if ( !i->isOn() && i==mColorItem) { 158 if ( !i->isOn() && i==mColorItem) {
156 setColorItem( 0); 159 setColorItem( 0);
157 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 160 Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild();
158 while (item) { 161 while (item) {
159 if (item->isOn()) { 162 if (item->isOn()) {
160 setColorItem( item ); 163 setColorItem( item );
161 break; 164 break;
162 } 165 }
163 item = (QCheckListItem *)item->nextSibling(); 166 item = (Q3CheckListItem *)item->nextSibling();
164 } 167 }
165 } else if ( i->isOn() && !mColorItem) { 168 } else if ( i->isOn() && !mColorItem) {
166 setColorItem( i); 169 setColorItem( i);
167 } 170 }
168} 171}
169void CategorySelectDialog::setColorItem( QCheckListItem * newColorItem ) 172void CategorySelectDialog::setColorItem( Q3CheckListItem * newColorItem )
170{ 173{
171 if ( !mColorEnabled ) 174 if ( !mColorEnabled )
172 return; 175 return;
@@ -186,7 +189,7 @@ void CategorySelectDialog::setColorItem( QCheckListItem * newColorItem )
186void CategorySelectDialog::slotApply() 189void CategorySelectDialog::slotApply()
187{ 190{
188 QStringList categories; 191 QStringList categories;
189 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 192 Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild();
190 QString colcat; 193 QString colcat;
191 while (item) { 194 while (item) {
192 if (item->isOn()) { 195 if (item->isOn()) {
@@ -195,7 +198,7 @@ void CategorySelectDialog::slotApply()
195 else 198 else
196 categories.append(item->text()); 199 categories.append(item->text());
197 } 200 }
198 item = (QCheckListItem *)item->nextSibling(); 201 item = (Q3CheckListItem *)item->nextSibling();
199 } 202 }
200 categories.sort(); 203 categories.sort();
201 if ( ! colcat.isEmpty() ) 204 if ( ! colcat.isEmpty() )
@@ -220,22 +223,22 @@ void CategorySelectDialog::slotOk()
220 223
221void CategorySelectDialog::clear() 224void CategorySelectDialog::clear()
222{ 225{
223 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 226 Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild();
224 while (item) { 227 while (item) {
225 item->setOn(false); 228 item->setOn(false);
226 item = (QCheckListItem *)item->nextSibling(); 229 item = (Q3CheckListItem *)item->nextSibling();
227 } 230 }
228} 231}
229 232
230void CategorySelectDialog::updateCategoryConfig() 233void CategorySelectDialog::updateCategoryConfig()
231{ 234{
232 QStringList selected; 235 QStringList selected;
233 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 236 Q3CheckListItem *item = (Q3CheckListItem *)mCategories->firstChild();
234 while (item) { 237 while (item) {
235 if (item->isOn()) { 238 if (item->isOn()) {
236 selected.append(item->text()); 239 selected.append(item->text());
237 } 240 }
238 item = (QCheckListItem *)item->nextSibling(); 241 item = (Q3CheckListItem *)item->nextSibling();
239 } 242 }
240 243
241 setCategories(); 244 setCategories();