summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
authorzautrix <zautrix>2005-06-30 11:05:14 (UTC)
committer zautrix <zautrix>2005-06-30 11:05:14 (UTC)
commitb03b54ce54c1391db8979db0df1369e1c68656fa (patch) (side-by-side diff)
treeadf1bb74f5f56cb54a18a2bbfa3bc327e2e32217 /korganizer/kotodoview.cpp
parent00e631189f1dca0d596b6ce5816f2fcde9124bd7 (diff)
downloadkdepimpi-b03b54ce54c1391db8979db0df1369e1c68656fa.zip
kdepimpi-b03b54ce54c1391db8979db0df1369e1c68656fa.tar.gz
kdepimpi-b03b54ce54c1391db8979db0df1369e1c68656fa.tar.bz2
fixxx
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 1bfdef9..873a776 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -497,6 +497,7 @@ void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
KOrg::BaseView(calendar,parent,name)
{
+ mCategoryPopupMenu = 0;
mPendingUpdateBeforeRepaint = false;
isFlatDisplay = false;
mNavigator = 0;
@@ -1158,22 +1159,22 @@ void KOTodoView::setNewPercentage(int index)
QPopupMenu * KOTodoView::getCategoryPopupMenu (KOTodoViewItem *todoItem)
{
- QPopupMenu* tempMenu = new QPopupMenu (this);
- QStringList checkedCategories = todoItem->todo()->categories ();
-
- tempMenu->setCheckable (true);
- for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
- it != KOPrefs::instance()->mCustomCategories.end ();
- ++it) {
- int index = tempMenu->insertItem (*it);
- mCategory[index] = *it;
- if (checkedCategories.find (*it) != checkedCategories.end ()) tempMenu->setItemChecked (index, true);
- }
-
- connect (tempMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
- return tempMenu;
-
-
+ if ( !mCategoryPopupMenu ) {
+ mCategoryPopupMenu = new QPopupMenu (this);
+ mCategoryPopupMenu->setCheckable (true);
+ connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
+ }
+ mCategoryPopupMenu->clear();
+ QStringList checkedCategories = todoItem->todo()->categories ();
+
+ for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
+ it != KOPrefs::instance()->mCustomCategories.end ();
+ ++it) {
+ int index = mCategoryPopupMenu->insertItem (*it);
+ mCategory[index] = *it;
+ if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true);
+ }
+ return mCategoryPopupMenu;
}
void KOTodoView::changedCategories(int index)
{