[epiphany/gnome-3-10] ephy-history-service: do not open a transaction in read-only mode
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-3-10] ephy-history-service: do not open a transaction in read-only mode
- Date: Wed, 24 Sep 2014 01:25:11 +0000 (UTC)
commit 9cefed4e11cd6ca9014b9fb8db5fe00e97228ac5
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 7ae37e3..7c467fa 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]