diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-11-15 02:11:11 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-11-15 02:11:11 +0800 |
commit | d182d3473e17421d7eafb2b4817dace196cec757 (patch) | |
tree | 50190658a40cfdd7db3733cf91c390912274ff8e /camel/providers | |
parent | d9a3bd550f45df85d896a695596e57bb57b1177d (diff) | |
download | gsoc2013-evolution-d182d3473e17421d7eafb2b4817dace196cec757.tar.gz gsoc2013-evolution-d182d3473e17421d7eafb2b4817dace196cec757.tar.zst gsoc2013-evolution-d182d3473e17421d7eafb2b4817dace196cec757.zip |
Handle "" as a request for a full dirscan as well (not just NULL). Makes
2003-11-14 Jeffrey Stedfast <fejj@ximian.com>
* providers/local/camel-mbox-store.c (get_folder_info): Handle ""
as a request for a full dirscan as well (not just NULL). Makes it
consistant with other stores.
(scan_dir): Set the fi->flags appropriately.
* providers/local/camel-mbox-folder.c
(camel_mbox_folder_get_full_path): Removed temporary hack.
svn path=/trunk/; revision=23356
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/local/camel-mbox-folder.c | 25 | ||||
-rw-r--r-- | camel/providers/local/camel-mbox-store.c | 18 |
2 files changed, 24 insertions, 19 deletions
diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c index b2a74ef2b8..9c3a7036f2 100644 --- a/camel/providers/local/camel-mbox-folder.c +++ b/camel/providers/local/camel-mbox-folder.c @@ -162,23 +162,18 @@ camel_mbox_folder_get_full_path (const char *toplevel_dir, const char *full_name path = g_malloc (strlen (toplevel_dir) + (inptr - full_name) + (4 * subdirs) + 1); p = g_stpcpy (path, toplevel_dir); - if (strcmp (toplevel_dir, "/") == 0) { - /* FIXME: temporary hack until we merge new-ui-branch into trunk */ - p = g_stpcpy (p, full_name); - } else { - inptr = full_name; - while (*inptr != '\0') { - while (*inptr != '/' && *inptr != '\0') - *p++ = *inptr++; + inptr = full_name; + while (*inptr != '\0') { + while (*inptr != '/' && *inptr != '\0') + *p++ = *inptr++; + + if (*inptr == '/') { + p = g_stpcpy (p, ".sbd/"); + inptr++; - if (*inptr == '/') { - p = g_stpcpy (p, ".sbd/"); + /* strip extranaeous '/'s */ + while (*inptr == '/') inptr++; - - /* strip extranaeous '/'s */ - while (*inptr == '/') - inptr++; - } } } diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c index b0de165656..d07176cc0d 100644 --- a/camel/providers/local/camel-mbox-store.c +++ b/camel/providers/local/camel-mbox-store.c @@ -580,8 +580,11 @@ scan_dir (CamelStore *store, GHashTable *visited, CamelFolderInfo *parent, const g_free (short_name); g_free (full_name); - if (!S_ISDIR (st.st_mode)) { + if (S_ISDIR (st.st_mode)) { + fi->flags = (fi->flags & ~CAMEL_FOLDER_NOINFERIORS) | CAMEL_FOLDER_CHILDREN; + } else { fi->unread_message_count = unread; + fi->flags &= ~CAMEL_FOLDER_NOSELECT; if ((ext = strchr (fi->url, ';')) && !strncmp (ext, ";noselect=yes", 13)) memmove (ext, ext + 13, strlen (ext + 13) + 1); } @@ -597,6 +600,11 @@ scan_dir (CamelStore *store, GHashTable *visited, CamelFolderInfo *parent, const fi->path = g_strdup_printf ("/%s", full_name); fi->unread_message_count = unread; + if (S_ISDIR (st.st_mode)) + fi->flags = CAMEL_FOLDER_NOSELECT; + else + fi->flags = CAMEL_FOLDER_NOINFERIORS; + if (tail == NULL) folders = fi; else @@ -617,7 +625,8 @@ scan_dir (CamelStore *store, GHashTable *visited, CamelFolderInfo *parent, const g_hash_table_insert (visited, inew, inew); - fi->child = scan_dir (store, visited, fi, path, fi->full_name, flags, ex); + if ((fi->child = scan_dir (store, visited, fi, path, fi->full_name, flags, ex))) + fi->flags |= CAMEL_FOLDER_CHILDREN; } } @@ -643,9 +652,10 @@ get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelExcepti struct stat st; int unread = -1; - path = mbox_folder_name_to_path (store, top ? top : ""); + top = top ? top : ""; + path = mbox_folder_name_to_path (store, top); - if (top == NULL) { + if (*top == '\0') { /* requesting root dir scan */ if (stat (path, &st) == -1 || !S_ISDIR (st.st_mode)) { g_free (path); |