diff options
author | Nick Dedekind <nick.dedekind@canonical.com> | 2016-01-15 12:08:41 +0000 |
---|---|---|
committer | Nick Dedekind <nick.dedekind@canonical.com> | 2016-01-15 12:08:41 +0000 |
commit | 97b75c99800fed0de7600169c99893c4be25a1c9 (patch) | |
tree | 81ed46731f31356fc0e7a309aa2f2fcc80fa22bc /libqmenumodel/src/qdbusactiongroup.cpp | |
parent | e6e4babce2ed63c327f85180d77e24dc6a330c11 (diff) | |
parent | 523db871138277062675db9108cbcb3ca61da5e1 (diff) | |
download | qmenumodel-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.cpp | 13 |
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); |