diff options
author | Nick Dedekind <nick.dedekind@canonical.com> | 2014-10-13 09:36:38 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-10-13 09:36:38 +0000 |
commit | e0ee0a8d96c5f883960c4c50dc362960a6fc8ade (patch) | |
tree | e70748a244b8f1dedd94f292b14533d9107b83b5 | |
parent | 49d7bf98770bc59820506b2736164936c5a32d1a (diff) | |
parent | ec1e10bebbab22cc92455898a6e3948d7ecf8ab4 (diff) | |
download | qmenumodel-e0ee0a8d96c5f883960c4c50dc362960a6fc8ade.tar.gz qmenumodel-e0ee0a8d96c5f883960c4c50dc362960a6fc8ade.tar.bz2 qmenumodel-e0ee0a8d96c5f883960c4c50dc362960a6fc8ade.zip |
Disconnect QDBusActionGroup add/remove/stateChange signals when deleting object. Fixes: 1378941
Approved by: Charles Kerr, Michael Sheldon, PS Jenkins bot, Lars Uebernickel
-rw-r--r-- | libqmenumodel/src/qdbusactiongroup.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libqmenumodel/src/qdbusactiongroup.cpp b/libqmenumodel/src/qdbusactiongroup.cpp index 5000470..0ef907a 100644 --- a/libqmenumodel/src/qdbusactiongroup.cpp +++ b/libqmenumodel/src/qdbusactiongroup.cpp @@ -161,13 +161,7 @@ void QDBusActionGroup::setActionGroup(GDBusActionGroup *ag) return; } - if (m_actionGroup) { - g_signal_handler_disconnect(m_actionGroup, m_signalActionAddId); - g_signal_handler_disconnect(m_actionGroup, m_signalActionRemovedId); - g_signal_handler_disconnect(m_actionGroup, m_signalStateChangedId); - m_signalActionAddId = m_signalActionRemovedId = m_signalStateChangedId = 0; - clear(); - } + clear(); m_actionGroup = reinterpret_cast<GActionGroup*>(ag); @@ -199,6 +193,13 @@ void QDBusActionGroup::setActionGroup(GDBusActionGroup *ag) /*! \internal */ void QDBusActionGroup::clear() { + if (m_actionGroup) { + g_signal_handler_disconnect(m_actionGroup, m_signalActionAddId); + g_signal_handler_disconnect(m_actionGroup, m_signalActionRemovedId); + g_signal_handler_disconnect(m_actionGroup, m_signalStateChangedId); + m_signalActionAddId = m_signalActionRemovedId = m_signalStateChangedId = 0; + } + Q_FOREACH(QStateAction *act, this->findChildren<QStateAction*>()) { Q_EMIT actionVanish(act->name()); } |