aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/src/qdbusactiongroup.cpp
diff options
context:
space:
mode:
authorNick Dedekind <nick.dedekind@canonical.com>2016-01-15 12:08:41 +0000
committerNick Dedekind <nick.dedekind@canonical.com>2016-01-15 12:08:41 +0000
commit97b75c99800fed0de7600169c99893c4be25a1c9 (patch)
tree81ed46731f31356fc0e7a309aa2f2fcc80fa22bc /libqmenumodel/src/qdbusactiongroup.cpp
parente6e4babce2ed63c327f85180d77e24dc6a330c11 (diff)
parent523db871138277062675db9108cbcb3ca61da5e1 (diff)
downloadqmenumodel-97b75c99800fed0de7600169c99893c4be25a1c9.tar.gz
qmenumodel-97b75c99800fed0de7600169c99893c4be25a1c9.tar.bz2
qmenumodel-97b75c99800fed0de7600169c99893c4be25a1c9.zip
Added roles for submenu & shortcut. Added actions
Diffstat (limited to 'libqmenumodel/src/qdbusactiongroup.cpp')
-rw-r--r--libqmenumodel/src/qdbusactiongroup.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libqmenumodel/src/qdbusactiongroup.cpp b/libqmenumodel/src/qdbusactiongroup.cpp
index b29ece0..76e28ed 100644
--- a/libqmenumodel/src/qdbusactiongroup.cpp
+++ b/libqmenumodel/src/qdbusactiongroup.cpp
@@ -70,6 +70,18 @@ QDBusActionGroup::~QDBusActionGroup()
clear();
}
+QStringList QDBusActionGroup::actions() const
+{
+ if (!m_actionGroup) return QStringList();
+ QStringList list;
+ gchar** actions = g_action_group_list_actions(m_actionGroup);
+ for (uint i = 0; actions[i]; i++) {
+ list << QString(actions[i]);
+ }
+ g_strfreev(actions);
+ return list;
+}
+
/*!
\qmlmethod QDBusActionGroup::action(QString name)
@@ -258,6 +270,7 @@ bool QDBusActionGroup::event(QEvent* e)
} else {
Q_EMIT actionVanish(dave->name);
}
+ Q_EMIT actionsChanged();
} else if (e->type() == DBusActionStateEvent::eventType) {
DBusActionStateEvent *dase = static_cast<DBusActionStateEvent*>(e);