[epiphany] ephy-window.c: can't use pspec to figure out if we should sync progress.



commit 2e1e3e4fff9641bfa633f92502f50c2261641048
Author: Xan Lopez <xan gnome org>
Date:   Tue Jun 16 23:20:06 2009 +0300

    ephy-window.c: can't use pspec to figure out if we should sync progress.
    
    Since it breaks syncing when switching between loading tabs. Need to
    do this properly and wait for webkit bug #26409.

 src/ephy-window.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 13121fe..64275a4 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1608,6 +1608,7 @@ sync_tab_load_progress (EphyWebView *view, GParamSpec *pspec, EphyWindow *window
 {
 	gdouble progress;
 	const char *uri;
+	gboolean loading;
 
 	if (window->priv->closing) return;
 
@@ -1623,15 +1624,13 @@ sync_tab_load_progress (EphyWebView *view, GParamSpec *pspec, EphyWindow *window
 	   for about:blank until the load is finished, so assume NULL
 	   here means we are loading about:blank. This might not be
 	   rigt :) */
-	/* When pspec is not NULL it means we are actually loading
-	   something as oppossed to re-syncing the load state with the
-	   current view */
+	loading = ephy_web_view_get_load_status (view);
 	uri = webkit_web_view_get_uri (WEBKIT_WEB_VIEW (view));
-	if (pspec && (!uri || strcmp (uri, "about:blank") == 0))
+	if (loading && (!uri || strcmp (uri, "about:blank") == 0))
 		return;
 
 	progress = webkit_web_view_get_progress (WEBKIT_WEB_VIEW (view));
-	if (progress == 1.0 && pspec)
+	if (progress == 1.0 && loading)
 	{
 		window->priv->clear_progress_timeout_id =
 			g_timeout_add (500,
@@ -1642,7 +1641,7 @@ sync_tab_load_progress (EphyWebView *view, GParamSpec *pspec, EphyWindow *window
 	/* Do not set progress in the entry if the load is already
 	   finished */
 	gtk_entry_set_progress_fraction (GTK_ENTRY (window->priv->entry),
-					 pspec ? progress : 0.0);
+					 loading ? progress : 0.0);
 }
 
 static void



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