[evolution-data-server] CamelIMAPXNamespaceList: Remove 'full_name' member.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] CamelIMAPXNamespaceList: Remove 'full_name' member.
- Date: Tue, 20 Aug 2013 19:08:31 +0000 (UTC)
commit e8b1457bcdde3fff0301ec2e407aaf347ca26275
Author: Matthew Barnes <mbarnes redhat com>
Date: Tue Aug 20 11:40:26 2013 -0400
CamelIMAPXNamespaceList: Remove 'full_name' member.
The 'full_name' member is always identical to 'prefix', so not needed.
camel/camel-imapx-server.c | 1 -
camel/camel-imapx-store-summary.c | 25 ++++++++++++++-----------
camel/camel-imapx-store-summary.h | 1 -
camel/camel-imapx-store.c | 2 +-
camel/camel-imapx-utils.c | 4 ----
5 files changed, 15 insertions(+), 18 deletions(-)
---
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index e7429c4..0ad5520 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -4276,7 +4276,6 @@ preauthed:
ns = g_new0 (CamelIMAPXStoreNamespace, 1);
ns->next = NULL;
ns->prefix = g_strdup ("");
- ns->full_name = g_strdup ("");
ns->sep = '/';
nsl->personal = ns;
diff --git a/camel/camel-imapx-store-summary.c b/camel/camel-imapx-store-summary.c
index 291b5cf..1cd9346 100644
--- a/camel/camel-imapx-store-summary.c
+++ b/camel/camel-imapx-store-summary.c
@@ -235,7 +235,7 @@ camel_imapx_store_summary_path_to_full (CamelIMAPXStoreSummary *s,
camel_store_summary_info_unref ((CamelStoreSummary *) s, si);
f = full;
} else if (ns) {
- full = g_strdup_printf ("%s%s", ns->full_name, f);
+ full = g_strdup_printf ("%s%s", ns->prefix, f);
g_free (f);
f = full;
}
@@ -272,7 +272,7 @@ camel_imapx_store_summary_add_from_full (CamelIMAPXStoreSummary *s,
ns = camel_imapx_store_summary_namespace_find_full (s, full_name);
if (ns) {
d ("(found namespace for '%s' ns '%s') ", full_name, ns->prefix);
- len = strlen (ns->full_name);
+ len = strlen (ns->prefix);
if (len >= strlen (full_name)) {
pathu8 = g_strdup (ns->prefix);
} else {
@@ -361,11 +361,11 @@ camel_imapx_store_summary_namespace_find_full (CamelIMAPXStoreSummary *s,
/* CHEN TODO */
ns = s->namespaces->personal;
while (ns) {
- if (ns->full_name)
- len = strlen (ns->full_name);
- d ("find_full: comparing namespace '%s' to name '%s'\n", ns->full_name, full);
+ if (ns->prefix)
+ len = strlen (ns->prefix);
+ d ("find_full: comparing namespace '%s' to name '%s'\n", ns->prefix, full);
if (len == 0
- || (strncmp (ns->full_name, full, len) == 0
+ || (strncmp (ns->prefix, full, len) == 0
&& (full[len] == ns->sep || full[len] == 0)))
break;
ns = NULL;
@@ -408,26 +408,28 @@ namespace_load (CamelStoreSummary *s,
for (i = 0; i < n; i++) {
guint32 sep;
gchar *prefix;
- gchar *full_name;
+ gchar *unused;
if (camel_file_util_decode_string (in, &prefix) == -1)
goto exception;
- if (camel_file_util_decode_string (in, &full_name) == -1) {
+ /* XXX This string is just a duplicate of 'prefix',
+ * retained only for backward-compatibility. */
+ if (camel_file_util_decode_string (in, &unused) == -1) {
g_free (prefix);
goto exception;
}
+ g_free (unused);
+
if (camel_file_util_decode_uint32 (in, &sep) == -1) {
g_free (prefix);
- g_free (full_name);
goto exception;
}
tail->next = ns = g_malloc (sizeof (CamelIMAPXStoreNamespace));
ns->sep = sep;
ns->prefix = prefix;
- ns->full_name = full_name;
ns->next = NULL;
tail = ns;
}
@@ -472,7 +474,8 @@ namespace_save (CamelStoreSummary *s,
if (camel_file_util_encode_string (out, ns->prefix) == -1)
return -1;
- if (camel_file_util_encode_string (out, ns->full_name) == -1)
+ /* XXX This redundancy is for backward-compatibility. */
+ if (camel_file_util_encode_string (out, ns->prefix) == -1)
return -1;
if (camel_file_util_encode_uint32 (out, ns->sep) == -1)
diff --git a/camel/camel-imapx-store-summary.h b/camel/camel-imapx-store-summary.h
index 7709585..1bc663a 100644
--- a/camel/camel-imapx-store-summary.h
+++ b/camel/camel-imapx-store-summary.h
@@ -69,7 +69,6 @@ typedef struct _CamelIMAPXStoreNamespace CamelIMAPXStoreNamespace;
struct _CamelIMAPXStoreNamespace {
CamelIMAPXStoreNamespace *next;
gchar *prefix; /* mailbox prefix, no trailing separator */
- gchar *full_name; /* real name */
gchar sep; /* mailbox separator */
};
diff --git a/camel/camel-imapx-store.c b/camel/camel-imapx-store.c
index e2a3b38..120d708 100644
--- a/camel/camel-imapx-store.c
+++ b/camel/camel-imapx-store.c
@@ -993,7 +993,7 @@ get_folder_info_offline (CamelStore *store,
}
if (namespace != NULL) {
- name = g_strdup (imapx_store->summary->namespaces->personal->full_name);
+ name = g_strdup (imapx_store->summary->namespaces->personal->prefix);
top = imapx_store->summary->namespaces->personal->prefix;
} else
name = g_strdup ("");
diff --git a/camel/camel-imapx-utils.c b/camel/camel-imapx-utils.c
index 2fce8c3..6fe7b9e 100644
--- a/camel/camel-imapx-utils.c
+++ b/camel/camel-imapx-utils.c
@@ -671,9 +671,6 @@ imapx_parse_namespace_list (CamelIMAPXStream *stream,
(node->prefix[6] == '\0' || node->prefix[6] == node->sep ))
memcpy (node->prefix, "INBOX", 5);
- /* TODO remove full_name later. not required */
- node->full_name = g_strdup (node->prefix);
-
tok = camel_imapx_stream_token (stream, &token, &len, cancellable, NULL);
if (tok != ')') {
g_set_error (error, CAMEL_IMAPX_ERROR, 1, "namespace: expected a
')'");
@@ -2909,7 +2906,6 @@ imapx_namespace_clear (CamelIMAPXStoreNamespace **ns)
node = *ns;
while (node != NULL) {
next = node->next;
- g_free (node->full_name);
g_free (node->prefix);
g_free (node);
node = next;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]