[evolution-rss] avoid crash in editing feeds in list



commit 88979b7c9f609299443f87882a8d7f2e29b9d5e9
Author: Lucian Langa <lucilanga gnome org>
Date:   Tue Jan 22 09:00:44 2013 +0100

    avoid crash in editing feeds in list

 src/rss-config-factory.c |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)
---
diff --git a/src/rss-config-factory.c b/src/rss-config-factory.c
index 20c693f..10b4301 100644
--- a/src/rss-config-factory.c
+++ b/src/rss-config-factory.c
@@ -1849,6 +1849,7 @@ feeds_dialog_edit(GtkDialog *d, gpointer data)
 	GtkTreeModel     *model;
 	GtkTreeIter       iter;
 	gchar *name, *feed_name;
+	gchar *tmp_feed_name;
 	gpointer key;
 	add_feed *feed = NULL;
 
@@ -1860,13 +1861,23 @@ feeds_dialog_edit(GtkDialog *d, gpointer data)
 			&iter,
 			3, &feed_name,
 			-1);
-		key = lookup_key(feed_name);
-		name = g_hash_table_lookup(rf->hr, key);
-		if (name) {
-			feed = create_dialog_add(name, feed_name);
-			if (feed->dialog)
-				gtk_widget_destroy(feed->dialog);
-			process_dialog_edit(feed, name, feed_name);
+		/* seems we get the data from gtk_tree with html entities already translated
+		 * so instead of adding versioned defs we fallback to decoding html entities
+		 * in case key is not found, and in case that fails too we exit gracefully
+		 */
+		if (!(key = lookup_key(feed_name))) {
+			tmp_feed_name = feed_name;
+			feed_name = decode_entities(feed_name);
+			g_free(tmp_feed_name);
+			key = lookup_key(feed_name);
+		}
+		if (key) {
+			if (name = g_hash_table_lookup(rf->hr, key)) {
+				feed = create_dialog_add(name, feed_name);
+				if (feed->dialog)
+					gtk_widget_destroy(feed->dialog);
+				process_dialog_edit(feed, name, feed_name);
+			}
 		}
 		if (feed && feed->feed_url)
 			store_redraw(GTK_TREE_VIEW(rf->treeview));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]