[evolution-data-server] CamelIMAPXStoreSummary: Don't bother with store_info_set_string().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] CamelIMAPXStoreSummary: Don't bother with store_info_set_string().
- Date: Sat, 24 Aug 2013 17:05:10 +0000 (UTC)
commit c84b70b5226798329fbb92170afbb4e1e5369d0b
Author: Matthew Barnes <mbarnes redhat com>
Date: Sat Aug 24 11:35:20 2013 -0400
CamelIMAPXStoreSummary: Don't bother with store_info_set_string().
Just set the CamelIMAPXStoreInfo member directly.
camel/camel-imapx-store-summary.c | 29 +----------------------------
camel/camel-imapx-store-summary.h | 5 -----
camel/camel-imapx-store.c | 8 ++++----
3 files changed, 5 insertions(+), 37 deletions(-)
---
diff --git a/camel/camel-imapx-store-summary.c b/camel/camel-imapx-store-summary.c
index af882d4..fdc3b9b 100644
--- a/camel/camel-imapx-store-summary.c
+++ b/camel/camel-imapx-store-summary.c
@@ -314,32 +314,6 @@ imapx_store_summary_store_info_free (CamelStoreSummary *s,
}
static void
-imapx_store_summary_store_info_set_string (CamelStoreSummary *s,
- CamelStoreInfo *si,
- gint type,
- const gchar *str)
-{
- CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *) si;
- CamelStoreSummaryClass *store_summary_class;
-
- store_summary_class =
- CAMEL_STORE_SUMMARY_CLASS (
- camel_imapx_store_summary_parent_class);
-
- switch (type) {
- case CAMEL_IMAPX_STORE_INFO_MAILBOX:
- d ("Set full name %s -> %s\n", isi->mailbox_name, str);
- g_free (isi->mailbox_name);
- isi->mailbox_name = g_strdup (str);
- break;
- default:
- /* Chain up to parent's store_info_set_string() method. */
- store_summary_class->store_info_set_string (s, si, type, str);
- break;
- }
-}
-
-static void
camel_imapx_store_summary_class_init (CamelIMAPXStoreSummaryClass *class)
{
GObjectClass *object_class;
@@ -354,7 +328,6 @@ camel_imapx_store_summary_class_init (CamelIMAPXStoreSummaryClass *class)
store_summary_class->store_info_load = imapx_store_summary_store_info_load;
store_summary_class->store_info_save = imapx_store_summary_store_info_save;
store_summary_class->store_info_free = imapx_store_summary_store_info_free;
- store_summary_class->store_info_set_string = imapx_store_summary_store_info_set_string;
}
static void
@@ -584,7 +557,7 @@ camel_imapx_store_summary_add_from_mailbox (CamelIMAPXStoreSummary *s,
info = (CamelIMAPXStoreInfo *) camel_store_summary_add_from_path ((CamelStoreSummary *) s, pathu8);
if (info) {
d (" '%s' -> '%s'\n", pathu8, mailbox_copy);
- camel_store_info_set_string ((CamelStoreSummary *) s, (CamelStoreInfo *) info,
CAMEL_IMAPX_STORE_INFO_MAILBOX, mailbox_copy);
+ info->mailbox_name = g_strdup (mailbox_copy);
if (camel_imapx_mailbox_is_inbox (mailbox_copy))
info->info.flags |=
diff --git a/camel/camel-imapx-store-summary.h b/camel/camel-imapx-store-summary.h
index 635715d..1389fbb 100644
--- a/camel/camel-imapx-store-summary.h
+++ b/camel/camel-imapx-store-summary.h
@@ -54,11 +54,6 @@ typedef struct _CamelIMAPXStoreSummaryClass CamelIMAPXStoreSummaryClass;
typedef struct _CamelIMAPXStoreInfo CamelIMAPXStoreInfo;
-enum {
- CAMEL_IMAPX_STORE_INFO_MAILBOX = CAMEL_STORE_INFO_LAST,
- CAMEL_IMAPX_STORE_INFO_LAST
-};
-
struct _CamelIMAPXStoreInfo {
CamelStoreInfo info;
gchar *mailbox_name;
diff --git a/camel/camel-imapx-store.c b/camel/camel-imapx-store.c
index 7d0e6c2..bce7033 100644
--- a/camel/camel-imapx-store.c
+++ b/camel/camel-imapx-store.c
@@ -895,13 +895,13 @@ rename_folder_info (CamelIMAPXStore *imapx_store,
camel_store_info_set_string (
store_summary, si,
CAMEL_STORE_INFO_PATH, new_path);
- camel_store_info_set_string (
- store_summary, si,
- CAMEL_IMAPX_STORE_INFO_MAILBOX, new_mailbox);
+
+ /* Takes ownership of new_mailbox. */
+ g_free (((CamelIMAPXStoreInfo *) si)->mailbox_name);
+ ((CamelIMAPXStoreInfo *) si)->mailbox_name = new_mailbox;
camel_store_summary_touch (store_summary);
- g_free (new_mailbox);
g_free (new_path);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]