diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-08-24 19:53:29 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-08-24 19:53:29 +0200 |
commit | c8b25f704b84636d657ad001414223f407822aee (patch) | |
tree | 78c35852d865f3d5229ef9ef0a10e17b87d5335b /libqmenumodel/src/ayatanamenumodel.cpp | |
parent | 017363f11010aa1ec859a5a3f5fc76a7341539a3 (diff) | |
parent | ceaa2df6e9f96245a0e99edeb29a8b28c39c79b1 (diff) | |
download | qmenumodel-c8b25f704b84636d657ad001414223f407822aee.tar.gz qmenumodel-c8b25f704b84636d657ad001414223f407822aee.tar.bz2 qmenumodel-c8b25f704b84636d657ad001414223f407822aee.zip |
Attributes GH PR #23: https://github.com/AyatanaIndicators/qmenumodel/pull/23
Diffstat (limited to 'libqmenumodel/src/ayatanamenumodel.cpp')
-rw-r--r-- | libqmenumodel/src/ayatanamenumodel.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libqmenumodel/src/ayatanamenumodel.cpp b/libqmenumodel/src/ayatanamenumodel.cpp index 9ab0ff4..265309d 100644 --- a/libqmenumodel/src/ayatanamenumodel.cpp +++ b/libqmenumodel/src/ayatanamenumodel.cpp @@ -210,9 +210,16 @@ void AyatanaMenuModelPrivate::updateMenuModel() GDBusMenuModel *menu; menu = g_dbus_menu_model_get (this->connection, this->nameOwner, this->menuObjectPath.constData()); - this->menutracker = gtk_menu_tracker_new (GTK_ACTION_OBSERVABLE (this->muxer), - G_MENU_MODEL (menu), TRUE, NULL, - menuItemInserted, menuItemRemoved, this); + this->menutracker = gtk_menu_tracker_new(GTK_ACTION_OBSERVABLE (this->muxer), + G_MENU_MODEL (menu), + TRUE, + FALSE, + FALSE, + NULL, + NULL, + menuItemInserted, + menuItemRemoved, + this); g_object_unref (menu); } @@ -499,7 +506,7 @@ QVariant AyatanaMenuModel::data(const QModelIndex &index, int role) const return QKeySequence(gtk_menu_tracker_item_get_accel (item), QKeySequence::NativeText); case HasSubmenuRole: - return gtk_menu_tracker_item_get_has_submenu (item) != FALSE; + return gtk_menu_tracker_item_get_has_link (item, G_MENU_LINK_SUBMENU) != FALSE; default: return QVariant(); @@ -549,7 +556,7 @@ QObject * AyatanaMenuModel::submenu(int position, QQmlComponent* actionStatePars } item = (GtkMenuTrackerItem *) g_sequence_get (it); - if (!item || !gtk_menu_tracker_item_get_has_submenu (item)) { + if (!item || !gtk_menu_tracker_item_get_has_link (item, G_MENU_LINK_SUBMENU)) { return NULL; } @@ -564,10 +571,14 @@ QObject * AyatanaMenuModel::submenu(int position, QQmlComponent* actionStatePars } } - model->priv->menutracker = gtk_menu_tracker_new_for_item_submenu (item, + model->priv->menutracker = gtk_menu_tracker_new_for_item_link (item, + G_MENU_LINK_SUBMENU, + FALSE, + FALSE, AyatanaMenuModelPrivate::menuItemInserted, AyatanaMenuModelPrivate::menuItemRemoved, model->priv); + g_object_set_qdata (G_OBJECT (item), ayatana_submenu_model_quark (), model); } |