[gtk/wip/matthiasc/shortcut-2] shortcutmanager: Fix the build with GLib < 2.64
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/shortcut-2] shortcutmanager: Fix the build with GLib < 2.64
- Date: Tue, 24 Mar 2020 21:16:02 +0000 (UTC)
commit 5412f4b4b7d123f28a30d5576b9e8ec19a9073f5
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Mar 24 17:14:39 2020 -0400
shortcutmanager: Fix the build with GLib < 2.64
We don't have recent GLib in ci.
gtk/gtkshortcutmanager.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkshortcutmanager.c b/gtk/gtkshortcutmanager.c
index 625e594d84..71a1b35eb1 100644
--- a/gtk/gtkshortcutmanager.c
+++ b/gtk/gtkshortcutmanager.c
@@ -109,8 +109,21 @@ gtk_shortcut_manager_default_remove_controller (GtkShortcutManager *self,
guint position;
store = gtk_flatten_list_model_get_model (model);
- if (g_list_store_find (G_LIST_STORE (store), controller, &position))
+#if 0 && GLIB_CHECK_VERSION(2,64,0)
+ if (_g_list_store_find (G_LIST_STORE (store), controller, &position))
g_list_store_remove (G_LIST_STORE (store), position);
+#else
+ for (position = 0; position < g_list_model_get_n_items (G_LIST_MODEL (store)); position++)
+ {
+ GtkShortcutController *item = g_list_model_get_item (G_LIST_MODEL (store), position);
+ g_object_unref (item);
+ if (item == controller)
+ {
+ g_list_store_remove (G_LIST_STORE (store), position);
+ break;
+ }
+ }
+#endif
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]