From kde-commits Sat Jan 12 12:42:57 2013 From: Pierre Stirnweiss Date: Sat, 12 Jan 2013 12:42:57 +0000 To: kde-commits Subject: [calligra] plugins/textshape/dialogs: Fix NextStyle combo does not work in the StyleManager dialog Message-Id: <20130112124257.C75CEA60D4 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=135799458910209 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 =3D new StylesDelegate(); + StylesDelegate *delegate =3D dynamic_cast(itemDelegat= e()); + Q_ASSERT(delegate); + if (!delegate) { //the following should never get called as we are cre= ating a StylesDelegate on the constructor; + StylesDelegate *delegate =3D new StylesDelegate(); + connect(delegate, SIGNAL(needsUpdate(QModelIndex)), m_view, SLOT(u= pdate(QModelIndex))); + connect(delegate, SIGNAL(styleManagerButtonClicked(QModelIndex)), = this, SLOT(slotShowDia(QModelIndex))); + connect(delegate, SIGNAL(deleteStyleButtonClicked(QModelIndex)), t= his, SLOT(slotDeleteStyle(QModelIndex))); + connect(delegate, SIGNAL(clickedInItem(QModelIndex)), this, SLOT(s= lotItemClicked(QModelIndex))); + setItemDelegate(delegate); + } delegate->setEditButtonEnable(show); - setItemDelegate(delegate); } = #include