diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-06 06:23:11 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-05-06 06:37:07 +0800 |
commit | b8bb681c179c59e18a0fd361806cfbdaafd7c269 (patch) | |
tree | 9d83ac3baa1d213752c4e0e800784a4b5373b52c /mail/mail-config.c | |
parent | 19fd9e96f2bca8a8fb598367bfab930a43c0c175 (diff) | |
download | gsoc2013-evolution-b8bb681c179c59e18a0fd361806cfbdaafd7c269.tar gsoc2013-evolution-b8bb681c179c59e18a0fd361806cfbdaafd7c269.tar.gz gsoc2013-evolution-b8bb681c179c59e18a0fd361806cfbdaafd7c269.tar.bz2 gsoc2013-evolution-b8bb681c179c59e18a0fd361806cfbdaafd7c269.tar.lz gsoc2013-evolution-b8bb681c179c59e18a0fd361806cfbdaafd7c269.tar.xz gsoc2013-evolution-b8bb681c179c59e18a0fd361806cfbdaafd7c269.tar.zst gsoc2013-evolution-b8bb681c179c59e18a0fd361806cfbdaafd7c269.zip |
MailFolderCache: Emit folder names instead of URIs in signals.
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r-- | mail/mail-config.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c index 3556d0b8de..eb359bd6ec 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -290,7 +290,7 @@ mail_config_get_lookup_book_local_only (void) static void folder_deleted_cb (MailFolderCache *cache, CamelStore *store, - const gchar *uri, + const gchar *folder_name, gpointer user_data) { CamelStoreClass *class; @@ -299,6 +299,7 @@ folder_deleted_cb (MailFolderCache *cache, const gchar *local_drafts_folder_uri; const gchar *local_sent_folder_uri; gboolean write_config = FALSE; + gchar *uri; class = CAMEL_STORE_GET_CLASS (store); @@ -308,6 +309,8 @@ folder_deleted_cb (MailFolderCache *cache, local_sent_folder_uri = e_mail_local_get_folder_uri (E_MAIL_LOCAL_FOLDER_SENT); + uri = e_mail_folder_uri_build (store, folder_name); + account_list = e_get_account_list (); iterator = e_list_get_iterator (E_LIST (account_list)); @@ -337,6 +340,7 @@ folder_deleted_cb (MailFolderCache *cache, } g_object_unref (iterator); + g_free (uri); /* nasty again */ if (write_config) @@ -346,8 +350,8 @@ folder_deleted_cb (MailFolderCache *cache, static void folder_renamed_cb (MailFolderCache *cache, CamelStore *store, - const gchar *old_uri, - const gchar *new_uri, + const gchar *old_folder_name, + const gchar *new_folder_name, gpointer user_data) { CamelStoreClass *class; @@ -355,8 +359,8 @@ folder_renamed_cb (MailFolderCache *cache, EAccount *account; EIterator *iterator; gboolean write_config = FALSE; - gchar *oldname; - gchar *newname; + gchar *old_uri; + gchar *new_uri; gint i; const gchar *cachenames[] = { @@ -369,6 +373,9 @@ folder_renamed_cb (MailFolderCache *cache, class = CAMEL_STORE_GET_CLASS (store); + old_uri = e_mail_folder_uri_build (store, old_folder_name); + new_uri = e_mail_folder_uri_build (store, new_folder_name); + account_list = e_get_account_list (); iterator = e_list_get_iterator (E_LIST (account_list)); @@ -398,6 +405,9 @@ folder_renamed_cb (MailFolderCache *cache, * not, doesn't matter */ for (i = 0; cachenames[i]; i++) { + gchar *oldname; + gchar *newname; + oldname = uri_to_evname (old_uri, cachenames[i]); newname = uri_to_evname (new_uri, cachenames[i]); g_rename (oldname, newname); @@ -405,6 +415,9 @@ folder_renamed_cb (MailFolderCache *cache, g_free (newname); } + g_free (old_uri); + g_free (new_uri); + /* nasty ... */ if (write_config) mail_config_write (); |