1
From 8ed86ae526dda44ed2c9f793facd5f5c70dc15ec Mon Sep 17 00:00:00 2001
2
From: Bastien Nocera <hadess@hadess.net>
3
Date: Wed, 20 Feb 2013 23:03:27 +0000
4
Subject: housekeeping: Fix incorrect handling of ignore_paths
6
You can't use G_N_ELEMENTS() on a non-static array.
8
Also use a guint to iterate, and prepend to the list (which
9
is quicker than appending for long lists).
11
diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
12
index b2976ea..704dd6c 100644
13
--- a/plugins/housekeeping/gsd-disk-space.c
14
+++ b/plugins/housekeeping/gsd-disk-space.c
15
@@ -965,12 +965,10 @@ gsd_ldsm_get_config (void)
17
settings_list = g_settings_get_strv (settings, SETTINGS_IGNORE_PATHS);
18
if (settings_list != NULL) {
22
- for (i = 0; i < G_N_ELEMENTS (settings_list); i++) {
23
- if (settings_list[i] != NULL)
24
- ignore_paths = g_slist_append (ignore_paths, g_strdup (settings_list[i]));
26
+ for (i = 0; i < settings_list[i] != NULL; i++)
27
+ ignore_paths = g_slist_prepend (ignore_paths, g_strdup (settings_list[i]));
29
/* Make sure we dont leave stale entries in ldsm_notified_hash */
30
g_hash_table_foreach_remove (ldsm_notified_hash,