aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-06 04:29:23 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:09 +0800
commit5f6ea9db8dd59694a570502442c9f589e67bc89b (patch)
tree979ba24f9f37e27063c93d8e1f0fe4867d813bcd
parent3d92a8f8015569c5272115dcfb6786630e33e8c2 (diff)
downloadgsoc2013-evolution-5f6ea9db8dd59694a570502442c9f589e67bc89b.tar.gz
gsoc2013-evolution-5f6ea9db8dd59694a570502442c9f589e67bc89b.tar.zst
gsoc2013-evolution-5f6ea9db8dd59694a570502442c9f589e67bc89b.zip
EMVFolderRule: Use the new folder URI format.
-rw-r--r--mail/em-vfolder-rule.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c
index 22c0690c79..2abd99ef9e 100644
--- a/mail/em-vfolder-rule.c
+++ b/mail/em-vfolder-rule.c
@@ -526,21 +526,19 @@ select_source_with_changed (GtkWidget *widget, struct _source_data *data)
}
/* attempt to make a 'nice' folder name out of the raw uri */
-static gchar *format_source (const gchar *euri)
+static gchar *
+format_source (const gchar *uri)
{
CamelURL *url;
GString *out;
- gchar *res, *uri;
+ gchar *res;
/* This should really probably base it on the account name? */
- uri = em_uri_to_camel (euri);
url = camel_url_new (uri, NULL);
/* bad uri */
if (url == NULL)
- return uri;
-
- g_free (uri);
+ return g_strdup (uri);
out = g_string_new (url->protocol);
g_string_append_c (out, ':');
@@ -561,31 +559,34 @@ static gchar *format_source (const gchar *euri)
}
static void
-vfr_folder_response (GtkWidget *dialog, gint button, struct _source_data *data)
+vfr_folder_response (EMFolderSelector *selector,
+ gint button,
+ struct _source_data *data)
{
- const gchar *uri = em_folder_selector_get_selected_uri ((EMFolderSelector *)dialog);
+ const gchar *uri;
+
+ uri = em_folder_selector_get_selected_uri (selector);
if (button == GTK_RESPONSE_OK && uri != NULL) {
- gchar *urinice, *euri;
+ gchar *urinice;
GtkTreeSelection *selection;
GtkTreeIter iter;
- euri = em_uri_from_camel (uri);
-
- data->vr->sources = g_list_append (data->vr->sources, euri);
+ data->vr->sources = g_list_append (
+ data->vr->sources, g_strdup (uri));
gtk_list_store_append (data->model, &iter);
- urinice = format_source (euri);
- gtk_list_store_set (data->model, &iter, 0, urinice, 1, euri, -1);
+ urinice = format_source (uri);
+ gtk_list_store_set (data->model, &iter, 0, urinice, 1, uri, -1);
g_free (urinice);
selection = gtk_tree_view_get_selection (data->list);
gtk_tree_selection_select_iter (selection, &iter);
- data->current = euri;
+ data->current = uri;
set_sensitive (data);
}
- gtk_widget_destroy (dialog);
+ gtk_widget_destroy (GTK_WIDGET (selector));
}
static void