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

List:       kde-commits
Subject:    [calligra/textshape-stylesWidget-PierreSt] plugins/textshape/dialogs: Fix NextStyle combo does not w
From:       Pierre Stirnweiss <pstirnweiss () googlemail ! com>
Date:       2013-01-12 13:11:16
Message-ID: 20130112131116.4625FA60D4 () git ! kde ! org
[Download RAW message or body]

Git commit e0ee4921e0602168bd16a768340131634f81d8f7 by Pierre Stirnweiss.
Committed on 06/01/2013 at 10:04.
Pushed by pstirnweiss into branch 'textshape-stylesWidget-PierreSt'.

Fix NextStyle combo does not work in the StyleManager dialog

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

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

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