Diffstat (limited to 'libkdepim/categoryeditdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/categoryeditdialog.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libkdepim/categoryeditdialog.cpp b/libkdepim/categoryeditdialog.cpp index e2325d2..92a1737 100644 --- a/libkdepim/categoryeditdialog.cpp +++ b/libkdepim/categoryeditdialog.cpp | |||
@@ -22,12 +22,13 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qstringlist.h> | 24 | #include <qstringlist.h> |
25 | #include <qlineedit.h> | 25 | #include <qlineedit.h> |
26 | #include <qlistview.h> | 26 | #include <q3listview.h> |
27 | #include <qheader.h> | 27 | #include <q3header.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qapplication.h> | 29 | #include <qapplication.h> |
30 | #include <QDesktopWidget> | ||
30 | 31 | ||
31 | #include "kpimprefs.h" | 32 | #include "kpimprefs.h" |
32 | 33 | ||
33 | #include "categoryeditdialog.h" | 34 | #include "categoryeditdialog.h" |
@@ -35,9 +36,9 @@ | |||
35 | using namespace KPIM; | 36 | using namespace KPIM; |
36 | 37 | ||
37 | CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent, | 38 | CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent, |
38 | const char* name, bool modal, | 39 | const char* name, bool modal, |
39 | WFlags fl ) | 40 | Qt::WFlags fl ) |
40 | : CategoryEditDialog_base( parent, name, modal, fl ), | 41 | : CategoryEditDialog_base( parent, name, modal, fl ), |
41 | mPrefs( prefs ) | 42 | mPrefs( prefs ) |
42 | { | 43 | { |
43 | mCategories->header()->hide(); | 44 | mCategories->header()->hide(); |
@@ -45,14 +46,14 @@ CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent, | |||
45 | QStringList::Iterator it; | 46 | QStringList::Iterator it; |
46 | bool categoriesExist=false; | 47 | bool categoriesExist=false; |
47 | for (it = mPrefs->mCustomCategories.begin(); | 48 | for (it = mPrefs->mCustomCategories.begin(); |
48 | it != mPrefs->mCustomCategories.end(); ++it ) { | 49 | it != mPrefs->mCustomCategories.end(); ++it ) { |
49 | new QListViewItem(mCategories,*it); | 50 | new Q3ListViewItem(mCategories,*it); |
50 | categoriesExist=true; | 51 | categoriesExist=true; |
51 | } | 52 | } |
52 | 53 | ||
53 | connect(mCategories,SIGNAL(selectionChanged(QListViewItem *)), | 54 | connect(mCategories,SIGNAL(selectionChanged(Q3ListViewItem *)), |
54 | SLOT(editItem(QListViewItem *))); | 55 | SLOT(editItem(Q3ListViewItem *))); |
55 | connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &))); | 56 | connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &))); |
56 | mButtonRemove->setEnabled(categoriesExist); | 57 | mButtonRemove->setEnabled(categoriesExist); |
57 | mButtonModify->setEnabled(categoriesExist); | 58 | mButtonModify->setEnabled(categoriesExist); |
58 | #ifndef DESKTOP_VERSION | 59 | #ifndef DESKTOP_VERSION |
@@ -81,9 +82,9 @@ void CategoryEditDialog::slotTextChanged(const QString &text) | |||
81 | 82 | ||
82 | void CategoryEditDialog::add() | 83 | void CategoryEditDialog::add() |
83 | { | 84 | { |
84 | if (!mEdit->text().isEmpty()) { | 85 | if (!mEdit->text().isEmpty()) { |
85 | new QListViewItem(mCategories,mEdit->text()); | 86 | new Q3ListViewItem(mCategories,mEdit->text()); |
86 | mEdit->setText(""); | 87 | mEdit->setText(""); |
87 | mButtonRemove->setEnabled(mCategories->childCount()>0); | 88 | mButtonRemove->setEnabled(mCategories->childCount()>0); |
88 | mButtonModify->setEnabled(mCategories->childCount()>0); | 89 | mButtonModify->setEnabled(mCategories->childCount()>0); |
89 | } | 90 | } |
@@ -120,9 +121,9 @@ void CategoryEditDialog::slotOk() | |||
120 | void CategoryEditDialog::slotApply() | 121 | void CategoryEditDialog::slotApply() |
121 | { | 122 | { |
122 | mPrefs->mCustomCategories.clear(); | 123 | mPrefs->mCustomCategories.clear(); |
123 | 124 | ||
124 | QListViewItem *item = mCategories->firstChild(); | 125 | Q3ListViewItem *item = mCategories->firstChild(); |
125 | while(item) { | 126 | while(item) { |
126 | mPrefs->mCustomCategories.append(item->text(0)); | 127 | mPrefs->mCustomCategories.append(item->text(0)); |
127 | item = item->nextSibling(); | 128 | item = item->nextSibling(); |
128 | } | 129 | } |
@@ -130,9 +131,9 @@ void CategoryEditDialog::slotApply() | |||
130 | 131 | ||
131 | emit categoryConfigChanged(); | 132 | emit categoryConfigChanged(); |
132 | } | 133 | } |
133 | 134 | ||
134 | void CategoryEditDialog::editItem(QListViewItem *item) | 135 | void CategoryEditDialog::editItem(Q3ListViewItem *item) |
135 | { | 136 | { |
136 | mEdit->setText(item->text(0)); | 137 | mEdit->setText(item->text(0)); |
137 | mButtonRemove->setEnabled(true); | 138 | mButtonRemove->setEnabled(true); |
138 | mButtonModify->setEnabled(true); | 139 | mButtonModify->setEnabled(true); |