[tracker-miners/sam/tracker-3.0-functional-tests: 1/7] miners/fs: Honour ontology path specified by the domain rule



commit bc40bf1ec4ca306267eb7dacde6dfe57e2200095
Author: Sam Thursfield <sam afuera me uk>
Date:   Tue Feb 18 00:11:14 2020 +0100

    miners/fs: Honour ontology path specified by the domain rule
    
    This also allows us to remove the TRACKER_DB_ONTOLOGIES_DIR override
    that was used by the functional tests. The tests can now create a
    domain rule that specifies the ontology location.

 .../tracker-domain-ontology.c                       | 21 ++++++++-------------
 src/miners/fs/tracker-main.c                        |  4 +++-
 2 files changed, 11 insertions(+), 14 deletions(-)
---
diff --git a/src/libtracker-miners-common/tracker-domain-ontology.c 
b/src/libtracker-miners-common/tracker-domain-ontology.c
index 509149a18..3ad1deb01 100644
--- a/src/libtracker-miners-common/tracker-domain-ontology.c
+++ b/src/libtracker-miners-common/tracker-domain-ontology.c
@@ -316,21 +316,16 @@ tracker_domain_ontology_new (const gchar   *domain_name,
        if (!domain_ontology->ontology_location) {
                gchar *ontology_path;
 
-               if (g_getenv ("TRACKER_DB_ONTOLOGIES_DIR") != NULL) {
-                       /* Override for use only by testcases */
-                       domain_ontology->ontology_location = g_file_new_for_path (g_getenv 
("TRACKER_DB_ONTOLOGIES_DIR"));
-               } else {
-                       ontology_path = g_build_filename (SHAREDIR, "tracker", "ontologies",
-                                                         domain_ontology->ontology_name, NULL);
-
-                       if (!g_file_test (ontology_path, G_FILE_TEST_IS_DIR)) {
-                               g_error ("Unable to find ontologies in the configured location %s", 
ontology_path);
-                       }
-
-                       domain_ontology->ontology_location = g_file_new_for_path (ontology_path);
+               ontology_path = g_build_filename (SHAREDIR, "tracker", "ontologies",
+                                                 domain_ontology->ontology_name, NULL);
 
-                       g_free (ontology_path);
+               if (!g_file_test (ontology_path, G_FILE_TEST_IS_DIR)) {
+                       g_error ("Unable to find ontologies in the configured location %s", ontology_path);
                }
+
+               domain_ontology->ontology_location = g_file_new_for_path (ontology_path);
+
+               g_free (ontology_path);
        }
 
 end:
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index 35ad6cf0e..285f71346 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -789,11 +789,13 @@ setup_connection_and_endpoint (TrackerDomainOntology    *domain,
                                GError                  **error)
 {
        GFile *store;
+       GFile *ontology;
 
        store = tracker_domain_ontology_get_cache (domain);
+       ontology = tracker_domain_ontology_get_ontology (domain);
        *sparql_conn = tracker_sparql_connection_new (get_fts_connection_flags (),
                                                      store,
-                                                     NULL,
+                                                     ontology,
                                                      NULL,
                                                      error);
        if (!*sparql_conn)


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