From c1d59fcb62563f31b5f753fa90b5c7bd2baa5fed Mon Sep 17 00:00:00 2001 From: bertrand Date: Mon, 3 Jan 2000 22:40:54 +0000 Subject: detects netscape ".sdb" folders as well as simple non-suffixed folders (as 2000-01-03 bertrand * camel/providers/mbox/camel-mbox-folder.c (_list_subfolders): detects netscape ".sdb" folders as well as simple non-suffixed folders (as the ones used in pine). * camel/string-utils.c (string_prefix): finished implementation. (string_prefix): added a boolean flag to indicate if the suffix has been found. When the suffix does not match, return NULL. svn path=/trunk/; revision=1531 --- camel/providers/mbox/camel-mbox-folder.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'camel/providers') diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c index 90d9399833..44d2ec8913 100644 --- a/camel/providers/mbox/camel-mbox-folder.c +++ b/camel/providers/mbox/camel-mbox-folder.c @@ -34,7 +34,7 @@ #include "camel-mbox-folder.h" #include "camel-mbox-store.h" -#include "gstring-util.h" +#include "string-utils.h" #include "camel-log.h" #include "camel-stream-buffered-fs.h" #include "camel-folder-summary.h" @@ -641,10 +641,13 @@ _list_subfolders (CamelFolder *folder, CamelException *ex) GList *file_list; gchar *entry_name; gchar *full_entry_name; + gchar *real_folder_name; struct dirent *dir_entry; DIR *dir_handle; + gboolean folder_suffix_found; gchar *io_error_text; + /* check if the folder object exists */ @@ -697,8 +700,17 @@ _list_subfolders (CamelFolder *folder, CamelException *ex) if (entry_name[0] != '.') { CAMEL_LOG_FULL_DEBUG ("CamelMboxFolder::list_subfolders adding " "%s\n", entry_name); + + /* if the folder is a netscape folder, remove the + ".sdb" from the name */ + real_folder_name = string_prefix (entry_name, ".sdb", &folder_suffix_found); + /* stick here the tests for other folder suffixes if any */ + + if (!folder_suffix_found) real_folder_name = g_strdup (entry_name); + + /* add the folder name to the list */ subfolder_name_list = g_list_append (subfolder_name_list, - g_strdup (entry_name)); + real_folder_name); } } /* read next entry */ -- cgit v1.2.3