aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/src/qdbusactiongroup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libqmenumodel/src/qdbusactiongroup.cpp')
-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());
}