From c211a974e3d532077b3be3235ff2e891533b9c3c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 31 Oct 2010 17:16:57 -0400 Subject: Kill em_folder_utils_unsubscribe_folder(). Use e_mail_session_unsubscribe_folder() instead. --- mail/em-folder-utils.c | 75 -------------------------------------------------- 1 file changed, 75 deletions(-) (limited to 'mail/em-folder-utils.c') diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c index c2720fc5ae..e84152e574 100644 --- a/mail/em-folder-utils.c +++ b/mail/em-folder-utils.c @@ -754,81 +754,6 @@ em_folder_utils_create_folder (CamelFolderInfo *folderinfo, gtk_dialog_run (GTK_DIALOG (dialog)); } -struct _folder_unsub_t { - MailMsg base; - EMailSession *session; - gchar *folder_uri; -}; - -static gchar * -emfu_unsubscribe_folder__desc (struct _folder_unsub_t *msg) -{ - return g_strdup_printf ( - _("Unsubscribing from folder \"%s\""), msg->folder_uri); -} - -static void -emfu_unsubscribe_folder__exec (struct _folder_unsub_t *msg, - GCancellable *cancellable, - GError **error) -{ - CamelStore *store; - CamelURL *url; - const gchar *path = NULL; - gint url_flags; - - store = camel_session_get_store ( - CAMEL_SESSION (msg->session), - msg->folder_uri, error); - if (store == NULL) - return; - - url = camel_url_new (msg->folder_uri, NULL); - url_flags = CAMEL_SERVICE (store)->provider->url_flags; - - if (url_flags & CAMEL_URL_FRAGMENT_IS_PATH) - path = url->fragment; - else if (url->path != NULL && *url->path != '\0') - path = url->path + 1; - - if (path != NULL) - camel_store_unsubscribe_folder_sync ( - store, path, cancellable, error); - - camel_url_free (url); -} - -static void -emfu_unsubscribe_folder__free (struct _folder_unsub_t *msg) -{ - g_object_unref (msg->session); - g_free (msg->folder_uri); -} - -static MailMsgInfo unsubscribe_info = { - sizeof (struct _folder_unsub_t), - (MailMsgDescFunc) emfu_unsubscribe_folder__desc, - (MailMsgExecFunc) emfu_unsubscribe_folder__exec, - (MailMsgDoneFunc) NULL, - (MailMsgFreeFunc) emfu_unsubscribe_folder__free -}; - -void -em_folder_utils_unsubscribe_folder (EMailSession *session, - const gchar *folder_uri) -{ - struct _folder_unsub_t *unsub; - - g_return_if_fail (E_IS_MAIL_SESSION (session)); - g_return_if_fail (folder_uri != NULL); - - unsub = mail_msg_new (&unsubscribe_info); - unsub->session = g_object_ref (session); - unsub->folder_uri = g_strdup (folder_uri); - - mail_msg_unordered_push (unsub); -} - const gchar * em_folder_utils_get_icon_name (guint32 flags) { -- cgit v1.2.3