aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-01-16 15:00:22 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-01-16 15:00:22 +0800
commit21d0e891e218511c00b8f71769eaee998f61edfd (patch)
tree7a55cf12b04d85cfe560cd4c417025cd5e770163 /filter
parent05bd304f77b0199f35ba8e1a8845f87dc6305418 (diff)
downloadgsoc2013-evolution-21d0e891e218511c00b8f71769eaee998f61edfd.tar.gz
gsoc2013-evolution-21d0e891e218511c00b8f71769eaee998f61edfd.tar.zst
gsoc2013-evolution-21d0e891e218511c00b8f71769eaee998f61edfd.zip
** See bug #52467.
2004-01-16 Not Zed <NotZed@Ximian.com> ** See bug #52467. * vfolder-rule.c (vfr_folder_response): convert the uri to an evolution uri, rather than a camel one, for storage. And remove double-calls to geT_selected_uri. (format_source): treat uri as an evolution uri and convert to a camel one to get something meaningful out of it. svn path=/trunk/; revision=24265
Diffstat (limited to 'filter')
-rw-r--r--filter/ChangeLog10
-rw-r--r--filter/vfolder-rule.c29
2 files changed, 28 insertions, 11 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 6b37cc3fce..549521623d 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,13 @@
+2004-01-16 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #52467.
+
+ * vfolder-rule.c (vfr_folder_response): convert the uri to an
+ evolution uri, rather than a camel one, for storage. And remove
+ double-calls to geT_selected_uri.
+ (format_source): treat uri as an evolution uri and convert to a
+ camel one to get something meaningful out of it.
+
2004-01-15 Radek Doulik <rodo@ximian.com>
* filtertypes.xml: s/spam/junk, added junk test rule, it must be
diff --git a/filter/vfolder-rule.c b/filter/vfolder-rule.c
index ca411ca802..ae856f899e 100644
--- a/filter/vfolder-rule.c
+++ b/filter/vfolder-rule.c
@@ -393,15 +393,21 @@ select_source_with (GtkWidget *widget, struct _source_data *data)
}
/* attempt to make a 'nice' folder name out of the raw uri */
-static char *format_source(const char *uri)
+static char *format_source(const char *euri)
{
- CamelURL *url = camel_url_new(uri, NULL);
+ CamelURL *url;
GString *out;
- char *res;
+ char *res, *uri;
+
+ /* 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 g_strdup(uri);
+ return uri;
+
+ g_free(uri);
out = g_string_new(url->protocol);
g_string_append_c(out, ':');
@@ -426,21 +432,22 @@ vfr_folder_response(GtkWidget *dialog, gint button, struct _source_data *data)
{
const char *uri = em_folder_selector_get_selected_uri((EMFolderSelector *)dialog);
- if (button == GTK_RESPONSE_OK
- && (uri = em_folder_selector_get_selected_uri((EMFolderSelector *)dialog)) != NULL) {
- char *urinice;
+ if (button == GTK_RESPONSE_OK && uri != NULL) {
+ char *urinice, *euri;
GtkTreeSelection *selection;
GtkTreeIter iter;
- data->vr->sources = g_list_append (data->vr->sources, g_strdup(uri));
+ euri = em_uri_from_camel(uri);
+
+ data->vr->sources = g_list_append (data->vr->sources, euri);
gtk_list_store_append (data->model, &iter);
- urinice = format_source(uri);
- gtk_list_store_set(data->model, &iter, 0, urinice, 1, uri, -1);
+ urinice = format_source(euri);
+ gtk_list_store_set(data->model, &iter, 0, urinice, 1, euri, -1);
g_free(urinice);
selection = gtk_tree_view_get_selection(data->list);
gtk_tree_selection_select_iter(selection, &iter);
- data->current = uri;
+ data->current = euri;
set_sensitive(data);
}