[evolution-rss] handle broken feeds with null as enclosure



commit f7dd589b32d8d89afd741f861ceece4bd67d422a
Author: Lucian Langa <lucilanga gnome org>
Date:   Sat Dec 5 17:52:40 2009 +0200

    handle broken feeds with null as enclosure

 TODO                     |    1 +
 src/parser.c             |    7 ++++++-
 src/rss-config-factory.c |    5 ++++-
 src/rss.c                |    2 ++
 4 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/TODO b/TODO
index a657e65..07094f6 100644
--- a/TODO
+++ b/TODO
@@ -43,3 +43,4 @@
 	* config option to sort comments ascending/descending
 	* hook all rss config options in RSS top folder properties in right click menu
 	* image contained in feeds displayed after the coments ??
+	* add accelerators where missing
diff --git a/src/parser.c b/src/parser.c
index c0dcddc..a5bbf96 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -304,7 +304,7 @@ parse_html(char *url, const char *html, int len)
 }
 
 const char *
-layer_find_innerelement (xmlNodePtr node, 
+layer_find_innerelement (xmlNodePtr node,
 	    const char *match, const char *el,
 	    const char *fail)
 {
@@ -951,6 +951,11 @@ parse_channel_line(xmlNode *top, gchar *feed_name, char *main_date)
 		//handle multiple enclosures
 		encl = (gchar *)layer_find_innerelement(top, "enclosure", "url",	// RSS 2.0 Enclosure
 			layer_find_innerelement(top, "link", "enclosure", NULL));		// ATOM Enclosure
+		//handle screwed feeds that set url to "" (feed does not validate!)
+		if (encl && !strlen(encl)) {
+			g_free(encl);
+			encl = NULL;
+		}
 //		encl = layer_find_tag_prop(el->children, "media", "url",	// RSS 2.0 Enclosure
 //							NULL);		// ATOM Enclosure
 		//we have to free this somehow
diff --git a/src/rss-config-factory.c b/src/rss-config-factory.c
index 554cea0..875171f 100644
--- a/src/rss-config-factory.c
+++ b/src/rss-config-factory.c
@@ -2207,6 +2207,9 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
 	GtkListStore  *store;
         GtkTreeIter iter;
         GtkWidget *hbox, *combo;
+#if !defined(HAVE_GECKO) && !defined (HAVE_WEBKIT)
+	GtkWidget *label_webkit;
+#endif
 	GtkCellRenderer *renderer;
 	guint i, render;
         UIData *ui = g_new0 (UIData, 1);
@@ -2269,7 +2272,7 @@ e_plugin_lib_get_configure_widget (EPlugin *epl)
                                         NULL, NULL);
 
 #if !defined(HAVE_GECKO) && !defined (HAVE_WEBKIT)
-        GtkWidget *label_webkit = GTK_WIDGET (gtk_builder_get_object(ui->xml, "label_webkits"));
+        label_webkit = GTK_WIDGET (gtk_builder_get_object(ui->xml, "label_webkits"));
         gtk_label_set_text(GTK_LABEL(label_webkit), _("Note: In order to be able to use Mozilla (Firefox) or Apple Webkit \nas renders you need firefox or webkit devel package \ninstalled and evolution-rss should be recompiled to see those packages."));
         gtk_widget_show(label_webkit);
 #endif
diff --git a/src/rss.c b/src/rss.c
index b3d0d93..76b3f8b 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -1164,6 +1164,7 @@ rss_select_folder(gchar *folder_name)
 	g_object_get (shell_sidebar, "folder-tree", &folder_tree, NULL);
 	store = rss_component_peek_local_store();
 	fold = camel_store_get_folder (store, folder_name, 0, NULL);
+	if (!fold) return;
         uri = mail_tools_folder_to_url (fold);
 	em_folder_tree_set_selected(folder_tree, uri, 0);
 #endif
@@ -3109,6 +3110,7 @@ add:
 		if (feed->validate)
 			display_feed(r);
 
+
 		real_name = g_strdup_printf(
 					"%s/%s",
 					lookup_main_folder(),



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