diff options
author | Christian Dywan <christian@twotoasts.de> | 2013-03-27 01:05:59 +0100 |
---|---|---|
committer | Christian Dywan <christian@twotoasts.de> | 2013-03-27 01:05:59 +0100 |
commit | adbe76a43701ad59a3d72338e5b0aa0ac78649a4 (patch) | |
tree | 58e4689e4292f4d9b3c7200c761a1c7b3c405d8a /katze/katze-utils.c | |
parent | 09726870f6239bc4312552bc7b7221320d071882 (diff) | |
download | midori-adbe76a43701ad59a3d72338e5b0aa0ac78649a4.tar.gz |
Avoid g_list_nth on app infos in katze utils
Diffstat (limited to 'katze/katze-utils.c')
-rw-r--r-- | katze/katze-utils.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/katze/katze-utils.c b/katze/katze-utils.c index 239785d3..ebf7477a 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -316,10 +316,11 @@ katze_app_info_get_all_for_category (const gchar* category) GList* all_apps = g_app_info_get_all (); #endif GList* apps = NULL; - guint i = 0; GAppInfo* info; - while ((info = g_list_nth_data (all_apps, i++))) + GList* app; + for (app = apps; app; app = g_list_next (app)) { + GAppInfo* info = app->data; #ifdef GDK_WINDOWING_X11 gchar* filename = g_strconcat ("applications/", g_app_info_get_id (info), NULL); GKeyFile* file = g_key_file_new (); @@ -573,10 +574,10 @@ katze_property_proxy (gpointer object, if (apps != NULL) { - gint i = 0; - - while ((info = g_list_nth_data (apps, i++))) + GList* app; + for (app = apps; app; app = g_list_next (app)) { + GAppInfo* info = app->data; const gchar* name = g_app_info_get_name (info); GIcon* icon = g_app_info_get_icon (info); gchar* icon_name; |