evolution-rss r448 - in trunk: . src



Author: lucilanga
Date: Fri Feb 20 07:14:55 2009
New Revision: 448
URL: http://svn.gnome.org/viewvc/evolution-rss?rev=448&view=rev

Log:
2009-02-19  Lucian Langa  <lucilanga gnome org>

* src/parser.c: (update_channel) parse category of feeds

Modified:
   trunk/TODO
   trunk/src/parser.c
   trunk/src/rss.c

Modified: trunk/TODO
==============================================================================
--- trunk/TODO	(original)
+++ trunk/TODO	Fri Feb 20 07:14:55 2009
@@ -48,3 +48,5 @@
 	* category posted under
 	* coments updatable
 	* slow delete operation on large folders
+	* check operation cancel button
+	* add icon to feed setup panel

Modified: trunk/src/parser.c
==============================================================================
--- trunk/src/parser.c	(original)
+++ trunk/src/parser.c	Fri Feb 20 07:14:55 2009
@@ -429,9 +429,15 @@
 }
 
 void
-dublin_core_rss(void)
+dublin_core_rss(xmlNode *node, gchar *fail)
 {
-	g_print("dublin core\n");
+	gchar *content;
+
+	content = xmlNodeGetContent(node);
+	if (content)
+		return content;
+	else
+		return fail;
 }
 
 void
@@ -842,6 +848,7 @@
 	gchar *encl;
 	xmlChar *buff = NULL;
 	guint size = 0;
+	GList *category = NULL;
 
 	char *p = g_strdup(layer_find (top, "title", "Untitled article"));
 	//firstly try to parse as an ATOM author
@@ -927,9 +934,16 @@
 			link = layer_find_innerelement(top, "link", "href", 
 							g_strdup(_("No Information")));	//ATOM
 
-                char *comments = g_strdup(layer_find (top, "comments", NULL));	//RSS,
-		comments = layer_find_ns_tag(top, "wfw", "commentRss", NULL); //add slash:comments
-		GList *category = layer_find_all(top, "category", NULL);
+//                char *comments = g_strdup(layer_find (top, "comments", NULL));	//RSS,
+		char *comments = NULL;
+//		if (!comments)
+			comments = layer_find_ns_tag(top, "wfw", "commentRss", NULL); //add slash:comments
+		gchar *tcat = layer_find_ns_tag(top, "dc", "subject", NULL);
+		if (tcat)
+			category = g_list_append(category, g_strdup(tcat));
+		else
+			category = layer_find_all(top, "category", NULL);
+
 		char *id = layer_find (top, "id",				//ATOM
 				layer_find (top, "guid", NULL));		//RSS 2.0
 		feed = g_strdup_printf("%s\n", id ? id : link);

Modified: trunk/src/rss.c
==============================================================================
--- trunk/src/rss.c	(original)
+++ trunk/src/rss.c	Fri Feb 20 07:14:55 2009
@@ -1507,7 +1507,7 @@
 	gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_HALF);
 	g_signal_connect (button, "clicked", G_CALLBACK(summary_cb), efh);
 	gtk_box_pack_start (GTK_BOX (hbox2), button, TRUE, TRUE, 0);
-        gtk_widget_show (button);
+        gtk_widget_show_all (button);
 	if (rf->cur_format)
 	{
         	GtkWidget *button4 = gtk_button_new_from_stock (GTK_STOCK_GO_BACK);
@@ -1606,6 +1606,7 @@
 	CamelContentType *type;
 	gchar *feedid = NULL;
 	gchar *comments = NULL;
+	gchar *category = NULL;
 	CamelDataWrapper *dw = camel_data_wrapper_new();
 	CamelMimePart *part = camel_mime_part_new();
 	CamelStream *fstream = camel_stream_mem_new();
@@ -1629,6 +1630,7 @@
 	gchar *addr = (gchar *)camel_header_location_decode(website);
 	feedid  = (gchar *)camel_medium_get_header (CAMEL_MEDIUM(message), "RSS-ID");
 	comments  = (gchar *)camel_medium_get_header (CAMEL_MEDIUM(message), "X-Evolution-rss-comments");
+	category  = (gchar *)camel_medium_get_header (CAMEL_MEDIUM(message), "X-Evolution-rss-category");
 	gchar *subject = camel_header_decode_string(camel_medium_get_header (CAMEL_MEDIUM (message),
 				 "Subject"), NULL);
 	gchar *f = camel_header_decode_string(camel_medium_get_header (CAMEL_MEDIUM (message),
@@ -1759,14 +1761,18 @@
 			"<div style=\"border: solid #%06x 1px; background-color: #%06x; color: #%06x;\">\n",
 			frame_colour & 0xffffff, content_colour & 0xffffff, text_colour & 0xffffff);
 		camel_stream_printf(fstream, 
-			"<table border=0 width=\"100%%\" cellspacing=4 cellpadding=4>");
+			"<table border=0 width=\"100%%\" cellspacing=2 cellpadding=1>");
      		camel_stream_printf(fstream,
 			"<tr><td bgcolor=\"%06x\"><b><font size=+1><a href=%s>%s</a></font></b></td></tr>", 
 			content_colour & 0xEDECEB & 0xffffff,
 			website, subject);
+		if (category)
+			camel_stream_printf(fstream,
+				"<tr><td bgcolor=\"%06x\"><b><font size=-1>Posted under: %s</font></b></td></tr>", 
+				content_colour & 0xEDECEB & 0xffffff,
+				category);
+//     		camel_stream_printf (fstream, "<tr><td><table width=\"100%%\" cellpading=2 cellspaing=2><tr><td><font colour=#%06x>%s</font></td></tr></table></td></tr>", text_colour & 0xffffff, buff);
      		camel_stream_printf (fstream, "<tr><td><font colour=#%06x>%s</font></td></tr>", text_colour & 0xffffff, buff);
-//		camel_stream_printf (fstream, "</table></div>");
-//		g_print("comments:%s|\n", comments);
 		if (comments) {
 //			camel_stream_printf (fstream,
 //				"<br><div style=\"border: solid #%06x 1px; background-color: #%06x; color: #%06x;\">\n",
@@ -1784,7 +1790,7 @@
 				fetch_comments(comments, t->format);
 			}
 			camel_stream_printf (fstream, "</table></div>");
-		}
+		}	
 	}
 
 	//this is required for proper charset rendering when html



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