diff options
author | Not Zed <NotZed@Ximian.com> | 2004-05-26 12:24:01 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-05-26 12:24:01 +0800 |
commit | 1c11041eebd485a471e842ba4f75834c2ce6e1f7 (patch) | |
tree | c708d5ff8c87af387e5ad790f15616053068e9f4 /camel/providers | |
parent | ca6276f9e5e5813b6954e2869667458c3b1d9f10 (diff) | |
download | gsoc2013-evolution-1c11041eebd485a471e842ba4f75834c2ce6e1f7.tar gsoc2013-evolution-1c11041eebd485a471e842ba4f75834c2ce6e1f7.tar.gz gsoc2013-evolution-1c11041eebd485a471e842ba4f75834c2ce6e1f7.tar.bz2 gsoc2013-evolution-1c11041eebd485a471e842ba4f75834c2ce6e1f7.tar.lz gsoc2013-evolution-1c11041eebd485a471e842ba4f75834c2ce6e1f7.tar.xz gsoc2013-evolution-1c11041eebd485a471e842ba4f75834c2ce6e1f7.tar.zst gsoc2013-evolution-1c11041eebd485a471e842ba4f75834c2ce6e1f7.zip |
removed.
2004-05-25 Not Zed <NotZed@Ximian.com>
* camel-store.c (camel_folder_info_build_path): removed.
* camel-store.h (CamelFolderInfo): removed 'path', fixed all
callers.
(struct _CamelStore): removed 'dir_sep' fixed all uses.
svn path=/trunk/; revision=26089
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 40 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-store.c | 1 | ||||
-rw-r--r-- | camel/providers/local/camel-local-folder.c | 1 | ||||
-rw-r--r-- | camel/providers/local/camel-local-store.c | 1 | ||||
-rw-r--r-- | camel/providers/local/camel-maildir-store.c | 1 | ||||
-rw-r--r-- | camel/providers/local/camel-mbox-store.c | 3 | ||||
-rw-r--r-- | camel/providers/local/camel-mh-store.c | 1 | ||||
-rw-r--r-- | camel/providers/local/camel-spool-store.c | 4 | ||||
-rw-r--r-- | camel/providers/nntp/camel-nntp-store.c | 23 |
9 files changed, 27 insertions, 48 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index ccba426398..9401c559fb 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -296,7 +296,6 @@ construct (CamelService *service, CamelSession *session, } else { imap_store->namespace = g_strdup(is->namespace->full_name); imap_store->dir_sep = is->namespace->sep; - store->dir_sep = is->namespace->sep; } } @@ -1011,13 +1010,11 @@ imap_build_folder_info(CamelImapStore *imap_store, const char *folder_name) url->path = g_strdup_printf ("/%s", folder_name); fi->uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); camel_url_free(url); - fi->path = g_strdup_printf("/%s", folder_name); - name = strrchr (fi->path, '/'); - if (name) - name++; + name = strrchr (fi->full_name, '/'); + if (name == NULL) + name = fi->full_name; else - name = fi->path; - + name++; fi->name = g_strdup (name); return fi; @@ -1414,7 +1411,6 @@ imap_connect_online (CamelService *service, CamelException *ex) sep = imap_parse_string ((const char **) &name, &len); if (sep) { store->dir_sep = *sep; - ((CamelStore *)store)->dir_sep = store->dir_sep; g_free (sep); } } @@ -1452,7 +1448,6 @@ imap_connect_online (CamelService *service, CamelException *ex) } if (!store->dir_sep) { store->dir_sep = '/'; /* Guess */ - ((CamelStore *)store)->dir_sep = store->dir_sep; } } @@ -1875,7 +1870,7 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca if ((parent_name = strrchr (folder_name, '/'))) { parent_name = g_strndup (folder_name, parent_name - folder_name); - parent_real = camel_imap_store_summary_path_to_full (imap_store->summary, parent_name, store->dir_sep); + parent_real = camel_imap_store_summary_path_to_full (imap_store->summary, parent_name, imap_store->dir_sep); } else { parent_real = NULL; } @@ -1983,11 +1978,11 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca g_free (parent_name); - folder_real = camel_imap_store_summary_path_to_full(imap_store->summary, folder_name, store->dir_sep); + folder_real = camel_imap_store_summary_path_to_full(imap_store->summary, folder_name, imap_store->dir_sep); response = camel_imap_command (imap_store, NULL, ex, "CREATE %S", folder_real); if (response) { - camel_imap_store_summary_add_from_full(imap_store->summary, folder_real, store->dir_sep); + camel_imap_store_summary_add_from_full(imap_store->summary, folder_real, imap_store->dir_sep); camel_imap_response_free (imap_store, response); @@ -2204,7 +2199,7 @@ rename_folder (CamelStore *store, const char *old_name, const char *new_name_in, if (store->flags & CAMEL_STORE_SUBSCRIPTIONS) manage_subscriptions(store, old_name, FALSE); - new_name = camel_imap_store_summary_path_to_full(imap_store->summary, new_name_in, store->dir_sep); + new_name = camel_imap_store_summary_path_to_full(imap_store->summary, new_name_in, imap_store->dir_sep); response = camel_imap_command (imap_store, NULL, ex, "RENAME %F %S", old_name, new_name); if (!response) { @@ -2354,7 +2349,7 @@ create_folder (CamelStore *store, const char *parent_name, } /* ok now we can create the folder */ - real_name = camel_imap_store_summary_path_to_full(imap_store->summary, folder_name, store->dir_sep); + real_name = camel_imap_store_summary_path_to_full(imap_store->summary, folder_name, imap_store->dir_sep); full_name = imap_concat (imap_store, parent_real, real_name); g_free(real_name); response = camel_imap_command (imap_store, NULL, ex, "CREATE %S", full_name); @@ -2365,7 +2360,7 @@ create_folder (CamelStore *store, const char *parent_name, camel_imap_response_free (imap_store, response); - si = camel_imap_store_summary_add_from_full(imap_store->summary, full_name, store->dir_sep); + si = camel_imap_store_summary_add_from_full(imap_store->summary, full_name, imap_store->dir_sep); camel_store_summary_save((CamelStoreSummary *)imap_store->summary); fi = imap_build_folder_info(imap_store, camel_store_info_path(imap_store->summary, si)); fi->flags |= CAMEL_FOLDER_NOCHILDREN; @@ -2395,7 +2390,7 @@ parse_list_response_as_folder_info (CamelImapStore *imap_store, { CamelFolderInfo *fi; int flags; - char sep, *dir; + char sep, *dir, *path; CamelURL *url; CamelImapStoreInfo *si; guint32 newflags; @@ -2417,8 +2412,7 @@ parse_list_response_as_folder_info (CamelImapStore *imap_store, fi = g_new0 (CamelFolderInfo, 1); fi->name = g_strdup(camel_store_info_name(imap_store->summary, si)); - fi->path = g_strdup_printf("/%s", camel_store_info_path(imap_store->summary, si)); - fi->full_name = g_strdup(fi->path+1); + fi->full_name = g_strdup(camel_store_info_path(imap_store->summary, si)); if (!g_ascii_strcasecmp(fi->full_name, "inbox")) flags |= CAMEL_FOLDER_SYSTEM; /* HACK: some servers report noinferiors for all folders (uw-imapd) @@ -2429,7 +2423,9 @@ parse_list_response_as_folder_info (CamelImapStore *imap_store, fi->flags = flags; url = camel_url_new (imap_store->base_url, NULL); - camel_url_set_path(url, fi->path); + path = alloca(strlen(fi->full_name)+2); + sprintf(path, "/%s", fi->full_name); + camel_url_set_path(url, path); if (flags & CAMEL_FOLDER_NOSELECT || fi->name[0] == 0) camel_url_set_param (url, "noselect", "yes"); @@ -2563,7 +2559,7 @@ get_folders_online (CamelImapStore *imap_store, const char *pattern, if (si == NULL) continue; - if (imap_match_pattern(((CamelStore *)imap_store)->dir_sep, pattern, camel_imap_store_info_full_name(imap_store->summary, si))) { + if (imap_match_pattern(imap_store->dir_sep, pattern, camel_imap_store_info_full_name(imap_store->summary, si))) { if (g_hash_table_lookup(present, camel_store_info_path(imap_store->summary, si)) != NULL) { if (lsub && (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) == 0) { si->flags |= CAMEL_STORE_INFO_FOLDER_SUBSCRIBED; @@ -2831,14 +2827,14 @@ get_folders(CamelStore *store, const char *top, guint32 flags, CamelException *e i = strlen(top)-1; name = g_malloc(i+2); strcpy(name, top); - while (i>0 && name[i] == store->dir_sep) + while (i>0 && name[i] == imap_store->dir_sep) name[i--] = 0; } else name = g_strdup(""); } else { name = camel_imap_store_summary_full_from_path(imap_store->summary, top); if (name == NULL) - name = camel_imap_store_summary_path_to_full(imap_store->summary, top, store->dir_sep); + name = camel_imap_store_summary_path_to_full(imap_store->summary, top, imap_store->dir_sep); } d(printf("\n\nList '%s' %s\n", name, flags&CAMEL_STORE_FOLDER_INFO_RECURSIVE?"RECURSIVE":"NON-RECURSIVE")); diff --git a/camel/providers/imapp/camel-imapp-store.c b/camel/providers/imapp/camel-imapp-store.c index 6ae79cae2e..290d3c0a17 100644 --- a/camel/providers/imapp/camel-imapp-store.c +++ b/camel/providers/imapp/camel-imapp-store.c @@ -543,7 +543,6 @@ folders_build_info(CamelURL *base, struct _list_info *li) fi->uri = camel_url_to_string(base, CAMEL_URL_HIDE_ALL); fi->name = g_strdup(name); fi->full_name = full_name; - fi->path = g_strdup(path); fi->unread = -1; fi->total = -1; fi->flags = li->flags; diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c index 2c352c749d..2f5cc53223 100644 --- a/camel/providers/local/camel-local-folder.c +++ b/camel/providers/local/camel-local-folder.c @@ -319,7 +319,6 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con fi->name = g_strdup (name); fi->uri = camel_url_to_string (url, 0); fi->unread = camel_folder_get_unread_message_count(folder); - camel_folder_info_build_path(fi, '/'); fi->flags = CAMEL_FOLDER_NOCHILDREN; camel_url_free (url); diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c index 2a154d1556..f39f597f08 100644 --- a/camel/providers/local/camel-local-store.c +++ b/camel/providers/local/camel-local-store.c @@ -469,7 +469,6 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex) fi->uri = g_strdup_printf ("%s:%s#%s", ((CamelService *) store)->url->protocol, CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name); fi->unread = -1; - camel_folder_info_build_path(fi, '/'); camel_object_trigger_event (store, "folder_deleted", fi); diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c index 33daf0521e..5a81965ede 100644 --- a/camel/providers/local/camel-maildir-store.c +++ b/camel/providers/local/camel-maildir-store.c @@ -232,7 +232,6 @@ static CamelFolderInfo *camel_folder_info_new(const char *url, const char *full, fi->name = g_strdup(name); fi->unread = -1; fi->total = -1; - camel_folder_info_build_path(fi, '/'); if (!strcmp(full, ".")) fi->flags |= CAMEL_FOLDER_SYSTEM; diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c index 4893853689..a2bafd4ab0 100644 --- a/camel/providers/local/camel-mbox-store.c +++ b/camel/providers/local/camel-mbox-store.c @@ -333,7 +333,6 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex) fi->name = g_path_get_basename(folder_name); fi->uri = g_strdup_printf("mbox:%s#%s",((CamelService *) store)->url->path, folder_name); fi->unread = -1; - camel_folder_info_build_path(fi, '/'); camel_object_trigger_event(store, "folder_deleted", fi); @@ -705,7 +704,6 @@ scan_dir(CamelStore *store, CamelURL *url, GHashTable *visited, CamelFolderInfo fi->uri = camel_url_to_string (url, 0); fi->name = short_name; fi->full_name = full_name; - fi->path = g_strdup_printf("/%s", full_name); fi->unread = -1; fi->total = -1; @@ -815,7 +813,6 @@ get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExceptio fi->full_name = g_strdup(top); fi->unread = -1; fi->total = -1; - fi->path = g_strdup_printf("/%s", top); subdir = g_strdup_printf("%s.sbd", path); if (stat(subdir, &st) == 0) { diff --git a/camel/providers/local/camel-mh-store.c b/camel/providers/local/camel-mh-store.c index 7e57b69766..ee35d8ec25 100644 --- a/camel/providers/local/camel-mh-store.c +++ b/camel/providers/local/camel-mh-store.c @@ -350,7 +350,6 @@ folder_info_new (CamelStore *store, CamelURL *url, const char *root, const char fi->uri = camel_url_to_string (url, 0); fi->full_name = g_strdup(path); fi->name = g_strdup(base?base+1:path); - camel_folder_info_build_path(fi, '/'); fill_fi(store, fi, flags); d(printf("New folderinfo:\n '%s'\n '%s'\n '%s'\n", fi->full_name, fi->uri, fi->path)); diff --git a/camel/providers/local/camel-spool-store.c b/camel/providers/local/camel-spool-store.c index 1aa18965ae..96278bf538 100644 --- a/camel/providers/local/camel-spool-store.c +++ b/camel/providers/local/camel-spool-store.c @@ -231,7 +231,6 @@ static void free_folder_info (CamelStore *store, CamelFolderInfo *fi) g_free(fi->uri); g_free(fi->name); g_free(fi->full_name); - g_free(fi->path); g_free(fi); } } @@ -246,7 +245,6 @@ camel_folder_info_new(const char *url, const char *full, const char *name, int u fi->full_name = g_strdup(full); fi->name = g_strdup(name); fi->unread = unread; - camel_folder_info_build_path(fi, '/'); d(printf("Adding spoold info: '%s' '%s' '%s' '%s'\n", fi->path, fi->name, fi->full_name, fi->url)); @@ -466,8 +464,6 @@ get_folder_info_mbox(CamelStore *store, const char *top, guint32 flags, CamelExc camel_object_unref(folder); } else fi->unread = -1; - - camel_folder_info_build_path(fi, '/'); } return fi; diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index d43fc13ca9..26e825436b 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -390,6 +390,7 @@ nntp_folder_info_from_store_info (CamelNNTPStore *store, gboolean short_notation CamelURL *base_url = ((CamelService *) store)->url; CamelFolderInfo *fi = g_malloc0(sizeof(*fi)); CamelURL *url; + char *path; fi->full_name = g_strdup (si->path); @@ -399,16 +400,9 @@ nntp_folder_info_from_store_info (CamelNNTPStore *store, gboolean short_notation fi->name = g_strdup (si->path); fi->unread = -1; - /* fi->path is the 'canonicalised' path used by the UI (folder-tree). Not - * as important these days, but folders used to get added to the tree based - * on its path rather than the structure of the CamelFolderInfo's. - * - * must be delimited by '/' which also means that if the user doesn't want - * a flat list of newsgroups, you'll have to replace '.' with '/' for - * full_name too. */ - /*camel_folder_info_build_path(fi, '/');*/ - fi->path = g_strdup_printf ("/%s", si->path); - url = camel_url_new_with_base (base_url, fi->path); + path = alloca(strlen(fi->full_name)+2); + sprintf(path, "/%s", fi->full_name); + url = camel_url_new_with_base (base_url, path); fi->uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); camel_url_free (url); @@ -421,7 +415,8 @@ nntp_folder_info_from_name (CamelNNTPStore *store, gboolean short_notation, cons CamelFolderInfo *fi = g_malloc0(sizeof(*fi)); CamelURL *base_url = ((CamelService *)store)->url; CamelURL *url; - + char *path; + fi->full_name = g_strdup (name); if (short_notation) @@ -431,9 +426,9 @@ nntp_folder_info_from_name (CamelNNTPStore *store, gboolean short_notation, cons fi->unread = -1; - fi->path = g_strdup_printf ("/%s", name); - - url = camel_url_new_with_base (base_url, fi->path); + path = alloca(strlen(fi->full_name)+2); + sprintf(path, "/%s", fi->full_name); + url = camel_url_new_with_base (base_url, path); fi->uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); camel_url_free (url); |