[gtk+/gtk-3-20] app: improve code of extract_accels_from_menu()
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-20] app: improve code of extract_accels_from_menu()
- Date: Tue, 19 Apr 2016 14:57:05 +0000 (UTC)
commit a2a3de7861f3b58d8b8893ccbf1adba860c9c09e
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Apr 10 12:41:09 2016 +0200
app: improve code of extract_accels_from_menu()
sub_model is clearer than "m". And we don't use the key, so we can pass
NULL instead.
https://bugzilla.gnome.org/show_bug.cgi?id=764846
gtk/gtkapplication.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index 8da35b6..8bd0f0a 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -829,19 +829,19 @@ extract_accels_from_menu (GMenuModel *model,
GtkApplication *app)
{
gint i;
- GMenuLinkIter *iter;
- const gchar *key;
- GMenuModel *m;
for (i = 0; i < g_menu_model_get_n_items (model); i++)
{
+ GMenuLinkIter *iter;
+ GMenuModel *sub_model;
+
extract_accel_from_menu_item (model, i, app);
iter = g_menu_model_iterate_item_links (model, i);
- while (g_menu_link_iter_get_next (iter, &key, &m))
+ while (g_menu_link_iter_get_next (iter, NULL, &sub_model))
{
- extract_accels_from_menu (m, app);
- g_object_unref (m);
+ extract_accels_from_menu (sub_model, app);
+ g_object_unref (sub_model);
}
g_object_unref (iter);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]