From bac5b9ce2f6d579d6d4bb0969c97537300cfc1c8 Mon Sep 17 00:00:00 2001 From: Philip Van Hoof Date: Thu, 17 May 2007 12:28:18 +0000 Subject: [PATCH] Build fix, updating API changes from Tinymail pmo-trunk-r1903 --- src/modest-mail-operation.c | 12 +++++++++++- src/modest-ui-actions.c | 11 ++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 42c7e9f..52f6bbd 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -836,7 +836,17 @@ modest_mail_operation_rename_folder (ModestMailOperation *self, _("FIXME: unable to rename")); } else { /* Rename. Camel handles folder subscription/unsubscription */ - tny_folder_set_name (folder, name, &(priv->error)); + + TnyFolderStore *into; + TnyFolder *nfol; + + into = tny_folder_get_folder_store (folder); + nfol = tny_folder_copy (folder, into, name, TRUE, &(priv->error)); + if (into) + g_object_unref (into); + if (nfol) + g_object_unref (nfol); + CHECK_EXCEPTION (priv, MODEST_MAIL_OPERATION_STATUS_FAILED); } diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 3692775..5f0bfba 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -1562,14 +1562,21 @@ modest_ui_actions_on_rename_folder (GtkAction *action, { TnyFolderStore *folder; GtkWidget *folder_view; - + GtkWidget *header_view; + g_return_if_fail (MODEST_IS_MAIN_WINDOW(main_window)); folder_view = modest_main_window_get_child_widget (main_window, MODEST_WIDGET_TYPE_FOLDER_VIEW); if (!folder_view) return; + + header_view = modest_main_window_get_child_widget (main_window, + MODEST_WIDGET_TYPE_HEADER_VIEW); + if (!header_view) + return; + folder = modest_folder_view_get_selected (MODEST_FOLDER_VIEW(folder_view)); if (folder && TNY_IS_FOLDER (folder)) { @@ -1584,6 +1591,8 @@ modest_ui_actions_on_rename_folder (GtkAction *action, modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op); + modest_header_view_set_folder (MODEST_HEADER_VIEW (header_view), NULL); + modest_mail_operation_rename_folder (mail_op, TNY_FOLDER (folder), (const gchar *) folder_name); -- 1.7.9.5