aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-08-15 11:45:39 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-08-15 11:45:39 +0200
commita05e8b1afc34f82592d56834bd9195712bbc306d (patch)
tree784bcbd2025c232462b665d1f55773be12b8c65e
parenta17ce349a9185f22f73e20384547f6aae042bd78 (diff)
parentfa430b5d23e35fd06ebfb50f73d743f943fe7fcd (diff)
downloadqmenumodel-a05e8b1afc34f82592d56834bd9195712bbc306d.tar.gz
qmenumodel-a05e8b1afc34f82592d56834bd9195712bbc306d.tar.bz2
qmenumodel-a05e8b1afc34f82592d56834bd9195712bbc306d.zip
Merge branch 'ayatana-type'
Attributes GH PR #1: https://github.com/AyatanaIndicators/qmenumodel/pull/1
-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;