aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-20 02:56:17 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-21 01:14:53 +0800
commit86c9c4d793b3f9eff93fe00ad579427f254c5882 (patch)
treedd3ada63e738ac124789b64421728e6f32dd7144 /mail/em-folder-utils.c
parent0c790b10190c2cff5fdb7cc1b25dc2a41dedd707 (diff)
downloadgsoc2013-evolution-86c9c4d793b3f9eff93fe00ad579427f254c5882.tar.gz
gsoc2013-evolution-86c9c4d793b3f9eff93fe00ad579427f254c5882.tar.zst
gsoc2013-evolution-86c9c4d793b3f9eff93fe00ad579427f254c5882.zip
Remove mail_remove_folder().
Use e_mail_folder_remove() instead.
Diffstat (limited to 'mail/em-folder-utils.c')
-rw-r--r--mail/em-folder-utils.c106
1 files changed, 0 insertions, 106 deletions
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index c13337bf68..60f03002f0 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -476,112 +476,6 @@ em_folder_utils_copy_folder (GtkWindow *parent,
gtk_widget_destroy (dialog);
}
-typedef struct {
- EMailBackend *backend;
- GtkWidget *dialog;
-} DeleteFolderData;
-
-static void
-emfu_delete_done (CamelFolder *folder,
- gboolean removed,
- GError **error,
- gpointer user_data)
-{
- DeleteFolderData *data = user_data;
-
- if (error != NULL && *error != NULL) {
- e_mail_backend_submit_alert (
- data->backend,
- "mail:no-delete-folder",
- camel_folder_get_full_name (folder),
- (*error)->message, NULL);
- g_clear_error (error);
- }
-
- g_object_unref (data->backend);
- gtk_widget_destroy (data->dialog);
- g_slice_free (DeleteFolderData, data);
-}
-
-/* FIXME: these functions must be documented */
-void
-em_folder_utils_delete_folder (EMailBackend *backend,
- CamelFolder *folder)
-{
- CamelStore *local_store;
- CamelStore *parent_store;
- EMailSession *session;
- MailFolderCache *folder_cache;
- GtkWindow *parent = e_shell_get_active_window (NULL);
- GtkWidget *dialog;
- const gchar *full_name;
- gint flags = 0;
-
- g_return_if_fail (E_IS_MAIL_BACKEND (backend));
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
- full_name = camel_folder_get_full_name (folder);
- parent_store = camel_folder_get_parent_store (folder);
-
- local_store = e_mail_local_get_store ();
- session = e_mail_backend_get_session (backend);
- folder_cache = e_mail_session_get_folder_cache (session);
-
- if (parent_store == local_store && emfu_is_special_local_folder (full_name)) {
- e_mail_backend_submit_alert (
- backend, "mail:no-delete-special-folder",
- full_name, NULL);
- return;
- }
-
- if (mail_folder_cache_get_folder_info_flags (
- folder_cache, folder, &flags) &&
- (flags & CAMEL_FOLDER_SYSTEM)) {
- e_mail_backend_submit_alert (
- backend, "mail:no-delete-special-folder",
- camel_folder_get_display_name (folder), NULL);
- return;
- }
-
- g_object_ref (folder);
-
- if (mail_folder_cache_get_folder_info_flags (
- folder_cache, folder, &flags) &&
- (flags & CAMEL_FOLDER_CHILDREN)) {
- if (parent_store && CAMEL_IS_VEE_STORE (parent_store))
- dialog = e_alert_dialog_new_for_args (
- parent, "mail:ask-delete-vfolder",
- full_name, NULL);
- else
- dialog = e_alert_dialog_new_for_args (
- parent, "mail:ask-delete-folder",
- full_name, NULL);
- } else {
- if (parent_store && CAMEL_IS_VEE_STORE (parent_store))
- dialog = e_alert_dialog_new_for_args (
- parent, "mail:ask-delete-vfolder-nochild",
- full_name, NULL);
- else
- dialog = e_alert_dialog_new_for_args (
- parent, "mail:ask-delete-folder-nochild",
- full_name, NULL);
- }
-
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
- DeleteFolderData *data;
-
- /* disable dialog until operation finishes */
- gtk_widget_set_sensitive (dialog, FALSE);
-
- data = g_slice_new0 (DeleteFolderData);
- data->backend = g_object_ref (backend);
- data->dialog = dialog;
-
- mail_remove_folder (folder, emfu_delete_done, data);
- } else
- gtk_widget_destroy (dialog);
-}
-
struct _EMCreateFolder {
MailMsg base;