evolution-rss r430 - in trunk: . src
- From: lucilanga svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-rss r430 - in trunk: . src
- Date: Tue, 20 Jan 2009 10:21:07 +0000 (UTC)
Author: lucilanga
Date: Tue Jan 20 10:21:07 2009
New Revision: 430
URL: http://svn.gnome.org/viewvc/evolution-rss?rev=430&view=rev
Log:
2008-01-20 Lucian Langa <lucilanga gnome org>
* src/rss.c - display comments feeds
* src/parser.c - parse_channel_line new
xml parsing function
* src/parser.c - tree_walk - support xml
genering tree walking
Modified:
trunk/ChangeLog
trunk/src/parser.c
trunk/src/rss.c
Modified: trunk/src/parser.c
==============================================================================
--- trunk/src/parser.c (original)
+++ trunk/src/parser.c Tue Jan 20 10:21:07 2009
@@ -968,10 +968,21 @@
guint i;
create_feed *CF;
xmlNodePtr el;
+ GString *comments = g_string_new(NULL);
for (i=0; NULL != (el = g_array_index(r->item, xmlNodePtr, i)); i++) {
CF = parse_channel_line(el->children, NULL, NULL);
- print_cf(CF);
+ print_cf(CF);
+ g_string_append_printf(comments, "<tr><td><table cellpading=0 cellspacing=0 border=1 width=100%>");
+ g_string_append_printf(comments,
+ "<tr><td><table border=0 width=\"100%%\" cellspacing=4 cellpadding=4>");
+ g_string_append_printf(comments, "<tr><td>%s</td><td align=right>%s</td></tr>", CF->subj, CF->date);
+ g_string_append_printf(comments, "<tr><td colspan=2>%s</td></tr>", CF->body);
+ g_string_append_printf(comments, "</table></td></tr>");
+ g_string_append_printf(comments, "</table></td></tr>");
}
+ gchar *scomments=comments->str;
+ g_string_free(comments, FALSE);
+ return scomments;
}
gchar *
Modified: trunk/src/rss.c
==============================================================================
--- trunk/src/rss.c (original)
+++ trunk/src/rss.c Tue Jan 20 10:21:07 2009
@@ -242,6 +242,7 @@
typedef struct _rfMessage rfMessage;
void generic_finish_feed(rfMessage *msg, gpointer user_data);
+gchar *print_comments(gchar *url, gchar *stream);
/*======================================================================*/
@@ -1769,15 +1770,14 @@
camel_stream_printf (fstream, "<tr><td bgcolor=\"%06x\"><b><font size=+1><a href=%s>Comments</font></b></td></tr>",
content_colour & 0xEDECEB & 0xffffff,
comments);
- camel_stream_printf (fstream, "</table></div>");
if (commstream) {
-// camel_stream_printf (fstream, "%s", commstream);
- print_comments(comments, commstream);
+ camel_stream_printf(fstream, "%s", (gchar *)print_comments(comments, commstream));
commstream = NULL;
}
else {
fetch_comments(comments, t->format);
}
+ camel_stream_printf (fstream, "</table></div>");
}
}
@@ -2514,6 +2514,7 @@
gtk_main_iteration ();
}
+gchar *
print_comments(gchar *url, gchar *stream)
{
RDF *r = NULL;
@@ -2533,7 +2534,7 @@
r->cache = doc;
r->uri = url;
- display_comments (r);
+ return display_comments (r);
}
}
@@ -4151,11 +4152,12 @@
{
xmlNodePtr root = xmlDocGetRootElement (r->cache);
tree_walk (root, r);
- r->feedid = update_comments(r);
+ gchar *comments = update_comments(r);
if (r->maindate)
g_free(r->maindate);
g_array_free(r->item, TRUE);
- g_free(r->feedid);
+ //g_free(r->feedid);
+ return comments;
}
gchar *
@@ -4163,7 +4165,6 @@
{
xmlNodePtr root = xmlDocGetRootElement (r->cache);
tree_walk (root, r);
- g_print("chn_name:%s\n", r->title);
r->feedid = update_channel(r);
if (r->maindate)
g_free(r->maindate);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]