[tracker/wip/carlosg/tracker-3.0-api-breaks: 7/79] libtracker-data: Remove traces of journal location in internal API
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/tracker-3.0-api-breaks: 7/79] libtracker-data: Remove traces of journal location in internal API
- Date: Mon, 27 Jan 2020 12:17:51 +0000 (UTC)
commit 52285d9197d84139ed1e12735f2d9bd57c7758fa
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Aug 18 12:27:05 2019 +0200
libtracker-data: Remove traces of journal location in internal API
The journal is not a thing anymore, so it makes little sense to carry
this forward.
src/libtracker-data/tracker-data-manager.c | 15 ++-------------
src/libtracker-data/tracker-data-manager.h | 2 --
src/libtracker-data/tracker-db-manager.c | 16 +++++-----------
src/libtracker-data/tracker-db-manager.h | 6 ++----
src/libtracker-direct/tracker-direct.c | 2 +-
src/tracker/tracker-sql.c | 8 ++------
tests/libtracker-data/tracker-ontology-change-test.c | 4 ++--
tests/libtracker-data/tracker-ontology-test.c | 6 +++---
tests/libtracker-data/tracker-sparql-blank-test.c | 2 +-
tests/libtracker-data/tracker-sparql-test.c | 2 +-
10 files changed, 19 insertions(+), 44 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index e08917e4a..d5a1b0c6d 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -70,7 +70,6 @@ struct _TrackerDataManager {
GFile *ontology_location;
GFile *cache_location;
- GFile *data_location;
guint initialized : 1;
guint restoring_backup : 1;
guint first_time_index : 1;
@@ -3910,16 +3909,9 @@ tracker_data_manager_get_cache_location (TrackerDataManager *manager)
return manager->cache_location ? g_object_ref (manager->cache_location) : NULL;
}
-GFile *
-tracker_data_manager_get_data_location (TrackerDataManager *manager)
-{
- return manager->data_location ? g_object_ref (manager->data_location) : NULL;
-}
-
TrackerDataManager *
tracker_data_manager_new (TrackerDBManagerFlags flags,
GFile *cache_location,
- GFile *data_location,
GFile *ontology_location,
gboolean restoring_backup,
guint select_cache_size,
@@ -3927,7 +3919,7 @@ tracker_data_manager_new (TrackerDBManagerFlags flags,
{
TrackerDataManager *manager;
- if (!cache_location || !data_location || !ontology_location) {
+ if (!cache_location || !ontology_location) {
g_warning ("All data storage and ontology locations must be provided");
return NULL;
}
@@ -3937,7 +3929,6 @@ tracker_data_manager_new (TrackerDBManagerFlags flags,
/* TODO: Make these properties */
g_set_object (&manager->cache_location, cache_location);
g_set_object (&manager->ontology_location, ontology_location);
- g_set_object (&manager->data_location, data_location);
manager->flags = flags;
manager->restoring_backup = restoring_backup;
manager->select_cache_size = select_cache_size;
@@ -4173,8 +4164,7 @@ tracker_data_manager_initable_init (GInitable *initable,
return TRUE;
}
- if (!g_file_is_native (manager->cache_location) ||
- !g_file_is_native (manager->data_location)) {
+ if (!g_file_is_native (manager->cache_location)) {
g_set_error (error,
TRACKER_DATA_ONTOLOGY_ERROR,
TRACKER_DATA_UNSUPPORTED_LOCATION,
@@ -4190,7 +4180,6 @@ tracker_data_manager_initable_init (GInitable *initable,
manager->db_manager = tracker_db_manager_new (manager->flags,
manager->cache_location,
- manager->data_location,
&is_first_time_index,
manager->restoring_backup,
FALSE,
diff --git a/src/libtracker-data/tracker-data-manager.h b/src/libtracker-data/tracker-data-manager.h
index 2e6d0029b..c3dd32d6d 100644
--- a/src/libtracker-data/tracker-data-manager.h
+++ b/src/libtracker-data/tracker-data-manager.h
@@ -61,7 +61,6 @@ GType tracker_data_manager_get_type (void) G_GNUC_CONST;
GQuark tracker_data_ontology_error_quark (void);
TrackerDataManager * tracker_data_manager_new (TrackerDBManagerFlags flags,
GFile *cache_location,
- GFile *data_location,
GFile *ontology_location,
gboolean restoring_backup,
guint select_cache_size,
@@ -70,7 +69,6 @@ TrackerDataManager * tracker_data_manager_new (TrackerDBManagerFlags fl
void tracker_data_manager_shutdown (TrackerDataManager *manager);
GFile * tracker_data_manager_get_cache_location (TrackerDataManager *manager);
-GFile * tracker_data_manager_get_data_location (TrackerDataManager *manager);
TrackerOntologies * tracker_data_manager_get_ontologies (TrackerDataManager *manager);
TrackerDBManager * tracker_data_manager_get_db_manager (TrackerDataManager *manager);
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index 4c03dc152..1390ed02a 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -132,7 +132,6 @@ struct _TrackerDBManager {
gchar *user_data_dir;
gchar *in_use_filename;
GFile *cache_location;
- GFile *data_location;
TrackerDBManagerFlags flags;
guint s_cache_size;
guint u_cache_size;
@@ -427,7 +426,7 @@ tracker_db_manager_locale_changed (TrackerDBManager *db_manager,
* tracker_data_manager_init() has been called, so it can be used
* to check for locale mismatches for initializing the database.
*/
- tracker_db_manager_ensure_locations (db_manager, db_manager->cache_location,
db_manager->data_location);
+ tracker_db_manager_ensure_location (db_manager, db_manager->cache_location);
/* Get current collation locale */
current_locale = tracker_locale_get (TRACKER_LOCALE_COLLATE);
@@ -516,9 +515,8 @@ db_recreate_all (TrackerDBManager *db_manager,
}
void
-tracker_db_manager_ensure_locations (TrackerDBManager *db_manager,
- GFile *cache_location,
- GFile *data_location)
+tracker_db_manager_ensure_location (TrackerDBManager *db_manager,
+ GFile *cache_location)
{
gchar *dir;
@@ -529,8 +527,6 @@ tracker_db_manager_ensure_locations (TrackerDBManager *db_manager,
db_manager->locations_initialized = TRUE;
db_manager->data_dir = g_file_get_path (cache_location);
- db_manager->user_data_dir = g_file_get_path (data_location);
-
db_manager->db = db_base;
dir = g_file_get_path (cache_location);
@@ -570,7 +566,6 @@ perform_recreate (TrackerDBManager *db_manager,
TrackerDBManager *
tracker_db_manager_new (TrackerDBManagerFlags flags,
GFile *cache_location,
- GFile *data_location,
gboolean *first_time,
gboolean restoring_backup,
gboolean shared_cache,
@@ -591,7 +586,7 @@ tracker_db_manager_new (TrackerDBManagerFlags flags,
TrackerDBInterface *resources_iface;
GError *internal_error = NULL;
- if (!cache_location || !data_location) {
+ if (!cache_location) {
g_set_error (error,
TRACKER_DATA_ONTOLOGY_ERROR,
TRACKER_DATA_UNSUPPORTED_LOCATION,
@@ -618,10 +613,9 @@ tracker_db_manager_new (TrackerDBManagerFlags flags,
db_manager->interfaces = g_async_queue_new_full (g_object_unref);
g_set_object (&db_manager->cache_location, cache_location);
- g_set_object (&db_manager->data_location, data_location);
g_weak_ref_init (&db_manager->iface_data, iface_data);
- tracker_db_manager_ensure_locations (db_manager, cache_location, data_location);
+ tracker_db_manager_ensure_location (db_manager, cache_location);
db_manager->in_use_filename = g_build_filename (db_manager->user_data_dir,
IN_USE_FILENAME,
NULL);
diff --git a/src/libtracker-data/tracker-db-manager.h b/src/libtracker-data/tracker-db-manager.h
index 8ec850e7f..388e9267b 100644
--- a/src/libtracker-data/tracker-db-manager.h
+++ b/src/libtracker-data/tracker-db-manager.h
@@ -49,7 +49,6 @@ typedef struct _TrackerDBManager TrackerDBManager;
TrackerDBManager *tracker_db_manager_new (TrackerDBManagerFlags flags,
GFile *cache_location,
- GFile *data_location,
gboolean *first_time,
gboolean restoring_backup,
gboolean shared_cache,
@@ -67,9 +66,8 @@ const gchar * tracker_db_manager_get_file (TrackerDBManager
TrackerDBInterface *tracker_db_manager_get_db_interface (TrackerDBManager *db_manager);
TrackerDBInterface *tracker_db_manager_get_writable_db_interface (TrackerDBManager *db_manager);
-void tracker_db_manager_ensure_locations (TrackerDBManager *db_manager,
- GFile *cache_location,
- GFile *data_location);
+void tracker_db_manager_ensure_location (TrackerDBManager *db_manager,
+ GFile *cache_location);
gboolean tracker_db_manager_has_enough_space (TrackerDBManager *db_manager);
void tracker_db_manager_update_version (TrackerDBManager *db_manager);
diff --git a/src/libtracker-direct/tracker-direct.c b/src/libtracker-direct/tracker-direct.c
index 6eeaf4220..542bfc0a1 100644
--- a/src/libtracker-direct/tracker-direct.c
+++ b/src/libtracker-direct/tracker-direct.c
@@ -236,7 +236,7 @@ tracker_direct_connection_initable_init (GInitable *initable,
}
priv->data_manager = tracker_data_manager_new (db_flags | default_flags, priv->store,
- priv->journal, priv->ontology,
+ priv->ontology,
FALSE, 100, 100);
if (!g_initable_init (G_INITABLE (priv->data_manager), cancellable, error)) {
g_clear_object (&priv->data_manager);
diff --git a/src/tracker/tracker-sql.c b/src/tracker/tracker-sql.c
index 98e35ec04..ec02db114 100644
--- a/src/tracker/tracker-sql.c
+++ b/src/tracker/tracker-sql.c
@@ -95,7 +95,7 @@ sql_by_query (void)
TrackerDBCursor *cursor = NULL;
GError *error = NULL;
gint n_rows = 0;
- GFile *cache_location, *data_location, *ontology_location;
+ GFile *cache_location, *ontology_location;
TrackerDataManager *data_manager;
gchar *dir;
@@ -103,16 +103,12 @@ sql_by_query (void)
cache_location = g_file_new_for_path (dir);
g_free (dir);
- dir = g_build_filename (g_get_user_data_dir (), "tracker", "data", NULL);
- data_location = g_file_new_for_path (dir);
- g_free (dir);
-
dir = g_build_filename (SHAREDIR, "tracker", "ontologies", "nepomuk", NULL);
ontology_location = g_file_new_for_path (dir);
g_free (dir);
data_manager = tracker_data_manager_new (0, cache_location,
- data_location, ontology_location,
+ ontology_location,
FALSE, 100, 100);
if (!g_initable_init (G_INITABLE (data_manager), NULL, &error)) {
diff --git a/tests/libtracker-data/tracker-ontology-change-test.c
b/tests/libtracker-data/tracker-ontology-change-test.c
index 85dc75063..62977c459 100644
--- a/tests/libtracker-data/tracker-ontology-change-test.c
+++ b/tests/libtracker-data/tracker-ontology-change-test.c
@@ -211,7 +211,7 @@ test_ontology_change (void)
g_assert_no_error (error);
g_assert_cmpint (g_chmod (ontology_file, 0666), ==, 0);
- manager = tracker_data_manager_new (0, data_location, data_location, test_schemas,
+ manager = tracker_data_manager_new (0, data_location, test_schemas,
FALSE, 100, 100);
g_initable_init (G_INITABLE (manager), NULL, &error);
g_assert_no_error (error);
@@ -253,7 +253,7 @@ test_ontology_change (void)
g_object_unref (manager);
}
- manager = tracker_data_manager_new (0, data_location, data_location, test_schemas,
+ manager = tracker_data_manager_new (0, data_location, test_schemas,
FALSE, 100, 100);
g_initable_init (G_INITABLE (manager), NULL, &error);
g_assert_no_error (error);
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index 11a0e5eaa..2dd272007 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -185,7 +185,7 @@ test_ontology_init (TestInfo *test_info,
/* first-time initialization */
manager = tracker_data_manager_new (TRACKER_DB_MANAGER_FORCE_REINDEX,
- data_location, data_location, data_location,
+ data_location, data_location,
FALSE, 100, 100);
g_initable_init (G_INITABLE (manager), NULL, &error);
g_assert_no_error (error);
@@ -193,7 +193,7 @@ test_ontology_init (TestInfo *test_info,
g_object_unref (manager);
/* initialization from existing database */
- manager = tracker_data_manager_new (0, data_location, data_location, data_location,
+ manager = tracker_data_manager_new (0, data_location, data_location,
FALSE, 100, 100);
g_initable_init (G_INITABLE (manager), NULL, &error);
g_assert_no_error (error);
@@ -228,7 +228,7 @@ test_query (TestInfo *test_info,
/* initialization */
manager = tracker_data_manager_new (TRACKER_DB_MANAGER_FORCE_REINDEX,
- data_location, data_location, ontology_location,
+ data_location, ontology_location,
FALSE, 100, 100);
g_initable_init (G_INITABLE (manager), NULL, &error);
g_assert_no_error (error);
diff --git a/tests/libtracker-data/tracker-sparql-blank-test.c
b/tests/libtracker-data/tracker-sparql-blank-test.c
index 96f798b8c..85e97b1a5 100644
--- a/tests/libtracker-data/tracker-sparql-blank-test.c
+++ b/tests/libtracker-data/tracker-sparql-blank-test.c
@@ -54,7 +54,7 @@ test_blank (TestInfo *info,
/* initialization */
manager = tracker_data_manager_new (TRACKER_DB_MANAGER_FORCE_REINDEX,
- data_location, data_location, data_location, /* loc, domain and
ontology_name */
+ data_location, data_location, /* loc, domain and ontology_name */
FALSE, 100, 100);
g_initable_init (G_INITABLE (manager), NULL, &error);
g_assert_no_error (error);
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 0e3f57fb7..9d431785f 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -377,7 +377,7 @@ test_sparql_query (TestInfo *test_info,
data_location = g_file_new_for_path (test_info->data_location);
manager = tracker_data_manager_new (TRACKER_DB_MANAGER_FORCE_REINDEX,
- data_location, data_location, test_schemas, /* loc, domain and
ontology_name */
+ data_location, test_schemas, /* loc, domain and ontology_name */
FALSE, 100, 100);
g_initable_init (G_INITABLE (manager), NULL, &error);
g_assert_no_error (error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]