aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-properties.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-25 05:36:21 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-25 07:41:59 +0800
commita9dff2f33a06879403277a422fc579854aa99885 (patch)
tree36d8ccdaf876cc6ca36db80069dcbef8a26a60bf /mail/em-folder-properties.c
parentb6fecfcd53bc5a733a7aaf3684cda077bfdd2e5e (diff)
downloadgsoc2013-evolution-a9dff2f33a06879403277a422fc579854aa99885.tar
gsoc2013-evolution-a9dff2f33a06879403277a422fc579854aa99885.tar.gz
gsoc2013-evolution-a9dff2f33a06879403277a422fc579854aa99885.tar.bz2
gsoc2013-evolution-a9dff2f33a06879403277a422fc579854aa99885.tar.lz
gsoc2013-evolution-a9dff2f33a06879403277a422fc579854aa99885.tar.xz
gsoc2013-evolution-a9dff2f33a06879403277a422fc579854aa99885.tar.zst
gsoc2013-evolution-a9dff2f33a06879403277a422fc579854aa99885.zip
Use em_folder_tree_get_selected() in places to simplify code.
There were a few places where we were accessing the folder tree model directly to get the selected store + folder name, or were asking for the selected URI only to parse back into its store + folder name components.
Diffstat (limited to 'mail/em-folder-properties.c')
-rw-r--r--mail/em-folder-properties.c40
1 files changed, 12 insertions, 28 deletions
diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c
index 090dcd75c4..4f5b4f6710 100644
--- a/mail/em-folder-properties.c
+++ b/mail/em-folder-properties.c
@@ -444,48 +444,32 @@ emfp_dialog_got_folder (CamelStore *store,
/**
* em_folder_properties_show:
* @shell_view: an #EShellView
- * @folder_uri: a folder URI
+ * @store: a #CamelStore
+ * @folder_name: a folder name
*
- * Show folder properties for @folder_uri.
+ * Show folder properties for @folder_name.
**/
void
em_folder_properties_show (EShellView *shell_view,
- const gchar *folder_uri)
+ CamelStore *store,
+ const gchar *folder_name)
{
EShellBackend *shell_backend;
EShellContent *shell_content;
EMailBackend *backend;
- EMailSession *session;
EAlertSink *alert_sink;
GCancellable *cancellable;
AsyncContext *context;
- CamelStore *store = NULL;
- gchar *folder_name = NULL;
const gchar *uid;
- GError *error = NULL;
g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
- g_return_if_fail (folder_uri != NULL);
+ g_return_if_fail (CAMEL_IS_STORE (store));
+ g_return_if_fail (folder_name != NULL);
shell_backend = e_shell_view_get_shell_backend (shell_view);
shell_content = e_shell_view_get_shell_content (shell_view);
backend = E_MAIL_BACKEND (shell_backend);
- session = e_mail_backend_get_session (backend);
-
- e_mail_folder_uri_parse (
- CAMEL_SESSION (session), folder_uri,
- &store, &folder_name, &error);
-
- /* XXX This is unlikely to fail since the URI comes straight from
- * EMFolderTreeModel, but leave a breadcrumb if it does fail. */
- if (error != NULL) {
- g_warn_if_fail (store == NULL);
- g_warn_if_fail (folder_name == NULL);
- g_warning ("%s", error->message);
- g_error_free (error);
- return;
- }
uid = camel_service_get_uid (CAMEL_SERVICE (store));
@@ -493,9 +477,12 @@ em_folder_properties_show (EShellView *shell_view,
* "Unmatched" is a special Search Folder which can't be modified. */
if (g_strcmp0 (uid, "vfolder") == 0) {
if (g_strcmp0 (folder_name, CAMEL_UNMATCHED_NAME) != 0) {
+ gchar *folder_uri;
+
+ folder_uri = e_mail_folder_uri_build (
+ store, folder_name);
vfolder_edit_rule (backend, folder_uri);
- g_object_unref (store);
- g_free (folder_name);
+ g_free (folder_uri);
return;
}
}
@@ -519,7 +506,4 @@ em_folder_properties_show (EShellView *shell_view,
(GAsyncReadyCallback) emfp_dialog_got_folder, context);
g_object_unref (cancellable);
-
- g_object_unref (store);
- g_free (folder_name);
}