diff options
author | Michael Zucci <zucchi@src.gnome.org> | 2000-05-03 04:37:06 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-05-03 04:37:06 +0800 |
commit | 44575d972d94ce00b0e7c5d46bbb59761d5c840d (patch) | |
tree | d2624f4d14afb5aebc8b2ef0f323db27258a5080 /camel/camel-folder.c | |
parent | cf99b8eec231365fedce7d7930ded14334da3741 (diff) | |
download | gsoc2013-evolution-44575d972d94ce00b0e7c5d46bbb59761d5c840d.tar gsoc2013-evolution-44575d972d94ce00b0e7c5d46bbb59761d5c840d.tar.gz gsoc2013-evolution-44575d972d94ce00b0e7c5d46bbb59761d5c840d.tar.bz2 gsoc2013-evolution-44575d972d94ce00b0e7c5d46bbb59761d5c840d.tar.lz gsoc2013-evolution-44575d972d94ce00b0e7c5d46bbb59761d5c840d.tar.xz gsoc2013-evolution-44575d972d94ce00b0e7c5d46bbb59761d5c840d.tar.zst gsoc2013-evolution-44575d972d94ce00b0e7c5d46bbb59761d5c840d.zip |
> * gmime-utils.[ch]: What the hell, remove it. This will break the
> nntp provider (but its broken anyway). The mime parser can be
> used instead though.
> Removed from all code including it (but none were using it).
>
> * gmime-utils.c (_store_header_pair_from_string): Removed bizarre
> string_dichotomy version of this. This code is somewhat redundant
> now, and is headed for death anyway.
>
> * gstring-util.c (g_string_dichotomy): Same with this one.
> (g_string_clone): Removed a memory leak, g_string_new() allocates
> its own memory.
> (g_string_append_g_string): Allow to append an empty gstring onto
> another gstring, dont abort()!
>
> * string-utils.c (string_dichotomy): Removed this incredibly weird
> function.
>
> * camel-folder.c (_create): Replaced the rather obtuse use of
> "string_dichotomy" function with a simple strrchr(). Still not
> sure it'll work.
>
> * camel-folder-summary.c: cvs removed a long-removed file.
svn path=/trunk/; revision=2753
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r-- | camel/camel-folder.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/camel/camel-folder.c b/camel/camel-folder.c index c979c3278b..6455fbf77b 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -679,40 +679,29 @@ camel_folder_get_subfolder (CamelFolder *folder, gchar *folder_name, CamelExcept static gboolean _create (CamelFolder *folder, CamelException *ex) { - gchar *prefix; - gchar dich_result; CamelFolder *parent; g_assert (folder->parent_store != NULL); g_assert (folder->name != NULL); - /* if the folder already exists on the - store, do nothing and return true */ + /* if the folder already exists on the store, do nothing and return true */ if (CF_CLASS (folder)->exists (folder, ex)) return TRUE; - if (folder->parent_folder) { camel_folder_create (folder->parent_folder, ex); - if (camel_exception_get_id (ex)) return FALSE; - } - else { - if (folder->full_name) { - dich_result = string_dichotomy ( - folder->full_name, - folder->separator, - &prefix, NULL, - STRING_DICHOTOMY_STRIP_TRAILING | STRING_DICHOTOMY_RIGHT_DIR); - if (dich_result!='o') { - if (prefix == NULL) { - /* separator is the first caracter, no folder above */ - return TRUE; - } - } else { - parent = camel_store_get_folder (folder->parent_store, prefix, ex); - camel_folder_create (parent, ex); - if (camel_exception_get_id (ex)) return FALSE; - } + if (camel_exception_get_id (ex)) + return FALSE; + } else if (folder->full_name) { + char *slash, *prefix; + + slash = strrchr(folder->full_name, folder->separator); + if (slash && slash != folder->full_name) { + prefix = g_strndup(folder->full_name, slash-folder->full_name); + parent = camel_store_get_folder (folder->parent_store, prefix, ex); + camel_folder_create (parent, ex); + if (camel_exception_get_id (ex)) + return FALSE; } } return TRUE; |