[tracker] libtracker-data: Remove get_wal_interface() function
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Remove get_wal_interface() function
- Date: Tue, 2 Oct 2018 23:05:07 +0000 (UTC)
commit ac722f3807edb98a5e7d8c7d9b6875ab55f854f9
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Sep 30 11:16:16 2018 +0200
libtracker-data: Remove get_wal_interface() function
There is no longer need to expose the interface used for deferred WAL
checkpoints, just don't expose this internal API.
src/libtracker-data/libtracker-data.vapi | 1 -
src/libtracker-data/tracker-data-manager.c | 6 ------
src/libtracker-data/tracker-data-manager.h | 1 -
src/libtracker-data/tracker-db-manager.c | 19 ++++++-------------
src/libtracker-data/tracker-db-manager.h | 1 -
5 files changed, 6 insertions(+), 22 deletions(-)
---
diff --git a/src/libtracker-data/libtracker-data.vapi b/src/libtracker-data/libtracker-data.vapi
index f0300ae73..be1bcf118 100644
--- a/src/libtracker-data/libtracker-data.vapi
+++ b/src/libtracker-data/libtracker-data.vapi
@@ -229,7 +229,6 @@ namespace Tracker {
public unowned Ontologies get_ontologies ();
public unowned DBInterface get_db_interface ();
public unowned DBInterface get_writable_db_interface ();
- public unowned DBInterface get_wal_db_interface ();
public unowned Data.Update get_data ();
public void shutdown ();
public GLib.HashTable<string,string> get_namespaces ();
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index a752fcd55..4fab66824 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -5044,12 +5044,6 @@ tracker_data_manager_get_writable_db_interface (TrackerDataManager *manager)
return tracker_db_manager_get_writable_db_interface (manager->db_manager);
}
-TrackerDBInterface *
-tracker_data_manager_get_wal_db_interface (TrackerDataManager *manager)
-{
- return tracker_db_manager_get_wal_db_interface (manager->db_manager);
-}
-
TrackerData *
tracker_data_manager_get_data (TrackerDataManager *manager)
{
diff --git a/src/libtracker-data/tracker-data-manager.h b/src/libtracker-data/tracker-data-manager.h
index cc9aa3b60..5c6fb0e05 100644
--- a/src/libtracker-data/tracker-data-manager.h
+++ b/src/libtracker-data/tracker-data-manager.h
@@ -80,7 +80,6 @@ TrackerOntologies * tracker_data_manager_get_ontologies (TrackerDataManage
TrackerDBManager * tracker_data_manager_get_db_manager (TrackerDataManager *manager);
TrackerDBInterface * tracker_data_manager_get_db_interface (TrackerDataManager *manager);
TrackerDBInterface * tracker_data_manager_get_writable_db_interface (TrackerDataManager *manager);
-TrackerDBInterface * tracker_data_manager_get_wal_db_interface (TrackerDataManager *manager);
TrackerData * tracker_data_manager_get_data (TrackerDataManager *manager);
gboolean tracker_data_manager_init_fts (TrackerDBInterface *interface,
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index e40273ff3..d08cd4b0b 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -154,6 +154,8 @@ static TrackerDBInterface *tracker_db_manager_create_db_interface (TrackerDBMa
GError **error);
static void db_remove_locale_file (TrackerDBManager *db_manager);
+static TrackerDBInterface * init_writable_db_interface (TrackerDBManager *db_manager);
+
static gboolean
db_exec_no_reply (TrackerDBInterface *iface,
const gchar *query,
@@ -1118,9 +1120,11 @@ static gpointer
wal_checkpoint_thread (gpointer data)
{
TrackerDBManager *db_manager = data;
- TrackerDBInterface *wal_iface = tracker_db_manager_get_wal_db_interface (db_manager);
- wal_checkpoint (wal_iface, FALSE);
+ if (!db_manager->db.wal_iface)
+ db_manager->db.wal_iface = init_writable_db_interface (db_manager);
+
+ wal_checkpoint (db_manager->db.wal_iface, FALSE);
return NULL;
}
@@ -1182,17 +1186,6 @@ tracker_db_manager_get_writable_db_interface (TrackerDBManager *db_manager)
return db_manager->db.iface;
}
-TrackerDBInterface *
-tracker_db_manager_get_wal_db_interface (TrackerDBManager *db_manager)
-{
- if (db_manager->db.wal_iface == NULL &&
- (db_manager->flags & TRACKER_DB_MANAGER_READONLY) == 0) {
- db_manager->db.wal_iface = init_writable_db_interface (db_manager);
- }
-
- return db_manager->db.wal_iface;
-}
-
/**
* tracker_db_manager_has_enough_space:
*
diff --git a/src/libtracker-data/tracker-db-manager.h b/src/libtracker-data/tracker-db-manager.h
index a41b2ff53..18fe4b711 100644
--- a/src/libtracker-data/tracker-db-manager.h
+++ b/src/libtracker-data/tracker-db-manager.h
@@ -62,7 +62,6 @@ void tracker_db_manager_optimize (TrackerDBManager
const gchar * tracker_db_manager_get_file (TrackerDBManager *db_manager);
TrackerDBInterface *tracker_db_manager_get_db_interface (TrackerDBManager *db_manager);
TrackerDBInterface *tracker_db_manager_get_writable_db_interface (TrackerDBManager *db_manager);
-TrackerDBInterface *tracker_db_manager_get_wal_db_interface (TrackerDBManager *db_manager);
void tracker_db_manager_ensure_locations (TrackerDBManager *db_manager,
GFile *cache_location,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]