[gtk/wip/baedert/for-master: 44/57] shortcutmanager: Use g_list_store_find()
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 44/57] shortcutmanager: Use g_list_store_find()
- Date: Thu, 31 Dec 2020 07:08:30 +0000 (UTC)
commit 9b1035087ece07f1debfe7faf02feaae32edc0aa
Author: Timm Bäder <mail baedert org>
Date: Sat Dec 26 09:59:46 2020 +0100
shortcutmanager: Use g_list_store_find()
We require glib 2.66 these days, so we can unconditionally use
g_list_store_find().
gtk/gtkshortcutmanager.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkshortcutmanager.c b/gtk/gtkshortcutmanager.c
index 0351490df2..ec70791e77 100644
--- a/gtk/gtkshortcutmanager.c
+++ b/gtk/gtkshortcutmanager.c
@@ -108,24 +108,11 @@ gtk_shortcut_manager_default_remove_controller (GtkShortcutManager *self,
if (model)
{
GListModel *store;
- guint position, len;
+ guint position;
store = gtk_flatten_list_model_get_model (model);
-#if 0 && GLIB_CHECK_VERSION(2,64,0)
- if (_g_list_store_find (G_LIST_STORE (store), controller, &position))
+ if (g_list_store_find (G_LIST_STORE (store), controller, &position))
g_list_store_remove (G_LIST_STORE (store), position);
-#else
- for (position = 0, len = g_list_model_get_n_items (store); position < len; position++)
- {
- GtkShortcutController *item = g_list_model_get_item (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]