evolution-rss r468 - in trunk: . src



Author: lucilanga
Date: Sat Mar 21 15:11:25 2009
New Revision: 468
URL: http://svn.gnome.org/viewvc/evolution-rss?rev=468&view=rev

Log:
2009-03-21  Lucian Langa  <lucilanga gnome org>

* src/rss.c: (org_gnome_cooly_format_rss) add icon to feed articles

Modified:
   trunk/ChangeLog
   trunk/src/misc.c
   trunk/src/parser.c
   trunk/src/rss.c

Modified: trunk/src/misc.c
==============================================================================
--- trunk/src/misc.c	(original)
+++ trunk/src/misc.c	Sat Mar 21 15:11:25 2009
@@ -34,7 +34,7 @@
 static void
 print_hash(gpointer key, gpointer value, gpointer user_data)
 {
- 	g_print("key:%p, value:%p\n", key, value);
+ 	g_print("key:%s, value:%s\n", key, value);
 }
  
 static void

Modified: trunk/src/parser.c
==============================================================================
--- trunk/src/parser.c	(original)
+++ trunk/src/parser.c	Sat Mar 21 15:11:25 2009
@@ -813,8 +813,16 @@
 		fprintf(stderr, "ERROR:No channel definition.\n");
 		return NULL;
 	}
+	gchar *server = get_server_from_uri(r->uri);
+	gchar *fav = g_strconcat(server, "/favicon.ico", NULL);
+	g_free(server);
+
 	if (image != NULL)
-		r->image = layer_find(image->children, "url", NULL);
+		r->image = layer_find(image->children, "url", fav);
+	else 
+		r->image = fav;
+
+//	g_free(fav);
 
 	t = g_strdup(get_real_channel_name(r->uri, NULL));
 	//feed might be added with no validation

Modified: trunk/src/rss.c
==============================================================================
--- trunk/src/rss.c	(original)
+++ trunk/src/rss.c	Sat Mar 21 15:11:25 2009
@@ -1770,15 +1770,19 @@
 	//	char *buff = decode_html_entities(buffer2);
 ///		buff=tmp;
 
+
+		gchar *feed_dir = rss_component_peek_base_directory(mail_component_peek());
+                gchar *feed_file = g_strdup_printf("%s/%s.img", feed_dir, feedid);
+
 		camel_stream_printf (fstream,
                         "<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 2px; color: #%06x;\">",
                         frame_colour & 0xffffff, content_colour & 0xEDECEB & 0xffffff, text_colour & 0xffffff);
                 camel_stream_printf (fstream,
                         "<div style=\"border: solid 0px; background-color: #%06x; padding: 2px; color: #%06x;\">"
-                        "<img src=/usr/share/evolution/2.24/images/rss-16.png>"
+                        "<img height=16 src=%s>"
                         "<b><font size=+1><a href=%s>%s</a></font></b></div>",
 			content_colour & 0xEDECEB & 0xffffff, text_colour & 0xffffff,
-                        website, subject);
+                        feed_file, website, subject);
                 if (category)
                         camel_stream_printf(fstream,
                                 "<div style=\"border: solid 0px; background-color: #%06x; padding: 2px; color: #%06x;\">"
@@ -1854,8 +1858,9 @@
 		goto out;
 	if (!icons)
 		icons = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+	gchar *ofolder = g_hash_table_lookup(rf->feed_folders, rss_folder);
 	gchar *key = g_hash_table_lookup(rf->hrname,
-				lookup_feed_folder(rss_folder));
+				ofolder ? ofolder : rss_folder);
 	if (!key)
 		goto normal;
 	if (!(icon = g_hash_table_lookup(icons, key))) {
@@ -2732,8 +2737,7 @@
             g_mkdir_with_parents (feed_dir, 0755);
         gchar *feed_file = g_strdup_printf("%s/%s.img", feed_dir, key);
         g_free(feed_dir);
-        if (!g_file_test(feed_file, G_FILE_TEST_EXISTS))
-        {
+        if (!g_file_test(feed_file, G_FILE_TEST_EXISTS)) {
 		CamelStream *feed_fs = camel_stream_fs_new_with_name(feed_file,
 			O_RDWR|O_CREAT, 0666);
                 net_get_unblocking(image,
@@ -2744,6 +2748,7 @@
                                 0,
                                 &err);
                 if (err) {
+			g_print("ERR:%s\n", err->message);
                 	g_free(feed_file);
 			return;
 		}



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