[epiphany/gnome-3-12] ephy-history-service: do not open a transaction in read-only mode



commit 2dfcf89c4165f1b324f43c249ade804a9b2e8cd0
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Wed Sep 10 21:04:43 2014 -0500

    ephy-history-service: do not open a transaction in read-only mode
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735912

 lib/history/ephy-history-service.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c
index 675b2ac..d0765f7 100644
--- a/lib/history/ephy-history-service.c
+++ b/lib/history/ephy-history-service.c
@@ -415,6 +415,9 @@ ephy_history_service_open_database_connections (EphyHistoryService *self)
 
   ephy_history_service_enable_foreign_keys (self);
 
+  if (priv->read_only)
+    return TRUE;
+
   ephy_sqlite_connection_begin_transaction (priv->history_database, &error);
   if (error) {
     g_error ("Could not begin long running transaction in history database: %s", error->message);
@@ -422,10 +425,9 @@ ephy_history_service_open_database_connections (EphyHistoryService *self)
     return FALSE;
   }
 
-  if (!priv->read_only &&
-      ((ephy_history_service_initialize_hosts_table (self) == FALSE) ||
-       (ephy_history_service_initialize_urls_table (self) == FALSE) ||
-       (ephy_history_service_initialize_visits_table (self) == FALSE)))
+  if (ephy_history_service_initialize_hosts_table (self) == FALSE ||
+      ephy_history_service_initialize_urls_table (self) == FALSE ||
+      ephy_history_service_initialize_visits_table (self) == FALSE)
     return FALSE;
 
   return TRUE;


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