aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel
diff options
context:
space:
mode:
authorMarius Gripsgard <marius@ubports.com>2020-08-15 01:16:52 +0200
committerMarius Gripsgard <marius@ubports.com>2020-08-15 01:16:52 +0200
commitfa430b5d23e35fd06ebfb50f73d743f943fe7fcd (patch)
tree784bcbd2025c232462b665d1f55773be12b8c65e /libqmenumodel
parenta17ce349a9185f22f73e20384547f6aae042bd78 (diff)
downloadqmenumodel-fa430b5d23e35fd06ebfb50f73d743f943fe7fcd.tar.gz
qmenumodel-fa430b5d23e35fd06ebfb50f73d743f943fe7fcd.tar.bz2
qmenumodel-fa430b5d23e35fd06ebfb50f73d743f943fe7fcd.zip
Support ayatana type
This adds support for x-ayatana-type but keeps the old x-canonical-type in case we have mixed type (as the case with ubuntu touch where we have indicators that are yet to be moved to ayatana)
Diffstat (limited to 'libqmenumodel')
-rw-r--r--libqmenumodel/src/unitymenumodel.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp
index a9a62aa..fafed4c 100644
--- a/libqmenumodel/src/unitymenumodel.cpp
+++ b/libqmenumodel/src/unitymenumodel.cpp
@@ -455,7 +455,13 @@ QVariant UnityMenuModel::data(const QModelIndex &index, int role) const
case TypeRole: {
gchar *type;
- if (gtk_menu_tracker_item_get_attribute (item, "x-canonical-type", "s", &type)) {
+ auto ret = gtk_menu_tracker_item_get_attribute (item, "x-ayatana-type", "s", &type);
+
+ // If we can't get x-ayatana-type, try legacy x-canonical-type type
+ if (!ret)
+ ret = gtk_menu_tracker_item_get_attribute (item, "x-canonical-type", "s", &type);
+
+ if (ret) {
QVariant v(type);
g_free (type);
return v;