[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra] plugins/textshape/dialogs: Fix NextStyle combo does not work in the StyleManager dialog
From:       Pierre Stirnweiss <pstirnweiss () googlemail ! com>
Date:       2013-01-12 12:42:57
Message-ID: 20130112124257.C75CEA60D4 () git ! kde ! org
[Download RAW message or body]

Git commit bc364bbfb1113df99eb418d5f2303851f869a8c2 by Pierre Stirnweiss.
Committed on 06/01/2013 at 10:04.
Pushed by pstirnweiss into branch 'master'.

Fix NextStyle combo does not work in the StyleManager dialog

M  +10   -2    plugins/textshape/dialogs/StylesCombo.cpp

http://commits.kde.org/calligra/bc364bbfb1113df99eb418d5f2303851f869a8c2

diff --git a/plugins/textshape/dialogs/StylesCombo.cpp \
b/plugins/textshape/dialogs/StylesCombo.cpp index 16f50a5..4296ce1 100644
--- a/plugins/textshape/dialogs/StylesCombo.cpp
+++ b/plugins/textshape/dialogs/StylesCombo.cpp
@@ -203,9 +203,17 @@ void StylesCombo::slotModelReset()
 }
 
 void StylesCombo::showEditIcon(bool show){
-    StylesDelegate *delegate = new StylesDelegate();
+    StylesDelegate *delegate = dynamic_cast<StylesDelegate*>(itemDelegate());
+    Q_ASSERT(delegate);
+    if (!delegate) { //the following should never get called as we are creating a \
StylesDelegate on the constructor; +        StylesDelegate *delegate = new \
StylesDelegate(); +        connect(delegate, SIGNAL(needsUpdate(QModelIndex)), \
m_view, SLOT(update(QModelIndex))); +        connect(delegate, \
SIGNAL(styleManagerButtonClicked(QModelIndex)), this, \
SLOT(slotShowDia(QModelIndex))); +        connect(delegate, \
SIGNAL(deleteStyleButtonClicked(QModelIndex)), this, \
SLOT(slotDeleteStyle(QModelIndex))); +        connect(delegate, \
SIGNAL(clickedInItem(QModelIndex)), this, SLOT(slotItemClicked(QModelIndex))); +      \
setItemDelegate(delegate); +    }
     delegate->setEditButtonEnable(show);
-    setItemDelegate(delegate);
 }
 
 #include <StylesCombo.moc>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic