[evolution-rss] correctly process sqlite jar



commit e714990eb105e67b353b5419e9b9887c163a2849
Author: Lucian Langa <lucilanga gnome org>
Date:   Sat May 30 23:46:09 2009 +0300

    correctly process sqlite jar
---
 src/network-soup.c |   13 +++++++++++--
 src/rss.c          |   22 +++++++++-------------
 2 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/src/network-soup.c b/src/network-soup.c
index 619bb0e..3566b62 100644
--- a/src/network-soup.c
+++ b/src/network-soup.c
@@ -511,6 +511,7 @@ net_get_unblocking(gchar *url,
 	if (rss_soup_jar) {
 		soup_session_add_feature(soup_sess, SOUP_SESSION_FEATURE(rss_soup_jar));
 	}
+
 	proxify_session(proxy, soup_sess, url);
 	if (cb && data) {
 		info = g_new0(CallbackInfo, 1);
@@ -713,7 +714,15 @@ abort_all_soup(void)
 void
 rss_soup_init(void)
 {
-#if LIBSOUP_VERSION < 2026002
-	rss_soup_jar = soup_cookie_jar_sqlite_new ("/home/cooly/.evolution/mail/rss/rss-cookies.sqlite", FALSE);
+#if LIBSOUP_VERSION > 2026002
+	gchar *feed_dir = rss_component_peek_base_directory(mail_component_peek());
+	gchar *cookie_path = g_build_path("/", feed_dir, "rss-cookies.sqlite", NULL);
+	gchar *moz_cookie_path = g_build_path("/", feed_dir, "mozembed-rss", "cookies.sqlite", NULL);
+	if (!g_file_test(moz_cookie_path, G_FILE_TEST_EXISTS|G_FILE_TEST_IS_SYMLINK))
+		symlink(cookie_path, moz_cookie_path);
+           
+	rss_soup_jar = 
+		soup_cookie_jar_sqlite_new (cookie_path, FALSE);
+	g_free(cookie_path);
 #endif
 }
diff --git a/src/rss.c b/src/rss.c
index 86a09d3..f797a97 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -1312,8 +1312,7 @@ mycall (GtkWidget *widget, GtkAllocation *event, gpointer data)
   	struct _org_gnome_rss_controls_pobject *po = data;
 
 	guint k = rf->headers_mode ? 240 : 106;
-	if (GTK_IS_WIDGET(widget))
-	{
+	if (GTK_IS_WIDGET(widget)) {
         	width = widget->allocation.width - 16 - 2;// - 16;
         	int height = widget->allocation.height - 16 - k;
 		d(g_print("resize webkit :width:%d, height: %d\n", width, height));
@@ -1328,8 +1327,7 @@ mycall (GtkWidget *widget, GtkAllocation *event, gpointer data)
 //        
 	guint engine = fallback_engine();
 		if (po->mozembedwindow && rf->mozembed)
-			if(GTK_IS_WIDGET(po->mozembedwindow) && height > 0)
-			{
+			if(GTK_IS_WIDGET(po->mozembedwindow) && height > 0) {
 				if (!browser_fetching) {
 					browser_write("Formatting...", 13, "file:///");
 					browser_fetching=1;
@@ -2788,8 +2786,8 @@ finish_website (SoupSession *soup_sess, SoupMessage *msg, gpointer user_data)
 	g_print("browser fill:%d%%\n", (int)((browser_fill*100)/response->len));
 	gchar *str = (response->str);
 	gint len = strlen(response->str);
-	*str+=browser_fill;
-	len-=browser_fill;
+	*str+= browser_fill;
+	 len-= browser_fill;
 	g_print("len:%d\n", len);
 	if (len>0) {
 		browser_write(str, len, user_data);
@@ -3953,16 +3951,16 @@ fallback_engine(void)
 #ifdef HAVE_RENDERKIT
         guint engine = gconf_client_get_int(rss_gconf, GCONF_KEY_HTML_RENDER, NULL);
 #if !defined(HAVE_GECKO) && !defined (HAVE_WEBKIT)
-        engine=0;
+        engine = 0;
 #endif
 if (engine == 2) {
 #if !defined(HAVE_GECKO)
-        engine=1;
+        engine = 1;
 #endif
 }
 if (engine == 1) {
 #if !defined (HAVE_WEBKIT)
-        engine=2;
+        engine = 2;
 #endif
 }
 	return engine;
@@ -3986,8 +3984,7 @@ e_plugin_lib_enable(EPluginLib *ep, int enable)
                 	rss_verbose_debug = atoi(d);
 
 		//initiate main rss structure
-		if (!rf)
-		{
+		if (!rf) {
 			printf("RSS Plugin enabled (evolution %s, evolution-rss %s)\n",
 				EVOLUTION_VERSION_STRING,
 				VERSION);
@@ -4023,8 +4020,7 @@ e_plugin_lib_enable(EPluginLib *ep, int enable)
 						GCONF_KEY_HTML_RENDER, 
 						NULL));
 		
-			if (!render) 	// set render just in case it was forced in configure
-			{
+			if (!render) {	// set render just in case it was forced in configure
 				render = RENDER_N;
   				gconf_client_set_int(rss_gconf, 
 						GCONF_KEY_HTML_RENDER, render, NULL);



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