aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/src
diff options
context:
space:
mode:
authorNick Dedekind <nick.dedekind@canonical.com>2014-10-10 18:28:11 +0100
committerNick Dedekind <nick.dedekind@canonical.com>2014-10-10 18:28:11 +0100
commitec1e10bebbab22cc92455898a6e3948d7ecf8ab4 (patch)
treee70748a244b8f1dedd94f292b14533d9107b83b5 /libqmenumodel/src
parent49d7bf98770bc59820506b2736164936c5a32d1a (diff)
downloadqmenumodel-ec1e10bebbab22cc92455898a6e3948d7ecf8ab4.tar.gz
qmenumodel-ec1e10bebbab22cc92455898a6e3948d7ecf8ab4.tar.bz2
qmenumodel-ec1e10bebbab22cc92455898a6e3948d7ecf8ab4.zip
disconnect on clear
Diffstat (limited to 'libqmenumodel/src')
-rw-r--r--libqmenumodel/src/qdbusactiongroup.cpp15
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());
}