From 6f4d42c16c87668279db1e0a0d3e4f4aad5b84f6 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 19 Feb 2005 20:30:34 +0000 Subject: cat select fix --- (limited to 'libkdepim') diff --git a/libkdepim/categoryeditdialog.h b/libkdepim/categoryeditdialog.h index 4ebc802..3e8ab45 100644 --- a/libkdepim/categoryeditdialog.h +++ b/libkdepim/categoryeditdialog.h @@ -24,11 +24,35 @@ #define KPIM_CATEGORYEDITDIALOG_H #include +#include class KPimPrefs; namespace KPIM { + class CategorySelectItem :public QObject, public QCheckListItem +{ + + Q_OBJECT + public: + + CategorySelectItem(QListView * parent, const QString & text, Type tt) : + QCheckListItem (parent, text, tt ) , QObject( parent ) + {;} + + signals: + void stateChanged( QListViewItem*); + + protected: + + virtual void stateChange(bool b) + { + QCheckListItem::stateChange(b); + emit stateChanged( this ); + } +}; + + class CategoryEditDialog : public CategoryEditDialog_base { Q_OBJECT diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp index 8038934..4d80726 100644 --- a/libkdepim/categoryselectdialog.cpp +++ b/libkdepim/categoryselectdialog.cpp @@ -54,7 +54,7 @@ CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent, else showMaximized(); connect( mSetColorCat, SIGNAL( clicked() ), this, SLOT( setColorCat() ) ); - connect( mCategories, SIGNAL( clicked(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) ); + // connect( mCategories, SIGNAL( clicked(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) ); } void CategorySelectDialog::editCategoriesDialog() { @@ -73,7 +73,9 @@ void CategorySelectDialog::setCategories() QStringList::Iterator it; for (it = mPrefs->mCustomCategories.begin(); it != mPrefs->mCustomCategories.end(); ++it ) { - new QCheckListItem(mCategories,*it,QCheckListItem::CheckBox); + CategorySelectItem * item = new CategorySelectItem(mCategories,*it,QCheckListItem::CheckBox); + QObject::connect( item, SIGNAL( stateChanged(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) ); + } } -- cgit v0.9.0.2