[evolution-rss] fix folder sanitization take 2 properly fix commit http://git.gnome.org/browse/evolution-rss/commit/
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-rss] fix folder sanitization take 2 properly fix commit http://git.gnome.org/browse/evolution-rss/commit/
- Date: Fri, 4 Mar 2011 18:28:09 +0000 (UTC)
commit a273b933a7eaa3a1de47ddaf490f73c25433b757
Author: Lucian Langa <lucilanga gnome org>
Date: Fri Mar 4 18:05:41 2011 +0200
fix folder sanitization take 2
properly fix commit http://git.gnome.org/browse/evolution-rss/commit/?id=8cf03b9610cbfffc1f009bc8a07c7c82949b733c
src/rss-config-factory.c | 16 ++++++++++++----
src/rss-image.c | 4 +++-
src/rss-status-icon.c | 6 ++++--
src/rss.c | 6 +++++-
4 files changed, 24 insertions(+), 8 deletions(-)
---
diff --git a/src/rss-config-factory.c b/src/rss-config-factory.c
index 5914348..c6f4b08 100644
--- a/src/rss-config-factory.c
+++ b/src/rss-config-factory.c
@@ -359,6 +359,7 @@ construct_list(gpointer key, gpointer value, gpointer user_data)
-1);
g_free(name);
g_free(full_path);
+ g_free(full_name);
}
static void
@@ -584,12 +585,14 @@ build_dialog_add(gchar *url, gchar *feed_text)
entry2 = GTK_WIDGET (gtk_builder_get_object(gui, "entry2"));
feed_name = GTK_WIDGET (gtk_builder_get_object(gui, "feed_name"));
if (url != NULL) {
+ gchar *folder_name = lookup_feed_folder(feed_text);
flabel = g_build_path(G_DIR_SEPARATOR_S,
lookup_main_folder(),
- lookup_feed_folder(feed_text),
+ folder_name,
NULL);
gtk_label_set_text(GTK_LABEL(entry2), flabel);
- fname = g_path_get_basename(lookup_feed_folder(feed_text));
+ fname = g_path_get_basename(folder_name);
+ g_free(folder_name);
gtk_entry_set_text(GTK_ENTRY(feed_name), fname);
g_free(fname);
gtk_widget_show(feed_name);
@@ -1538,8 +1541,11 @@ process_dialog_edit(add_feed *feed, gchar *url, gchar *feed_name)
feed->feed_url = sanitize_url(feed->feed_url);
g_free(text);
if (feed->feed_url) {
+ gchar *folder_name;
feed->edit=1;
- prefix = g_path_get_dirname(lookup_feed_folder(feed_name));
+ folder_name = lookup_feed_folder(feed_name);
+ prefix = g_path_get_dirname(folder_name);
+ g_free(folder_name);
if (*prefix != '.')
feed->prefix = prefix;
if (strcmp(url, feed->feed_url)) {
@@ -1587,14 +1593,16 @@ process_dialog_edit(add_feed *feed, gchar *url, gchar *feed_name)
}
if (feed->renamed) {
+ gchar *folder_name = lookup_feed_folder(feed_name);
gchar *a = g_build_path(G_DIR_SEPARATOR_S,
lookup_main_folder(),
- lookup_feed_folder(feed_name),
+ folder_name,
NULL);
gchar *dir = g_path_get_dirname(a);
gchar *b = g_build_path(
G_DIR_SEPARATOR_S,
dir, feed->feed_name, NULL);
+ g_free(folder_name);
#if (DATASERVER_VERSION >= 2033001)
camel_store_rename_folder_sync (store, a, b, NULL, &error);
#else
diff --git a/src/rss-image.c b/src/rss-image.c
index 6965ba7..76d9e13 100644
--- a/src/rss-image.c
+++ b/src/rss-image.c
@@ -412,11 +412,13 @@ display_folder_icon(GtkTreeStore *tree_store, gchar *key)
if (pixbuf) {
gchar *name = g_hash_table_lookup(rf->hrname_r, key);
+ gchar *folder_name = lookup_feed_folder(name);
gchar *full_name = g_build_path(
G_DIR_SEPARATOR_S,
get_main_folder(),
- lookup_feed_folder(name),
+ folder_name,
NULL);
+ g_free(folder_name);
/*folder isn't created yet?*/
#if (DATASERVER_VERSION >= 2033001)
rssi = camel_store_get_folder_info_sync (
diff --git a/src/rss-status-icon.c b/src/rss-status-icon.c
index 7bd2818..9d5ffdc 100644
--- a/src/rss-status-icon.c
+++ b/src/rss-status-icon.c
@@ -45,9 +45,11 @@ icon_activated (GtkStatusIcon *icon, gpointer pnotify)
gtk_status_icon_set_has_tooltip (status_icon, FALSE);
uri = g_object_get_data (G_OBJECT (status_icon), "uri");
if (uri) {
+ gchar *folder_name = lookup_feed_folder(uri);
real_name = g_build_path(G_DIR_SEPARATOR_S,
lookup_main_folder(),
- lookup_feed_folder(uri), NULL);
+ folder_name, NULL);
+ g_free(folder_name);
rss_select_folder(real_name);
}
}
@@ -191,7 +193,7 @@ update_status_icon(const char *channel, gchar *title)
gtk_status_icon_set_has_tooltip (status_icon, TRUE);
g_object_set_data_full (
G_OBJECT (status_icon), "uri",
- g_strdup (lookup_feed_folder((gchar *)channel)),
+ lookup_feed_folder((gchar *)channel),
(GDestroyNotify) g_free);
g_free(flat_status_msg);
// g_free(total);
diff --git a/src/rss.c b/src/rss.c
index 9e84cc9..21e23fa 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -3933,9 +3933,11 @@ lookup_feed_folder(gchar *folder)
gchar *new_folder = g_hash_table_lookup(
rf->reversed_feed_folders, folder);
/* replace remaining dots with spaces - dots aren't supported since evo's Maildir migration*/
+ gchar *res = g_strdup(new_folder ? new_folder : folder);
#if EVOLUTION_VERSION > 29103
- return g_strdelimit(new_folder ? new_folder : folder, ".", ' ');
+ g_strdelimit(res, ".", ' ');
#endif
+ return res;
}
gchar *
@@ -4203,6 +4205,7 @@ check_feed_folder(gchar *folder_name)
#endif
}
g_free(real_name);
+ g_free(real_folder);
return mail_folder;
}
@@ -5895,6 +5898,7 @@ get_feed_age(RDF *r, gpointer name)
#endif
d("delete => remaining total:%d\n", total);
fail: g_free(real_name);
+ g_free(real_folder);
inhibit_read = 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]