[evolution-rss] initial migration to xdg basedir



commit a764dfffd56b011e99e64e3499b2b750ca0538cf
Author: Lucian Langa <lucilanga gnome org>
Date:   Mon Aug 2 22:15:10 2010 +0300

    initial migration to xdg basedir

 src/parser.c    |    8 ++------
 src/rss-cache.c |    9 ++++-----
 src/rss-image.c |   10 ++++------
 src/rss.c       |    6 +++---
 4 files changed, 13 insertions(+), 20 deletions(-)
---
diff --git a/src/parser.c b/src/parser.c
index 9368c74..57de9e2 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -31,6 +31,7 @@
 #else
 #include <camel/camel-url.h>
 #endif
+#include <libedataserver/e-data-server-util.h>
 
 extern int rss_verbose_debug;
 
@@ -57,7 +58,6 @@ rss_html_url_decode(const char *html, int len)
 	xmlDoc *src = NULL;
 	xmlDoc *doc = NULL;
 	gchar *url, *tmpurl;
-	gchar *base_dir = rss_component_peek_base_directory();
 	gchar *feed_dir;
 
 	src = (xmlDoc *)parse_html_sux(html, len);
@@ -68,11 +68,7 @@ rss_html_url_decode(const char *html, int len)
 	doc = src;
 
 	feed_dir = g_build_path(G_DIR_SEPARATOR_S,
-		base_dir,
-		"static",
-		"http",
-		NULL);
-	g_free(base_dir);
+		e_get_user_cache_dir(), "rss", NULL);
 
 	while ((doc = (xmlDoc *)html_find((xmlNode *)doc, (gchar *)"img"))) {
 		if ((url = (gchar *)xmlGetProp((xmlNodePtr)doc, (xmlChar *)"src"))) {
diff --git a/src/rss-cache.c b/src/rss-cache.c
index 28a0796..eece50a 100644
--- a/src/rss-cache.c
+++ b/src/rss-cache.c
@@ -23,6 +23,7 @@
 #include <camel/camel-data-cache.h>
 #include <camel/camel-file-utils.h>
 #endif
+#include <libedataserver/e-data-server-util.h>
 
 #include "rss.h"
 #include "rss-cache.h"
@@ -38,14 +39,12 @@ void
 rss_cache_init(void)
 {
 	//CamelDataCache *cache = NULL;
-	gchar *base_dir, *feed_dir;
+	gchar *feed_dir;
 
-	base_dir = rss_component_peek_base_directory();
 	feed_dir = g_build_path(G_DIR_SEPARATOR_S,
-			base_dir,
-			"static",
+			e_get_user_cache_dir(),
+			"rss",
 			NULL);
-	g_free(base_dir);
 	if (!g_file_test(feed_dir, G_FILE_TEST_EXISTS))
 		g_mkdir_with_parents (feed_dir, 0755);
 #if EVOLUTION_VERSION >= 23100
diff --git a/src/rss-image.c b/src/rss-image.c
index e5768a3..3ed78d7 100644
--- a/src/rss-image.c
+++ b/src/rss-image.c
@@ -18,6 +18,7 @@
 
 #include <glib.h>
 #include <camel/camel.h>
+#include <libedataserver/e-data-server-util.h>
 #include <mail/em-folder-tree.h>
 #include <mail/em-format-html.h>
 #include <sys/time.h>
@@ -511,7 +512,7 @@ gchar *
 verify_image(gchar *uri, EMFormatHTML *format)
 {
 	gchar *nurl, *turl;
-	gchar *base_dir, *feed_dir, *name;
+	gchar *feed_dir, *name;
 	gchar *scheme, *tname;
 	gchar *result = NULL;
 	gchar *duri = NULL;
@@ -529,11 +530,9 @@ verify_image(gchar *uri, EMFormatHTML *format)
 			camel_url_decode((gchar *)uri);
 			//FIXME lame method of extracting data cache path
 			//there must be a function in camel for getting data cache path
-			base_dir = rss_component_peek_base_directory();
 			feed_dir = g_build_path(G_DIR_SEPARATOR_S,
-				base_dir,
-				"static",
-				"http",
+				e_get_user_cache_dir(),
+				"rss",
 				NULL);
 			scheme = g_uri_parse_scheme(uri);
 			/* calling fetch_image_redraw with link NULL
@@ -553,7 +552,6 @@ verify_image(gchar *uri, EMFormatHTML *format)
 				name = fetch_image_redraw(uri, NULL, format);
 				g_free(scheme);
 			}
-			g_free(base_dir);
 			if (name) {
 				tname = decode_image_cache_filename(name);
 				g_free(name);
diff --git a/src/rss.c b/src/rss.c
index 3028407..a9678f4 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -4171,12 +4171,12 @@ store_folder_deleted(CamelObject *o, void *event_data, void *data)
 
 #if (DATASERVER_VERSION < 2031001)
 typedef struct {
-       gchar *old_base;
-       CamelFolderInfo *new;
+	gchar *old_base;
+	CamelFolderInfo *new;
 } RenameInfo;
 #endif
 
- static void
+static void
 #if (DATASERVER_VERSION < 2031001)
 store_folder_renamed(CamelObject *o, void *event_data, void *data)
 #else



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