From d2d447d93601fd9ff603bc324f2a2eec9f98edff Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Sun, 31 May 2009 17:42:21 +0200 Subject: [PATCH] Show inbox children in folder view as toplevel folders. * src/widgets/modest-folder-view.c (convert_parent_folders_to_dots): remove the inbox folders in the list of parent dots for folders representation in compact view (fixes NB#119822). --- src/widgets/modest-folder-view.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/widgets/modest-folder-view.c b/src/widgets/modest-folder-view.c index 07334c5..97315c1 100644 --- a/src/widgets/modest-folder-view.c +++ b/src/widgets/modest-folder-view.c @@ -502,15 +502,28 @@ static void convert_parent_folders_to_dots (gchar **item_name) { gint n_parents = 0; + gint n_inbox_parents = 0; gchar *c; + gchar *path_start; gchar *last_separator; if (item_name == NULL) return; + path_start = *item_name; for (c = *item_name; *c != '\0'; c++) { if (g_str_has_prefix (c, MODEST_FOLDER_PATH_SEPARATOR)) { + gchar *compare; + if (c != path_start) { + compare = g_strndup (path_start, c - path_start); + compare = g_strstrip (compare); + if (g_ascii_strcasecmp (compare, "inbox") == 0) { + n_inbox_parents++; + } + g_free (compare); + } n_parents++; + path_start = c + 1; } } @@ -524,7 +537,7 @@ convert_parent_folders_to_dots (gchar **item_name) gint i; buffer = g_string_new (""); - for (i = 0; i < n_parents; i++) { + for (i = 0; i < n_parents - n_inbox_parents; i++) { buffer = g_string_append (buffer, MODEST_FOLDER_DOT); } buffer = g_string_append (buffer, last_separator); -- 1.7.9.5