aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/MH/camel-mh-folder.c21
-rw-r--r--camel/providers/MH/camel-mh-folder.h2
-rw-r--r--camel/providers/MH/camel-mh-store.c8
-rw-r--r--camel/providers/MH/camel-mh-store.h9
4 files changed, 19 insertions, 21 deletions
diff --git a/camel/providers/MH/camel-mh-folder.c b/camel/providers/MH/camel-mh-folder.c
index e4fe3c5bd2..2db3a74e8e 100644
--- a/camel/providers/MH/camel-mh-folder.c
+++ b/camel/providers/MH/camel-mh-folder.c
@@ -33,7 +33,7 @@ static CamelFolderClass *parent_class=NULL;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (GTK_OBJECT(so)->klass)
#define CMHS_CLASS(so) CAMEL_STORE_CLASS (GTK_OBJECT(so)->klass)
-static void camel_mh_folder_set_name(CamelFolder *folder, GString *name);
+static void _set_name(CamelFolder *folder, const gchar *name);
static void
@@ -43,7 +43,7 @@ camel_mh_folder_class_init (CamelMhFolderClass *camel_mh_folder_class)
/* virtual method definition */
/* virtual method overload */
- CAMEL_FOLDER_CLASS(camel_mh_folder_class)->set_name = camel_mh_folder_set_name;
+ CAMEL_FOLDER_CLASS(camel_mh_folder_class)->set_name = _set_name;
}
@@ -86,10 +86,11 @@ camel_mh_folder_get_type (void)
*
**/
static void
-camel_mh_folder_set_name(CamelFolder *folder, GString *name)
+_set_name (CamelFolder *folder, const gchar *name)
{
- GString *root_dir_path;
- GString *full_dir_path;
+ const gchar *root_dir_path;
+ gchar *full_name;
+ const gchar *parent_full_name;
CamelMhFolder *mh_folder = CAMEL_MH_FOLDER(folder);
gchar separator;
@@ -100,16 +101,12 @@ camel_mh_folder_set_name(CamelFolder *folder, GString *name)
/* call default implementation */
parent_class->set_name (folder, name);
- if (mh_folder->directory_path) g_string_free (mh_folder->directory_path, 0);
+ if (mh_folder->directory_path) g_free (mh_folder->directory_path);
separator = camel_store_get_separator (folder->parent_store);
-
-
root_dir_path = camel_mh_store_get_toplevel_dir (CAMEL_MH_STORE(folder->parent_store));
- full_dir_path = g_string_clone(root_dir_path);
- g_string_append_c(full_dir_path, separator);
- g_string_append_g_string(full_dir_path, name);
- mh_folder->directory_path = full_dir_path;
+ mh_folder->directory_path = g_strdup_printf ("%s%c%s", root_dir_path, separator, folder->full_name);
}
+
diff --git a/camel/providers/MH/camel-mh-folder.h b/camel/providers/MH/camel-mh-folder.h
index 2e9fbb47f0..332698bdba 100644
--- a/camel/providers/MH/camel-mh-folder.h
+++ b/camel/providers/MH/camel-mh-folder.h
@@ -44,7 +44,7 @@ extern "C" {
typedef struct {
CamelFolder parent_object;
- GString *directory_path;
+ gchar *directory_path;
} CamelMhFolder;
diff --git a/camel/providers/MH/camel-mh-store.c b/camel/providers/MH/camel-mh-store.c
index 2a1258a7b9..efdb2b86e9 100644
--- a/camel/providers/MH/camel-mh-store.c
+++ b/camel/providers/MH/camel-mh-store.c
@@ -75,15 +75,15 @@ camel_mh_store_get_type (void)
/** These evil public functions are here for test only **/
void
-camel_mh_store_set_toplevel_dir(CamelMhStore *store, GString *toplevel)
+camel_mh_store_set_toplevel_dir (CamelMhStore *store, const gchar *toplevel)
{
- store->toplevel_dir = toplevel;
+ store->toplevel_dir = g_strdup (toplevel);
CAMEL_STORE(store)->separator = '/';
}
-GString *
-camel_mh_store_get_toplevel_dir(CamelMhStore *store)
+const gchar *
+camel_mh_store_get_toplevel_dir (CamelMhStore *store)
{
return store->toplevel_dir;
}
diff --git a/camel/providers/MH/camel-mh-store.h b/camel/providers/MH/camel-mh-store.h
index 058eb48c64..8aa4a9bca2 100644
--- a/camel/providers/MH/camel-mh-store.h
+++ b/camel/providers/MH/camel-mh-store.h
@@ -43,8 +43,7 @@ extern "C" {
typedef struct {
CamelStore parent_object;
- GString *toplevel_dir;
-
+ gchar *toplevel_dir;
} CamelMhStore;
@@ -61,11 +60,13 @@ typedef struct {
/* Standard Gtk function */
GtkType camel_mh_store_get_type (void);
-void camel_mh_store_set_toplevel_dir(CamelMhStore *store, GString *toplevel);
-GString *camel_mh_store_get_toplevel_dir(CamelMhStore *store);
+void camel_mh_store_set_toplevel_dir (CamelMhStore *store, const gchar *toplevel);
+const gchar *camel_mh_store_get_toplevel_dir (CamelMhStore *store);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CAMEL_MH_STORE_H */
+
+