diff options
author | Nick Dedekind <nick.dedekind@canonical.com> | 2016-12-09 17:06:25 +0000 |
---|---|---|
committer | Nick Dedekind <nick.dedekind@canonical.com> | 2016-12-09 17:06:25 +0000 |
commit | 69093dc4fc54cd4e224b44522b7f8c12cefef515 (patch) | |
tree | 26614f554fc263cf228766e2da1cbe5ca51df915 /libqmenumodel/src/qstateaction.cpp | |
parent | a618ff5e99c82aca263e8a52fa2c482b2d58754b (diff) | |
parent | 89f2b36ed993aead5599d937f0d870db1321b9e1 (diff) | |
download | qmenumodel-69093dc4fc54cd4e224b44522b7f8c12cefef515.tar.gz qmenumodel-69093dc4fc54cd4e224b44522b7f8c12cefef515.tar.bz2 qmenumodel-69093dc4fc54cd4e224b44522b7f8c12cefef515.zip |
merged with trunk
Diffstat (limited to 'libqmenumodel/src/qstateaction.cpp')
-rw-r--r-- | libqmenumodel/src/qstateaction.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libqmenumodel/src/qstateaction.cpp b/libqmenumodel/src/qstateaction.cpp index 983064a..fcffa44 100644 --- a/libqmenumodel/src/qstateaction.cpp +++ b/libqmenumodel/src/qstateaction.cpp @@ -19,6 +19,7 @@ #include "qstateaction.h" +#include "converter.h" #include "qdbusactiongroup.h" /*! @@ -99,6 +100,15 @@ void QStateAction::updateState(const QVariant &state) } /*! + Request for the state of action to be changed to \a paramenter. + This call merely requests a change. The action may refuse to change its state or may change its state to something other than \a paramenter. +*/ +void QStateAction::updateStateByVariantString(const QString &state) +{ + updateState(Converter::toQVariantFromVariantString(state)); +} + +/*! Activates the action passing \a parameter. \a parameter must be the correct type of parameter for the action */ @@ -107,6 +117,16 @@ void QStateAction::activate(const QVariant ¶meter) m_group->activateAction(m_name, parameter); } +/*! + Activates the action passing \a parameter using GLib Variant String format. + \a parameter must be the correct type of parameter for the action +*/ +void QStateAction::activateByVariantString(const QString ¶meter) +{ + activate(Converter::toQVariantFromVariantString(parameter)); +} + + /*! \internal */ QString QStateAction::name() const { |