diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-30 07:17:52 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-06-01 03:40:51 +0800 |
commit | 96822fce5e55775dc800bb6ccc8be64e70f96cfd (patch) | |
tree | e8bc0fc5ca7973b872df5efd12658b9d7c235acd | |
parent | 95ec5734c1c5fb0a513e716b6aad8ad5419c2ca2 (diff) | |
download | gsoc2013-evolution-96822fce5e55775dc800bb6ccc8be64e70f96cfd.tar gsoc2013-evolution-96822fce5e55775dc800bb6ccc8be64e70f96cfd.tar.gz gsoc2013-evolution-96822fce5e55775dc800bb6ccc8be64e70f96cfd.tar.bz2 gsoc2013-evolution-96822fce5e55775dc800bb6ccc8be64e70f96cfd.tar.lz gsoc2013-evolution-96822fce5e55775dc800bb6ccc8be64e70f96cfd.tar.xz gsoc2013-evolution-96822fce5e55775dc800bb6ccc8be64e70f96cfd.tar.zst gsoc2013-evolution-96822fce5e55775dc800bb6ccc8be64e70f96cfd.zip |
Fix more places where old-style folder URIs are used.
-rw-r--r-- | mail/e-mail-migrate.c | 15 | ||||
-rw-r--r-- | mail/em-folder-tree.c | 23 | ||||
-rw-r--r-- | mail/mail-folder-cache.c | 32 |
3 files changed, 20 insertions, 50 deletions
diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c index 2b4f6207fd..d0b58e7b54 100644 --- a/mail/e-mail-migrate.c +++ b/mail/e-mail-migrate.c @@ -62,8 +62,9 @@ #include "shell/e-shell.h" #include "shell/e-shell-migrate.h" -#include "e-mail-store.h" #include "e-mail-backend.h" +#include "e-mail-folder-utils.h" +#include "e-mail-store.h" #include "em-utils.h" #define d(x) x @@ -1009,6 +1010,7 @@ create_mbox_account (EShellBackend *shell_backend, { EMailBackend *mail_backend; EMailSession *mail_session; + CamelStore *store; CamelURL *url; EAccountList *accounts; EAccount *account; @@ -1053,20 +1055,19 @@ create_mbox_account (EShellBackend *shell_backend, goto exit; } - camel_url_set_fragment (url, "Sent"); - folder_uri = camel_url_to_string (url, 0); + e_account_list_add (accounts, account); + store = e_mail_store_add_by_account (mail_session, account); + + folder_uri = e_mail_folder_uri_build (store, "Sent"); e_account_set_string ( account, E_ACCOUNT_SENT_FOLDER_URI, folder_uri); g_free (folder_uri); - camel_url_set_fragment (url, "Drafts"); - folder_uri = camel_url_to_string (url, 0); + folder_uri = e_mail_folder_uri_build (store, "Drafts"); e_account_set_string ( account, E_ACCOUNT_DRAFTS_FOLDER_URI, folder_uri); g_free (folder_uri); - e_account_list_add (accounts, account); - e_mail_store_add_by_account (mail_session, account); e_account_list_save (accounts); exit: diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 04e544e47b..bf5958a5c3 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -2040,27 +2040,24 @@ folder_tree_drop_folder (struct _DragDataReceivedAsync *m) static gchar * folder_tree_drop_async__desc (struct _DragDataReceivedAsync *m) { - CamelURL *url; const guchar *data; - gchar *buf; data = gtk_selection_data_get_data (m->selection); if (m->info == DND_DROP_TYPE_FOLDER) { - url = camel_url_new ((gchar *) data, NULL); + gchar *folder_name = NULL; + + e_mail_folder_uri_parse ( + CAMEL_SESSION (m->session), + (gchar *) data, NULL, &folder_name, NULL); + g_return_val_if_fail (folder_name != NULL, NULL); if (m->move) - buf = g_strdup_printf ( - _("Moving folder %s"), url->fragment ? - url->fragment : url->path + 1); + return g_strdup_printf ( + _("Moving folder %s"), folder_name); else - buf = g_strdup_printf ( - _("Copying folder %s"), url->fragment ? - url->fragment : url->path + 1); - - camel_url_free (url); - - return buf; + return g_strdup_printf ( + _("Copying folder %s"), folder_name); } else { if (m->move) return g_strdup_printf ( diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 39dce1f0bb..8b951ce380 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -546,34 +546,6 @@ store_folder_deleted_cb (CamelStore *store, store_folder_unsubscribed_cb (store, info, self); } -static gchar * -folder_to_url (CamelStore *store, - const gchar *full_name) -{ - CamelProvider *provider; - CamelService *service; - CamelURL *url; - gchar *out; - - service = CAMEL_SERVICE (store); - provider = camel_service_get_provider (service); - - url = camel_url_copy (camel_service_get_camel_url (service)); - if (provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH) { - camel_url_set_fragment (url, full_name); - } else { - gchar *name = g_alloca (strlen (full_name)+2); - - sprintf(name, "/%s", full_name); - camel_url_set_path (url, name); - } - - out = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); - camel_url_free (url); - - return out; -} - static void rename_folders (MailFolderCache *self, struct _store_info *si, @@ -633,9 +605,9 @@ rename_folders (MailFolderCache *self, /* rename the meta-data we maintain ourselves */ config_dir = mail_session_get_config_dir (); - olduri = folder_to_url (si->store, old); + olduri = e_mail_folder_uri_build (si->store, old); e_filename_make_safe (olduri); - newuri = folder_to_url (si->store, fi->full_name); + newuri = e_mail_folder_uri_build (si->store, fi->full_name); e_filename_make_safe (newuri); oldfile = g_strdup_printf("%s/custom_view-%s.xml", config_dir, olduri); newfile = g_strdup_printf("%s/custom_view-%s.xml", config_dir, newuri); |