From fa430b5d23e35fd06ebfb50f73d743f943fe7fcd Mon Sep 17 00:00:00 2001 From: Marius Gripsgard Date: Sat, 15 Aug 2020 01:16:52 +0200 Subject: 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) --- libqmenumodel/src/unitymenumodel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3