@@ -62,6 +62,8 @@ void RootActionState::setMenu(UnityMenuModel* menu)
62 connect(m_menu, SIGNAL(rowsRemoved(const QModelIndex&, int, int)), SLOT(onModelRowsRemoved(const QModelIndex&, int, int)));
62 connect(m_menu, SIGNAL(rowsRemoved(const QModelIndex&, int, int)), SLOT(onModelRowsRemoved(const QModelIndex&, int, int)));
63 connect(m_menu, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>&)), SLOT(onModelDataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>&)));
63 connect(m_menu, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>&)), SLOT(onModelDataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>&)));
65+ connect(m_menu, SIGNAL(destroyed()), SLOT(reset()));
65 m_menu->setActionStateParser(this);
67 m_menu->setActionStateParser(this);
67 updateActionState();
69 updateActionState();
@@ -97,6 +99,14 @@ void RootActionState::onModelDataChanged(const QModelIndex& topLeft, const QMode
102+void RootActionState::reset() {
103+ m_cachedState.clear();
106+ Q_EMIT menuChanged();
100void RootActionState::updateActionState()
110void RootActionState::updateActionState()
102 if (m_menu && m_menu->rowCount() > 0) {
112 if (m_menu && m_menu->rowCount() > 0) {