aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-06-14 13:10:55 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-06-14 13:10:55 +0800
commite4b07cd9d139a74d974a484b95f176b5f0d7eb8e (patch)
tree2e19a561c291c8038b6dae3b27ee6e9ac3a72a2d /camel/camel-folder.c
parent9f197c605b64fb2ac740df9445897c5d3bb62447 (diff)
downloadgsoc2013-evolution-e4b07cd9d139a74d974a484b95f176b5f0d7eb8e.tar
gsoc2013-evolution-e4b07cd9d139a74d974a484b95f176b5f0d7eb8e.tar.gz
gsoc2013-evolution-e4b07cd9d139a74d974a484b95f176b5f0d7eb8e.tar.bz2
gsoc2013-evolution-e4b07cd9d139a74d974a484b95f176b5f0d7eb8e.tar.lz
gsoc2013-evolution-e4b07cd9d139a74d974a484b95f176b5f0d7eb8e.tar.xz
gsoc2013-evolution-e4b07cd9d139a74d974a484b95f176b5f0d7eb8e.tar.zst
gsoc2013-evolution-e4b07cd9d139a74d974a484b95f176b5f0d7eb8e.zip
Updated: a separator is now a char* rather than a single char because IMAP
2000-06-14 Jeffrey Stedfast <fejj@helixcode.com> * camel-folder.c (init): Updated: a separator is now a char* rather than a single char because IMAP can have a string for a directory separator. Also, since IMAP does not begin with a directory separator, there is a new argument (path_begins_with_sep) which decides if a directory should begin with a directory separator. * providers/imap/camel-imap-store.c (imap_create): Since, on connect, Camel tries to create INBOX (which already exists on every IMAP provider) we can return TRUE when the folder name is "INBOX". * providers/vee/camel-vee-folder.c (vee_init): Updated. * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Updated. * providers/mbox/camel-mbox-store.c (get_folder): Updated. * providers/mbox/camel-mbox-folder.c (mbox_init): Updated. * providers/pop3/camel-pop3-folder.c (camel_pop3_folder_new): Updated. svn path=/trunk/; revision=3559
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r--camel/camel-folder.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index a3e50f163d..d988ba6b4d 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -47,7 +47,9 @@ static guint signals[LAST_SIGNAL] = { 0 };
static void init (CamelFolder *folder, CamelStore *parent_store,
CamelFolder *parent_folder, const gchar *name,
- gchar separator, CamelException *ex);
+ gchar *separator, gboolean path_begins_with_sep,
+ CamelException *ex);
+
static void finalize (GtkObject *object);
@@ -226,7 +228,8 @@ finalize (GtkObject *object)
static void
init (CamelFolder *folder, CamelStore *parent_store,
CamelFolder *parent_folder, const gchar *name,
- gchar separator, CamelException *ex)
+ gchar *separator, gboolean path_begins_with_sep,
+ CamelException *ex)
{
gchar *full_name;
const gchar *parent_full_name;
@@ -246,6 +249,7 @@ init (CamelFolder *folder, CamelStore *parent_store,
folder->open_mode = FOLDER_OPEN_UNKNOWN;
folder->open_state = FOLDER_CLOSE;
folder->separator = separator;
+ folder->path_begins_with_sep = path_begins_with_sep;
/* if the folder already has a name, free it */
g_free (folder->name);
@@ -260,10 +264,13 @@ init (CamelFolder *folder, CamelStore *parent_store,
parent_full_name =
camel_folder_get_full_name (folder->parent_folder);
- full_name = g_strdup_printf ("%s%c%s", parent_full_name,
+ full_name = g_strdup_printf ("%s%s%s", parent_full_name,
folder->separator, name);
} else {
- full_name = g_strdup_printf ("%c%s", folder->separator, name);
+ if (path_begins_with_sep)
+ full_name = g_strdup_printf ("%s%s", folder->separator, name);
+ else
+ full_name = g_strdup (name);
}
folder->name = g_strdup (name);
@@ -275,8 +282,7 @@ static void
folder_open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex)
{
if (folder->open_state == FOLDER_OPEN) {
- camel_exception_set (ex,
- CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
+ camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
"folder is already open");
return;
}
@@ -426,7 +432,7 @@ get_subfolder (CamelFolder *folder, const gchar *folder_name,
current_folder_full_name = camel_folder_get_full_name (folder);
- full_name = g_strdup_printf ("%s%c%s", current_folder_full_name,
+ full_name = g_strdup_printf ("%s%s%s", current_folder_full_name,
folder->separator, folder_name);
new_folder = camel_store_get_folder (folder->parent_store,
full_name, create, ex);
@@ -943,6 +949,5 @@ GList *camel_folder_search_by_expression (CamelFolder *folder,
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
g_return_val_if_fail (folder->has_search_capability, NULL);
- return CF_CLASS (folder)->search_by_expression (folder, expression,
- ex);
+ return CF_CLASS (folder)->search_by_expression (folder, expression, ex);
}