aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2014-07-11 12:02:01 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2014-07-11 12:02:01 +0200
commit35c2996397d99071189714d408bc9d24510bd1d1 (patch)
treed65ab8b68ebbd1e66291d143efaeecb42298fd2b /libqmenumodel
parent7be80e6fe41518329468dd696abd68b0c190de5a (diff)
downloadqmenumodel-35c2996397d99071189714d408bc9d24510bd1d1.tar.gz
qmenumodel-35c2996397d99071189714d408bc9d24510bd1d1.tar.bz2
qmenumodel-35c2996397d99071189714d408bc9d24510bd1d1.zip
unitymenumodel: add nameOwner property
Diffstat (limited to 'libqmenumodel')
-rw-r--r--libqmenumodel/src/unitymenumodel.cpp9
-rw-r--r--libqmenumodel/src/unitymenumodel.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp
index 969436f..a75e8c8 100644
--- a/libqmenumodel/src/unitymenumodel.cpp
+++ b/libqmenumodel/src/unitymenumodel.cpp
@@ -170,6 +170,8 @@ void UnityMenuModelPrivate::clearName()
this->updateActions();
this->updateMenuModel();
+
+ Q_EMIT model->nameOwnerChanged (this->nameOwner);
}
void UnityMenuModelPrivate::updateActions()
@@ -231,6 +233,8 @@ void UnityMenuModelPrivate::nameAppeared(GDBusConnection *connection, const gcha
priv->updateActions();
priv->updateMenuModel();
+
+ Q_EMIT priv->model->nameOwnerChanged (priv->nameOwner);
}
void UnityMenuModelPrivate::nameVanished(GDBusConnection *connection, const gchar *name, gpointer user_data)
@@ -295,6 +299,11 @@ QByteArray UnityMenuModel::busName() const
return priv->busName;
}
+QByteArray UnityMenuModel::nameOwner() const
+{
+ return priv->nameOwner;
+}
+
void UnityMenuModel::setBusName(const QByteArray &name)
{
if (name == priv->busName)
diff --git a/libqmenumodel/src/unitymenumodel.h b/libqmenumodel/src/unitymenumodel.h
index 30bc62d..8816d22 100644
--- a/libqmenumodel/src/unitymenumodel.h
+++ b/libqmenumodel/src/unitymenumodel.h
@@ -28,6 +28,7 @@ class UnityMenuModel: public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(QByteArray busName READ busName WRITE setBusName NOTIFY busNameChanged)
+ Q_PROPERTY(QByteArray nameOwner READ nameOwner NOTIFY nameOwnerChanged)
Q_PROPERTY(QVariantMap actions READ actions WRITE setActions NOTIFY actionsChanged)
Q_PROPERTY(QByteArray menuObjectPath READ menuObjectPath WRITE setMenuObjectPath NOTIFY menuObjectPathChanged)
Q_PROPERTY(ActionStateParser* actionStateParser READ actionStateParser WRITE setActionStateParser NOTIFY actionStateParserChanged)
@@ -39,6 +40,8 @@ public:
QByteArray busName() const;
void setBusName(const QByteArray &name);
+ QByteArray nameOwner() const;
+
QVariantMap actions() const;
void setActions(const QVariantMap &actions);
@@ -67,6 +70,7 @@ public:
Q_SIGNALS:
void busNameChanged(const QByteArray &name);
+ void nameOwnerChanged(const QByteArray &owner);
void actionsChanged(const QByteArray &path);
void menuObjectPathChanged(const QByteArray &path);
void actionStateParserChanged(ActionStateParser* parser);