diff options
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); |