The root folder's name is "", not the namespace. (camel_imap_folder_new):

* providers/imap/camel-imap-folder.c
        (imap_get_subfolder_info_internal): The root folder's name is "",
        not the namespace.
        (camel_imap_folder_new): constify folder_name.

        * providers/imap/camel-imap-store.c (get_folder): Create the
        folder with folder_name, not folder_path.
        (camel_imap_command_preliminary): Don't free cmdid here.

svn path=/trunk/; revision=5552
This commit is contained in:
Dan Winship
2000-09-22 18:44:07 +00:00
parent 561de41856
commit 0eb67058be
4 changed files with 18 additions and 11 deletions

View File

@ -1,3 +1,14 @@
2000-09-22 Dan Winship <danw@helixcode.com>
* providers/imap/camel-imap-folder.c
(imap_get_subfolder_info_internal): The root folder's name is "",
not the namespace.
(camel_imap_folder_new): constify folder_name.
* providers/imap/camel-imap-store.c (get_folder): Create the
folder with folder_name, not folder_path.
(camel_imap_command_preliminary): Don't free cmdid here.
2000-09-21 Dan Winship <danw@helixcode.com>
* providers/imap/camel-imap-utils.c (imap_create_flag_list): New

View File

@ -185,10 +185,10 @@ camel_imap_folder_get_type (void)
}
CamelFolder *
camel_imap_folder_new (CamelStore *parent, char *folder_name)
camel_imap_folder_new (CamelStore *parent, const char *folder_name)
{
CamelFolder *folder = CAMEL_FOLDER (camel_object_new (camel_imap_folder_get_type ()));
char *dir_sep, *short_name;
const char *dir_sep, *short_name;
dir_sep = CAMEL_IMAP_STORE (parent)->dir_sep;
short_name = strrchr (folder_name, *dir_sep);
@ -571,7 +571,7 @@ imap_get_subfolder_info_internal (CamelFolder *folder, CamelException *ex)
}
}
if (!strcmp (folder->name, namespace) && !found_inbox) {
if (!*folder->name && !found_inbox) {
fi = g_new0 (CamelFolderInfo, 1);
fi->full_name = g_strdup ("INBOX");
fi->name = g_strdup ("INBOX");

View File

@ -62,7 +62,7 @@ typedef struct {
/* public methods */
CamelFolder *camel_imap_folder_new (CamelStore *parent, char *folder_name);
CamelFolder *camel_imap_folder_new (CamelStore *parent, const char *folder_name);
void camel_imap_folder_changed (CamelFolder *folder, gint recent, GPtrArray *expunged,
CamelException *ex);

View File

@ -389,16 +389,15 @@ get_folder (CamelStore *store, const char *folder_name, gboolean create, CamelEx
gboolean exists = FALSE;
gboolean selectable;
folder_path = camel_imap_store_folder_path (imap_store, folder_name);
new_folder = camel_imap_folder_new (store, folder_path);
new_folder = camel_imap_folder_new (store, folder_name);
/* this is the top-level dir, we already know it exists - it has to! */
if (!*folder_name) {
g_free (folder_path);
camel_folder_refresh_info (new_folder, ex);
return new_folder;
}
folder_path = camel_imap_store_folder_path (imap_store, folder_name);
if (imap_folder_exists (imap_store, folder_path, &selectable, ex)) {
exists = TRUE;
if (!selectable)
@ -1034,13 +1033,10 @@ camel_imap_command_preliminary (CamelImapStore *store, char **cmdid, CamelExcept
return CAMEL_IMAP_FAIL;
/* Check for '+' which indicates server is ready for command continuation */
if (*respbuf == '+') {
g_free (cmdid);
if (*respbuf == '+')
return CAMEL_IMAP_PLUS;
}
status = camel_imap_status (*cmdid, respbuf);
g_free (cmdid);
if (respbuf) {
/* get error response and set exception accordingly */