diff options
author | Sam Thursfield <sam@afuera.me.uk> | 2020-03-11 01:08:40 +0100 |
---|---|---|
committer | Sam Thursfield <sam@afuera.me.uk> | 2020-04-04 15:43:13 +0200 |
commit | a0efd1972b122d0a2a867946a068429af5e5228e (patch) | |
tree | 141f6e0533a1243b0c4ffdde56b47c4f95605163 /examples | |
parent | bbd72ad615ef3f5c1b603f350ce66bca78adbd22 (diff) | |
download | tracker-a0efd1972b122d0a2a867946a068429af5e5228e.tar.gz |
Allow 'open with existing ontology', disable automatic re-indexing
When the CLI tools open an existing database, the user shouldn't need
to specify which ontology to use as the database was already configured
with an ontology. These tools can now pass %NULL to the @ontology
argument of tracker_sparql_connection_new() to mean "use the existing
ontologies".
Previously %NULL meant "use the Nepomuk" ontologies. This is now
achieved by passing the result of tracker_sparql_get_ontology_nepomuk()
for the @ontology parameter.
As part of this, I removed the "automatic reindexing" feature of
libtracker-data. This feature would delete the database if it
detected corruption or a version mismatch, however, that only makes
sense for tracker-miner-fs where the data can be recreated from the
filesystem. For other usecases this feature is dangerous and should
not be happening implicitly -- we now just raise an error in cases of
corruption or version mismatches.
Closes https://gitlab.gnome.org/GNOME/tracker/issues/192
Diffstat (limited to 'examples')
-rw-r--r-- | examples/libtracker-sparql/async-connection.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/libtracker-sparql/async-connection.c b/examples/libtracker-sparql/async-connection.c index 6d44cf607..40ae55a34 100644 --- a/examples/libtracker-sparql/async-connection.c +++ b/examples/libtracker-sparql/async-connection.c @@ -137,7 +137,7 @@ connection_cb (GObject *object, gint main (gint argc, gchar *argv[]) { - GFile *store; + g_autoptr(GFile) store, ontology; MyData *md; if (argc > 1) { @@ -152,9 +152,10 @@ main (gint argc, gchar *argv[]) md->timer = g_timer_new (); md->cancellable = g_cancellable_new (); + ontology = tracker_sparql_get_ontology_nepomuk (); tracker_sparql_connection_new_async (0, store, - NULL, + ontology, md->cancellable, connection_cb, md); |