[evolution-rss] dont popup authentication when fetching feeds automatically



commit 7053d0c2839bd9c91650c99157abdebaad75d2a2
Author: Lucian Langa <lucilanga gnome org>
Date:   Mon Jul 6 23:45:42 2009 +0300

    dont popup authentication when fetching feeds automatically

 TODO                     |    4 +++-
 src/network-soup.c       |    5 ++++-
 src/rss-config-factory.c |    3 ++-
 src/rss.c                |   17 ++++++++++++-----
 src/rss.h                |    1 +
 5 files changed, 22 insertions(+), 8 deletions(-)
---
diff --git a/TODO b/TODO
index 3e12884..ee421de 100644
--- a/TODO
+++ b/TODO
@@ -38,6 +38,8 @@
 	* gtkhtml does not handle &#xD; construct
 	* switch webkit -> gecko leads to crash on pfree()
 	* show feed icons in send & receive dialog
-	* favicon is not displayed after it is fetched
+	* favicon is not displayed rght after it is fetched
 	* cancel fetching comments when summary display is changed
 	* detect duplicate items by content not by feedid
+	* make gtkhtml rendering non-bloking
+ 	* check webkit user agent
diff --git a/src/network-soup.c b/src/network-soup.c
index b7d5c46..6ddca9a 100644
--- a/src/network-soup.c
+++ b/src/network-soup.c
@@ -382,7 +382,10 @@ authenticate (SoupSession *session,
 		//means we're already tested once and probably
 		//won't try again
 		rf->soup_auth_retry = FALSE;
-		if (!read_up(data)) {
+		//we test for autofetching in progresss because it seems
+		//preety annoying to pop the authentication popup in front
+		//of the user every time feeds are automatically fetched
+		if (!read_up(data) && !rf->autoupdate) {
 			//we will continue after user has made a decision on 
 			//web auth dialog
 			soup_session_pause_message(session, msg);
diff --git a/src/rss-config-factory.c b/src/rss-config-factory.c
index eee2327..8b3143e 100644
--- a/src/rss-config-factory.c
+++ b/src/rss-config-factory.c
@@ -1272,7 +1272,7 @@ import_opml(gchar *file)
 	}
 	while ((src = iterate_import_file(src, &url, &name, type))) {
                 if (url && strlen(url)) {
-		g_print("url:%s\n", url);
+			d(g_print("url:%s\n", url));
                         if (rf->cancel) {
                                 if (src) xmlFree(src);
                                 rf->cancel = 0;
@@ -1299,6 +1299,7 @@ import_opml(gchar *file)
                                 gtk_main_iteration ();
 			store_redraw(GTK_TREE_VIEW(rf->treeview));
                         save_gconf_feed();
+		}
         }
         while (gtk_events_pending ())
                 gtk_main_iteration ();
diff --git a/src/rss.c b/src/rss.c
index d6fa1eb..56becaf 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -2709,6 +2709,7 @@ generic_finish_feed(rfMessage *msg, gpointer user_data)
 	if (rf->feed_queue == 0) {
 		d(g_print("taskbar_op_finish()\n"));
 		taskbar_op_finish("main");
+		rf->autoupdate = FALSE;
 		farticle=0;
 		ftotal=0;
 #ifndef EVOLUTION_2_12
@@ -2916,10 +2917,12 @@ fetch_one_feed(gpointer key, gpointer value, gpointer user_data)
                         rss_error(key, NULL, _("Error fetching feed."), msg);
                      	g_free(msg);
 		}
-		return 1;	
-	} else if (rf->cancel && !rf->feed_queue)
-		rf->cancel = 0;		//all feeds where either procesed or skipped
-	return 0;
+		return TRUE;	
+	} else if (rf->cancel && !rf->feed_queue) {
+		rf->cancel = 0;		//all feeds were either procesed or skipped
+		rf->autoupdate = FALSE;
+	}
+	return FALSE;
 }
 
 gboolean
@@ -3060,6 +3063,7 @@ update_articles(gboolean disabler)
 
 	if (!rf->pending && !rf->feed_queue && !rf->cancel_all && rf->online) {
 		g_print("Reading RSS articles...\n");
+		rf->autoupdate = TRUE;
 		rf->pending = TRUE;
 		check_folders();
 		rf->err = NULL;
@@ -3560,6 +3564,7 @@ custom_update_articles(CDATA *cdata)
 		g_print("Fetch (custom) RSS articles...\n");
 		check_folders();
 		rf->err = NULL;
+		rf->autoupdate = TRUE;
 		//taskbar_op_message();
 		network_timeout();
         	// check if we're enabled and no cancelation signal pending
@@ -3585,8 +3590,10 @@ custom_update_articles(CDATA *cdata)
                      		g_free(msg);
 			}
                                                                // feed gets deleted
-		} else if (rf->cancel && !rf->feed_queue)
+		} else if (rf->cancel && !rf->feed_queue) {
                 	rf->cancel = 0;         //all feeds where either procesed or skipped
+			rf->autoupdate = FALSE;
+		}
 	}
 	return TRUE;
 }
diff --git a/src/rss.h b/src/rss.h
index 0387f79..5f68f0c 100644
--- a/src/rss.h
+++ b/src/rss.h
@@ -132,6 +132,7 @@ typedef struct _rssfeed {
         gboolean        setup;
         gboolean        pending;
         gboolean        import;			//import going on
+	gboolean 	autoupdate;		//feed is currently auto fetched
 	guint		feed_queue;
         gboolean        cancel; 		//cancelation signal
         gboolean        cancel_all; 		//cancelation signal



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