[epiphany] ephy-session.c: save session more often to avoid data loss



commit e92add696ac0e460fc4e520a1201cfb38a67d6fb
Author: Julian de Navascues <julian navascues gmail com>
Date:   Wed Aug 26 17:46:13 2009 +0300

    ephy-session.c: save session more often to avoid data loss
    
    Session was being saved only when the web was fully loaded
    (WEBKIT_LOAD_FINISHED status reached), so there was no info (URLs) to
    restore webs that were loading when crashed.
    
    Bug #593149
    
    Signed-off-by: Xan Lopez <xan gnome org>

 src/ephy-session.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index e4c1587..5774354 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -380,7 +380,13 @@ load_status_notify_cb (EphyWebView *view,
 		       GParamSpec *pspec,
 		       EphySession *session)
 {
-	if (ephy_web_view_is_loading (view) == FALSE)
+	WebKitLoadStatus status = webkit_web_view_get_load_status (WEBKIT_WEB_VIEW (view));
+
+	/* We won't know the URL we are loading in PROVISIONAL because
+	   of bug #593149, but save session anyway */
+	if (status == WEBKIT_LOAD_PROVISIONAL ||
+	    status == WEBKIT_LOAD_COMMITTED || 
+	    status == WEBKIT_LOAD_FINISHED)
 		ephy_session_save (session, SESSION_CRASHED);
 }
 



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