tracker/tracker-libtracker-fixes.patch

1345 lines
50 KiB
Diff

From dd44a06919d4f1a55a1da1c05c7f23691d0c62ba Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 31 Aug 2017 22:38:27 +0200
Subject: libtracker-data: Fix compiler warnings
Several unused variables.
---
src/libtracker-data/tracker-collation.c | 3 +--
src/libtracker-data/tracker-data-backup.c | 1 -
src/libtracker-data/tracker-data-manager.c | 6 +-----
src/libtracker-data/tracker-data-update.c | 2 --
src/libtracker-data/tracker-db-manager.c | 6 ------
5 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/src/libtracker-data/tracker-collation.c b/src/libtracker-data/tracker-collation.c
index 8bd3e6d..2a48ab2 100644
--- a/src/libtracker-data/tracker-collation.c
+++ b/src/libtracker-data/tracker-collation.c
@@ -245,7 +245,6 @@ static gboolean
skip_non_alphanumeric (const gchar **str,
gint *len)
{
- GUnicodeBreakType break_type;
const gchar *remaining = *str, *end = &remaining[*len];
gboolean found = FALSE, is_alnum;
gunichar unichar;
@@ -336,7 +335,7 @@ tracker_collation_utf8_title (gpointer collator,
title_beginnings = g_strsplit (_(title_beginnings_str), "|", -1);
for (i = 0; title_beginnings[i]; i++) {
- gchar *prefix, *str;
+ gchar *prefix;
gint prefix_len;
prefix = g_utf8_casefold (title_beginnings[i], -1);
diff --git a/src/libtracker-data/tracker-data-backup.c b/src/libtracker-data/tracker-data-backup.c
index 28fd13b..b68ab40 100644
--- a/src/libtracker-data/tracker-data-backup.c
+++ b/src/libtracker-data/tracker-data-backup.c
@@ -422,7 +422,6 @@ tracker_data_backup_save (TrackerDataManager *data_manager,
gchar *path, *directory;
GError *local_error = NULL;
GDir *journal_dir;
- GFile *parent;
GPid pid;
GPtrArray *files;
const gchar *f_name;
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index bfd4727..8563303 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -639,8 +639,6 @@ tracker_data_ontology_load_statement (TrackerDataManager *manager,
GPtrArray *seen_properties,
GError **error)
{
- TrackerOntologies *ontologies = manager->ontologies;
-
if (g_strcmp0 (predicate, RDF_TYPE) == 0) {
if (g_strcmp0 (object, RDFS_CLASS) == 0) {
TrackerClass *class;
@@ -3024,7 +3022,6 @@ create_decomposed_metadata_tables (TrackerDataManager *manager,
GString *create_sql = NULL;
GString *in_col_sql = NULL;
GString *sel_col_sql = NULL;
- GString *trigger_sql = NULL;
TrackerProperty **properties, *property, **domain_indexes;
GSList *class_properties = NULL, *field_it;
gboolean main_class;
@@ -4008,7 +4005,7 @@ tracker_data_manager_initable_init (GInitable *initable,
{
TrackerDataManager *manager = TRACKER_DATA_MANAGER (initable);
TrackerDBInterface *iface;
- gboolean is_first_time_index, check_ontology, has_graph_table;
+ gboolean is_first_time_index, check_ontology, has_graph_table = FALSE;
TrackerDBCursor *cursor;
TrackerDBStatement *stmt;
GHashTable *ontos_table;
@@ -4294,7 +4291,6 @@ tracker_data_manager_initable_init (GInitable *initable,
if (check_ontology) {
GList *to_reload = NULL;
GList *ontos = NULL;
- guint p;
GPtrArray *seen_classes;
GPtrArray *seen_properties;
GError *n_error = NULL;
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 641724a..4df4de4 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -338,7 +338,6 @@ tracker_data_remove_delete_statement_callback (TrackerData *data,
{
TrackerStatementDelegate *delegate;
guint i;
- gboolean found = FALSE;
if (!data->delete_callbacks) {
return;
@@ -753,7 +752,6 @@ ensure_graph_id (TrackerData *data,
TrackerDBInterface *iface;
TrackerDBStatement *stmt;
GError *error = NULL;
- gboolean resource_create;
gint id;
id = GPOINTER_TO_INT (g_hash_table_lookup (data->update_buffer.resource_cache, uri));
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index bb5c37f..aff39bf 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -479,7 +479,6 @@ static void
db_recreate_all (TrackerDBManager *db_manager,
GError **error)
{
- guint i;
gchar *locale;
GError *internal_error = NULL;
@@ -539,7 +538,6 @@ perform_recreate (TrackerDBManager *db_manager,
GError **error)
{
GError *internal_error = NULL;
- guint i;
if (first_time) {
*first_time = TRUE;
@@ -580,7 +578,6 @@ tracker_db_manager_new (TrackerDBManagerFlags flags,
TrackerDBManager *db_manager;
TrackerDBVersion version;
gboolean need_reindex;
- guint i;
int in_use_file;
gboolean loaded = FALSE;
TrackerDBInterface *resources_iface;
@@ -1049,10 +1046,7 @@ tracker_db_manager_get_db_interface (TrackerDBManager *db_manager)
}
if (!interface) {
- TrackerDBManagerFlags flags;
-
/* Create a new one to satisfy the request */
- flags = tracker_db_manager_get_flags (db_manager, NULL, NULL);
interface = tracker_db_manager_create_db_interface (db_manager,
TRUE, &internal_error);
--
cgit v0.12
From 097354737f1427f23ef6f52956b26ee76ac89a3c Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 31 Aug 2017 22:39:59 +0200
Subject: libtracker-direct: Fix compiler warning
Handle GLib.Error on async queries.
---
src/libtracker-direct/tracker-direct.vala | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/libtracker-direct/tracker-direct.vala b/src/libtracker-direct/tracker-direct.vala
index e079e6e..06c6523 100644
--- a/src/libtracker-direct/tracker-direct.vala
+++ b/src/libtracker-direct/tracker-direct.vala
@@ -252,6 +252,7 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection, AsyncInitabl
Sparql.Error sparql_error = null;
IOError io_error = null;
DBusError dbus_error = null;
+ GLib.Error error = null;
Sparql.Cursor result = null;
var context = MainContext.get_thread_default ();
@@ -264,6 +265,8 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection, AsyncInitabl
sparql_error = e_spql;
} catch (DBusError e_dbus) {
dbus_error = e_dbus;
+ } catch (GLib.Error e) {
+ error = e;
}
context.invoke (() => {
--
cgit v0.12
From 3cba3373c15cb8051a62cb2fa5747890227655b5 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 31 Aug 2017 22:41:29 +0200
Subject: tracker-store: Fix compiler warnings
Use backup_save() function with correct non-NULL arguments,
avoid an implicit .begin(), and fix CCode annotations for
a vala function.
---
src/tracker-store/tracker-backup.vala | 2 +-
src/tracker-store/tracker-dbus.vala | 2 +-
src/tracker-store/tracker-writeback.vapi | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/tracker-store/tracker-backup.vala b/src/tracker-store/tracker-backup.vala
index a0876f7..5db0752 100644
--- a/src/tracker-store/tracker-backup.vala
+++ b/src/tracker-store/tracker-backup.vala
@@ -41,7 +41,7 @@ public class Tracker.Backup : Object {
Error backup_error = null;
var data_manager = Tracker.Main.get_data_manager ();
- Data.backup_save (data_manager, destination, null, error => {
+ Data.backup_save (data_manager, destination, destination, error => {
backup_error = error;
save.callback ();
});
diff --git a/src/tracker-store/tracker-dbus.vala b/src/tracker-store/tracker-dbus.vala
index e76980a..35c1542 100644
--- a/src/tracker-store/tracker-dbus.vala
+++ b/src/tracker-store/tracker-dbus.vala
@@ -93,7 +93,7 @@ public class Tracker.DBus {
}
public static void on_domain_name_disappeared (DBusConnection connection, string name) {
- notifier.wait ();
+ notifier.wait.begin ();
yield;
watch_main_loop.quit ();
}
diff --git a/src/tracker-store/tracker-writeback.vapi b/src/tracker-store/tracker-writeback.vapi
index f51fa25..368de03 100644
--- a/src/tracker-store/tracker-writeback.vapi
+++ b/src/tracker-store/tracker-writeback.vapi
@@ -18,7 +18,7 @@
*/
namespace Tracker {
- [CCode (has_array_length = false, array_null_terminated = true, has_target = false, cheader_filename = "tracker-store/tracker-writeback.h")]
+ [CCode (array_null_terminated = true, has_target = false, cheader_filename = "tracker-store/tracker-writeback.h")]
public delegate string[] WritebackGetPredicatesFunc ();
[CCode (cheader_filename = "tracker-store/tracker-writeback.h")]
--
cgit v0.12
From 5ff52ebcabb63aa6651d14b4cfd75e9a4cf9831e Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 31 Aug 2017 22:43:31 +0200
Subject: tests: Fix compiler warnings
Remove an unused variable, and fix several implicit .begin() calls.
---
tests/functional-tests/ipc/test-busy-handling.vala | 4 ++--
tests/functional-tests/ipc/test-class-signal-performance-batch.vala | 6 +++---
tests/functional-tests/ipc/test-class-signal-performance.vala | 2 +-
tests/functional-tests/ipc/test-class-signal.vala | 4 ++--
tests/functional-tests/ipc/test-insert-or-replace.vala | 2 +-
tests/functional-tests/ipc/test-shared-query.vala | 2 +-
tests/functional-tests/ipc/test-shared-update.vala | 2 +-
tests/libtracker-miner/empty-gobject.c | 2 --
8 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/tests/functional-tests/ipc/test-busy-handling.vala b/tests/functional-tests/ipc/test-busy-handling.vala
index 874bde4..42297e1 100644
--- a/tests/functional-tests/ipc/test-busy-handling.vala
+++ b/tests/functional-tests/ipc/test-busy-handling.vala
@@ -126,14 +126,14 @@ public class TestApp {
if (ready) {
print ("Test 2: query launches now\n");
- jumper_async ();
+ jumper_async.begin ();
}
return !ready;
}
bool in_mainloop () {
- do_async_query_tests ();
+ do_async_query_tests.begin ();
print ("Test 2: Wait for the status signal to indicate readyness\n");
users++;
diff --git a/tests/functional-tests/ipc/test-class-signal-performance-batch.vala b/tests/functional-tests/ipc/test-class-signal-performance-batch.vala
index 5d77d55..7c8d9b6 100644
--- a/tests/functional-tests/ipc/test-class-signal-performance-batch.vala
+++ b/tests/functional-tests/ipc/test-class-signal-performance-batch.vala
@@ -80,7 +80,7 @@ public class TestApp {
int i;
for (i = 0; i <= max_signals; i++) {
string upqry = "DELETE { <%d> a rdfs:Resource }".printf(i);
- resources_object.sparql_update_async (upqry);
+ resources_object.sparql_update_async.begin (upqry);
}
t.start();
@@ -88,9 +88,9 @@ public class TestApp {
string upqry = "INSERT { <%d> a nmm:MusicPiece ; nie:title '%s %d' }".printf(i, title_data, i);
if (i == max_signals / 2) {
- resources_object.sparql_update_async (upqry);
+ resources_object.sparql_update_async.begin (upqry);
} else {
- resources_object.batch_sparql_update_async (upqry);
+ resources_object.batch_sparql_update_async.begin (upqry);
}
}
}
diff --git a/tests/functional-tests/ipc/test-class-signal-performance.vala b/tests/functional-tests/ipc/test-class-signal-performance.vala
index 35e9307..26c25ab 100644
--- a/tests/functional-tests/ipc/test-class-signal-performance.vala
+++ b/tests/functional-tests/ipc/test-class-signal-performance.vala
@@ -135,7 +135,7 @@ public class TestApp {
t.start();
for (i = 0; i <= max_signals; i++) {
string upqry = "INSERT { <%d> a nmm:MusicPiece ; nie:title '%s %d' }".printf(i, title_data, i);
- resources_object.sparql_update_async (upqry);
+ resources_object.sparql_update_async.begin (upqry);
}
}
diff --git a/tests/functional-tests/ipc/test-class-signal.vala b/tests/functional-tests/ipc/test-class-signal.vala
index 34749cd..0cc61af 100644
--- a/tests/functional-tests/ipc/test-class-signal.vala
+++ b/tests/functional-tests/ipc/test-class-signal.vala
@@ -140,7 +140,7 @@ public class TestApp {
string dels_qry = build_title_query (class_name, deletes).str;
string ins_qry = build_title_query (class_name, deletes).str;
- on_graph_updated_received_async (dels_qry, ins_qry);
+ on_graph_updated_received_async.begin (dels_qry, ins_qry);
}
private void insert_data () {
@@ -149,7 +149,7 @@ public class TestApp {
for (i = 0; i <= max_signals; i++) {
string upqry = "DELETE { <%d> a rdfs:Resource } INSERT { <%d> a nmm:MusicPiece ; nie:title '%s %d' }".printf(i, i, title_data, i);
- resources_object.sparql_update_async (upqry);
+ resources_object.sparql_update_async.begin (upqry);
// Once the FD passing bug is fixed (running out of FDs), replace
// above with this:
diff --git a/tests/functional-tests/ipc/test-insert-or-replace.vala b/tests/functional-tests/ipc/test-insert-or-replace.vala
index 6def3bc..718dfc8 100644
--- a/tests/functional-tests/ipc/test-insert-or-replace.vala
+++ b/tests/functional-tests/ipc/test-insert-or-replace.vala
@@ -125,7 +125,7 @@ int main (string[] args) {
c = Connection.get ();
if (args.length == 3) {
- y = args[2].to_int();
+ y = int.parse (args[2]);
}
if (args.length == 1 || args[1] == "replace") {
diff --git a/tests/functional-tests/ipc/test-shared-query.vala b/tests/functional-tests/ipc/test-shared-query.vala
index 3fb930c..133fec8 100644
--- a/tests/functional-tests/ipc/test-shared-query.vala
+++ b/tests/functional-tests/ipc/test-shared-query.vala
@@ -122,7 +122,7 @@ public class TestApp : GLib.Object {
bool in_mainloop () {
do_sync_tests ();
- do_async_tests ();
+ do_async_tests.begin ();
return false;
}
diff --git a/tests/functional-tests/ipc/test-shared-update.vala b/tests/functional-tests/ipc/test-shared-update.vala
index 406ae43..f2a54a7 100644
--- a/tests/functional-tests/ipc/test-shared-update.vala
+++ b/tests/functional-tests/ipc/test-shared-update.vala
@@ -120,7 +120,7 @@ public class TestApp : GLib.Object {
bool in_mainloop () {
do_sync_tests ();
- do_async_tests ();
+ do_async_tests.begin ();
return false;
}
diff --git a/tests/libtracker-miner/empty-gobject.c b/tests/libtracker-miner/empty-gobject.c
index 4c0bbad..3448c9e 100644
--- a/tests/libtracker-miner/empty-gobject.c
+++ b/tests/libtracker-miner/empty-gobject.c
@@ -92,8 +92,6 @@ static void empty_object_instance_init (EmptyObject * self) {
static void empty_object_finalize (GObject* obj) {
- EmptyObject * self;
- self = EMPTY_OBJECT (obj);
G_OBJECT_CLASS (empty_object_parent_class)->finalize (obj);
}
--
cgit v0.12
From 7789e3ac0bdb3bafd68795f7bc2f381bcfa04cfd Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Fri, 8 Sep 2017 23:03:16 +0200
Subject: libtracker-fts: Only let stop words go through on prefix queries
Commit 63e507865 made stop words go through when tokenizing FTS5 query
search terms, in order to still provide matches for incompletely typed
search terms that happen to match a stop word.
This however brought the side effect that searching for a stop word in
combination with other terms renders the latter ineffective. As the stop
word has no tokens in the FTS5 table to match with, the whole query brings
no results.
Since that commit, SQLite fixed FTS5_TOKENIZE_PREFIX to work as advertised,
so limit the bypass to prefix queries (e.g. "onto*"), since it only makes
sense there. Also, invert the way we look for stop words (i.e. always lookup
those in search terms as per config, and do the bypass once we know we deal
with a stop word) for the sake of readability.
https://bugzilla.gnome.org/show_bug.cgi?id=787452
---
src/libtracker-fts/tracker-fts-tokenizer.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/libtracker-fts/tracker-fts-tokenizer.c b/src/libtracker-fts/tracker-fts-tokenizer.c
index 7b0af2d..a58a8ba 100644
--- a/src/libtracker-fts/tracker-fts-tokenizer.c
+++ b/src/libtracker-fts/tracker-fts-tokenizer.c
@@ -102,24 +102,21 @@ tracker_tokenizer_tokenize (Fts5Tokenizer *fts5_tokenizer,
TrackerTokenizer *tokenizer = (TrackerTokenizer *) fts5_tokenizer;
TrackerTokenizerData *data = tokenizer->data;
const gchar *token;
- gboolean stop_word, ignore_stop_words = data->ignore_stop_words;
+ gboolean stop_word, is_prefix_query;
int n_tokens = 0, pos, start, end, len;
int rc = SQLITE_OK;
if (length <= 0)
return rc;
- /* When tokenizing the query, we don't want to ignore stop words,
- * we might ignore otherwise valid matches.
- */
- if (flags & FTS5_TOKENIZE_QUERY)
- ignore_stop_words = FALSE;
+ is_prefix_query = ((flags & (FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX)) ==
+ (FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX));
tracker_parser_reset (tokenizer->parser, text, length,
data->max_word_length,
data->enable_stemmer,
data->enable_unaccent,
- ignore_stop_words,
+ data->ignore_stop_words,
TRUE,
data->ignore_numbers);
@@ -133,7 +130,12 @@ tracker_tokenizer_tokenize (Fts5Tokenizer *fts5_tokenizer,
if (!token)
break;
- if (stop_word && data->ignore_stop_words)
+ /* When tokenizing prefix query tokens we don't want to
+ * mistake incomplete words as stop words (eg. "onto" when
+ * typing "ontology"), we thus let them go through
+ * even if the parser marked it as a stop word.
+ */
+ if (stop_word && !is_prefix_query)
continue;
rc = token_func (ctx, 0, token, len, start, end);
--
cgit v0.12
From d953ae3a20fb4809590c6ff1e2bcfb244119bee6 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Sat, 9 Sep 2017 20:21:32 +0200
Subject: libtracker-data: Mark private methods explicitly as private
This makes it easier to spot the interactions when reading code.
---
src/libtracker-data/tracker-sparql-expression.vala | 76 +++++++++++-----------
src/libtracker-data/tracker-sparql-pattern.vala | 44 ++++++-------
src/libtracker-data/tracker-sparql-query.vala | 32 ++++-----
src/libtracker-data/tracker-sparql-scanner.vala | 18 ++---
src/libtracker-data/tracker-turtle-reader.vala | 16 ++---
5 files changed, 93 insertions(+), 93 deletions(-)
diff --git a/src/libtracker-data/tracker-sparql-expression.vala b/src/libtracker-data/tracker-sparql-expression.vala
index 338dc20..ed2a2c7 100644
--- a/src/libtracker-data/tracker-sparql-expression.vala
+++ b/src/libtracker-data/tracker-sparql-expression.vala
@@ -49,47 +49,47 @@ class Tracker.Sparql.Expression : Object {
get { return query.pattern; }
}
- inline bool next () throws Sparql.Error {
+ private inline bool next () throws Sparql.Error {
return query.next ();
}
- inline SparqlTokenType current () {
+ private inline SparqlTokenType current () {
return query.current ();
}
- inline SparqlTokenType last () {
+ private inline SparqlTokenType last () {
return query.last ();
}
- inline bool accept (SparqlTokenType type) throws Sparql.Error {
+ private inline bool accept (SparqlTokenType type) throws Sparql.Error {
return query.accept (type);
}
- Sparql.Error get_error (string msg) {
+ private Sparql.Error get_error (string msg) {
return query.get_error (msg);
}
- bool expect (SparqlTokenType type) throws Sparql.Error {
+ private bool expect (SparqlTokenType type) throws Sparql.Error {
return query.expect (type);
}
- string get_last_string (int strip = 0) {
+ private string get_last_string (int strip = 0) {
return query.get_last_string (strip);
}
- string escape_sql_string_literal (string literal) {
+ private string escape_sql_string_literal (string literal) {
return "'%s'".printf (string.joinv ("''", literal.split ("'")));
}
- bool maybe_numeric (PropertyType type) {
+ private bool maybe_numeric (PropertyType type) {
return (type == PropertyType.INTEGER || type == PropertyType.DOUBLE || type == PropertyType.DATE || type == PropertyType.DATETIME || type == PropertyType.UNKNOWN);
}
- void append_collate (StringBuilder sql) {
+ private void append_collate (StringBuilder sql) {
sql.append_printf (" COLLATE %s", COLLATION_NAME);
}
- void skip_bracketted_expression () throws Sparql.Error {
+ private void skip_bracketted_expression () throws Sparql.Error {
expect (SparqlTokenType.OPEN_PARENS);
while (true) {
switch (current ()) {
@@ -234,7 +234,7 @@ class Tracker.Sparql.Expression : Object {
return type;
}
- void translate_expression_as_order_condition (StringBuilder sql) throws Sparql.Error {
+ private void translate_expression_as_order_condition (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
if (translate_expression (sql) == PropertyType.RESOURCE) {
// ID => Uri
@@ -255,7 +255,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- void translate_bound_call (StringBuilder sql) throws Sparql.Error {
+ private void translate_bound_call (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.BOUND);
expect (SparqlTokenType.OPEN_PARENS);
sql.append ("(");
@@ -264,7 +264,7 @@ class Tracker.Sparql.Expression : Object {
expect (SparqlTokenType.CLOSE_PARENS);
}
- PropertyType translate_if_call (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_if_call (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.IF);
expect (SparqlTokenType.OPEN_PARENS);
@@ -289,7 +289,7 @@ class Tracker.Sparql.Expression : Object {
return type;
}
- void translate_regex (StringBuilder sql) throws Sparql.Error {
+ private void translate_regex (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.REGEX);
expect (SparqlTokenType.OPEN_PARENS);
sql.append ("SparqlRegex(");
@@ -312,7 +312,7 @@ class Tracker.Sparql.Expression : Object {
expect (SparqlTokenType.CLOSE_PARENS);
}
- void translate_exists (StringBuilder sql) throws Sparql.Error {
+ private void translate_exists (StringBuilder sql) throws Sparql.Error {
sql.append ("(");
pattern.translate_exists (sql);
sql.append (")");
@@ -324,7 +324,7 @@ class Tracker.Sparql.Expression : Object {
convert_expression_to_string (sql, type, begin);
}
- static void convert_expression_to_string (StringBuilder sql, PropertyType type, long begin) {
+ private static void convert_expression_to_string (StringBuilder sql, PropertyType type, long begin) {
switch (type) {
case PropertyType.STRING:
case PropertyType.INTEGER:
@@ -360,7 +360,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- void translate_expression_as_string (StringBuilder sql) throws Sparql.Error {
+ private void translate_expression_as_string (StringBuilder sql) throws Sparql.Error {
switch (current ()) {
case SparqlTokenType.IRI_REF:
case SparqlTokenType.PN_PREFIX:
@@ -388,7 +388,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- void translate_str (StringBuilder sql) throws Sparql.Error {
+ private void translate_str (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.STR);
expect (SparqlTokenType.OPEN_PARENS);
@@ -397,7 +397,7 @@ class Tracker.Sparql.Expression : Object {
expect (SparqlTokenType.CLOSE_PARENS);
}
- void translate_isuri (StringBuilder sql) throws Sparql.Error {
+ private void translate_isuri (StringBuilder sql) throws Sparql.Error {
if (!accept (SparqlTokenType.ISURI)) {
expect (SparqlTokenType.ISIRI);
}
@@ -422,7 +422,7 @@ class Tracker.Sparql.Expression : Object {
expect (SparqlTokenType.CLOSE_PARENS);
}
- void translate_datatype (StringBuilder sql) throws Sparql.Error {
+ private void translate_datatype (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.DATATYPE);
expect (SparqlTokenType.OPEN_PARENS);
@@ -451,7 +451,7 @@ class Tracker.Sparql.Expression : Object {
expect (SparqlTokenType.CLOSE_PARENS);
}
- void translate_date (StringBuilder sql, string format) throws Sparql.Error {
+ private void translate_date (StringBuilder sql, string format) throws Sparql.Error {
sql.append_printf ("strftime (\"%s\", ", format);
if (accept (SparqlTokenType.VAR)) {
@@ -466,7 +466,7 @@ class Tracker.Sparql.Expression : Object {
sql.append (", \"unixepoch\")");
}
- void translate_time (StringBuilder sql, TimeFormatType type) throws Sparql.Error {
+ private void translate_time (StringBuilder sql, TimeFormatType type) throws Sparql.Error {
sql.append ("(");
if (accept (SparqlTokenType.VAR)) {
string variable_name = get_last_string ().substring (1);
@@ -490,7 +490,7 @@ class Tracker.Sparql.Expression : Object {
sql.append (")");
}
- PropertyType translate_function (StringBuilder sql, string uri) throws Sparql.Error {
+ private PropertyType translate_function (StringBuilder sql, string uri) throws Sparql.Error {
if (uri == XSD_NS + "string") {
// conversion to string
translate_expression_as_string (sql);
@@ -910,7 +910,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- PropertyType parse_type_uri () throws Sparql.Error {
+ private PropertyType parse_type_uri () throws Sparql.Error {
string type_iri;
PropertyType type;
@@ -1027,7 +1027,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- PropertyType translate_uri_expression (StringBuilder sql, string uri) throws Sparql.Error {
+ private PropertyType translate_uri_expression (StringBuilder sql, string uri) throws Sparql.Error {
if (accept (SparqlTokenType.OPEN_PARENS)) {
// function
var result = translate_function (sql, uri);
@@ -1043,7 +1043,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- PropertyType translate_primary_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_primary_expression (StringBuilder sql) throws Sparql.Error {
PropertyType type;
switch (current ()) {
@@ -1474,7 +1474,7 @@ class Tracker.Sparql.Expression : Object {
return translate_primary_expression (sql);
}
- PropertyType translate_multiplicative_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_multiplicative_expression (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
var optype = translate_unary_expression (sql);
while (true) {
@@ -1505,7 +1505,7 @@ class Tracker.Sparql.Expression : Object {
return optype;
}
- PropertyType translate_additive_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_additive_expression (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
var optype = translate_multiplicative_expression (sql);
while (true) {
@@ -1536,11 +1536,11 @@ class Tracker.Sparql.Expression : Object {
return optype;
}
- PropertyType translate_numeric_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_numeric_expression (StringBuilder sql) throws Sparql.Error {
return translate_additive_expression (sql);
}
- PropertyType process_relational_expression (StringBuilder sql, long begin, uint n_bindings, PropertyType op1type, string operator) throws Sparql.Error {
+ private PropertyType process_relational_expression (StringBuilder sql, long begin, uint n_bindings, PropertyType op1type, string operator) throws Sparql.Error {
sql.insert (begin, "(");
sql.append (operator);
var op2type = translate_numeric_expression (sql);
@@ -1563,7 +1563,7 @@ class Tracker.Sparql.Expression : Object {
return PropertyType.BOOLEAN;
}
- PropertyType translate_in (StringBuilder sql, bool not) throws Sparql.Error {
+ private PropertyType translate_in (StringBuilder sql, bool not) throws Sparql.Error {
int in_variable_count = 0;
@@ -1594,7 +1594,7 @@ class Tracker.Sparql.Expression : Object {
return PropertyType.BOOLEAN;
}
- PropertyType translate_relational_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_relational_expression (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
// TODO: improve performance (linked list)
uint n_bindings = query.bindings.length ();
@@ -1620,11 +1620,11 @@ class Tracker.Sparql.Expression : Object {
return optype;
}
- PropertyType translate_value_logical (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_value_logical (StringBuilder sql) throws Sparql.Error {
return translate_relational_expression (sql);
}
- PropertyType translate_conditional_and_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_conditional_and_expression (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
var optype = translate_value_logical (sql);
while (accept (SparqlTokenType.OP_AND)) {
@@ -1642,7 +1642,7 @@ class Tracker.Sparql.Expression : Object {
return optype;
}
- PropertyType translate_conditional_or_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_conditional_or_expression (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
var optype = translate_conditional_and_expression (sql);
while (accept (SparqlTokenType.OP_OR)) {
@@ -1664,7 +1664,7 @@ class Tracker.Sparql.Expression : Object {
return translate_conditional_or_expression (sql);
}
- PropertyType translate_bracketted_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_bracketted_expression (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.OPEN_PARENS);
if (current () == SparqlTokenType.SELECT) {
@@ -1683,7 +1683,7 @@ class Tracker.Sparql.Expression : Object {
return optype;
}
- PropertyType translate_aggregate_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_aggregate_expression (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.OPEN_PARENS);
if (accept (SparqlTokenType.DISTINCT)) {
sql.append ("DISTINCT ");
diff --git a/src/libtracker-data/tracker-sparql-pattern.vala b/src/libtracker-data/tracker-sparql-pattern.vala
index 490498b..59810da 100644
--- a/src/libtracker-data/tracker-sparql-pattern.vala
+++ b/src/libtracker-data/tracker-sparql-pattern.vala
@@ -193,39 +193,39 @@ class Tracker.Sparql.Pattern : Object {
set { query.context = value; }
}
- inline bool next () throws Sparql.Error {
+ private inline bool next () throws Sparql.Error {
return query.next ();
}
- inline SparqlTokenType current () {
+ private inline SparqlTokenType current () {
return query.current ();
}
- inline bool accept (SparqlTokenType type) throws Sparql.Error {
+ private inline bool accept (SparqlTokenType type) throws Sparql.Error {
return query.accept (type);
}
- inline void optional (SparqlTokenType type) throws Sparql.Error {
+ private inline void optional (SparqlTokenType type) throws Sparql.Error {
query.optional (type);
}
- Sparql.Error get_error (string msg) {
+ private Sparql.Error get_error (string msg) {
return query.get_error (msg);
}
- bool expect (SparqlTokenType type) throws Sparql.Error {
+ private bool expect (SparqlTokenType type) throws Sparql.Error {
return query.expect (type);
}
- SourceLocation get_location () {
+ private SourceLocation get_location () {
return query.get_location ();
}
- void set_location (SourceLocation location) {
+ private void set_location (SourceLocation location) {
query.set_location (location);
}
- string get_last_string (int strip = 0) {
+ private string get_last_string (int strip = 0) {
return query.get_last_string (strip);
}
@@ -589,7 +589,7 @@ class Tracker.Sparql.Pattern : Object {
return result;
}
- void parse_object_list (StringBuilder sql, bool in_simple_optional = false) throws Sparql.Error {
+ private void parse_object_list (StringBuilder sql, bool in_simple_optional = false) throws Sparql.Error {
while (true) {
parse_object (sql, in_simple_optional);
if (accept (SparqlTokenType.COMMA)) {
@@ -599,7 +599,7 @@ class Tracker.Sparql.Pattern : Object {
}
}
- void parse_property_list_not_empty (StringBuilder sql, bool in_simple_optional = false) throws Sparql.Error {
+ private void parse_property_list_not_empty (StringBuilder sql, bool in_simple_optional = false) throws Sparql.Error {
while (true) {
var old_predicate = current_predicate;
var old_predicate_is_var = current_predicate_is_var;
@@ -643,12 +643,12 @@ class Tracker.Sparql.Pattern : Object {
}
}
- void translate_filter (StringBuilder sql) throws Sparql.Error {
+ private void translate_filter (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.FILTER);
expression.translate_constraint (sql);
}
- void skip_filter () throws Sparql.Error {
+ private void skip_filter () throws Sparql.Error {
expect (SparqlTokenType.FILTER);
switch (current ()) {
@@ -685,13 +685,13 @@ class Tracker.Sparql.Pattern : Object {
}
}
- void start_triples_block (StringBuilder sql) throws Sparql.Error {
+ private void start_triples_block (StringBuilder sql) throws Sparql.Error {
context = triple_context = new TripleContext (query, context);
sql.append ("SELECT ");
}
- void end_triples_block (StringBuilder sql, ref bool first_where, bool in_group_graph_pattern) throws Sparql.Error {
+ private void end_triples_block (StringBuilder sql, ref bool first_where, bool in_group_graph_pattern) throws Sparql.Error {
// remove last comma and space
sql.truncate (sql.len - 2);
@@ -808,7 +808,7 @@ class Tracker.Sparql.Pattern : Object {
context = context.parent_context;
}
- void parse_triples (StringBuilder sql, long group_graph_pattern_start, ref bool in_triples_block, ref bool first_where, ref bool in_group_graph_pattern, bool found_simple_optional) throws Sparql.Error {
+ private void parse_triples (StringBuilder sql, long group_graph_pattern_start, ref bool in_triples_block, ref bool first_where, ref bool in_group_graph_pattern, bool found_simple_optional) throws Sparql.Error {
while (true) {
if (current () != SparqlTokenType.VAR &&
current () != SparqlTokenType.IRI_REF &&
@@ -844,7 +844,7 @@ class Tracker.Sparql.Pattern : Object {
}
}
- bool is_subclass (Class class1, Class class2) {
+ private bool is_subclass (Class class1, Class class2) {
if (class1 == class2) {
return true;
}
@@ -856,7 +856,7 @@ class Tracker.Sparql.Pattern : Object {
return false;
}
- bool is_simple_optional () {
+ private bool is_simple_optional () {
var optional_start = get_location ();
try {
// check that we have { ?v foo:bar ?o }
@@ -1227,7 +1227,7 @@ class Tracker.Sparql.Pattern : Object {
return result;
}
- void translate_group_or_union_graph_pattern (StringBuilder sql) throws Sparql.Error {
+ private void translate_group_or_union_graph_pattern (StringBuilder sql) throws Sparql.Error {
Variable[] all_vars = { };
HashTable<Variable,int> all_var_set = new HashTable<Variable,int>.full (Variable.hash, Variable.equal, g_object_unref, null);
@@ -1283,7 +1283,7 @@ class Tracker.Sparql.Pattern : Object {
}
}
- VariableBindingList? get_variable_binding_list (Variable variable) {
+ private VariableBindingList? get_variable_binding_list (Variable variable) {
VariableBindingList binding_list = null;
if (triple_context != null) {
binding_list = triple_context.var_bindings.lookup (variable);
@@ -1347,7 +1347,7 @@ class Tracker.Sparql.Pattern : Object {
}
}
- void parse_object (StringBuilder sql, bool in_simple_optional = false) throws Sparql.Error {
+ private void parse_object (StringBuilder sql, bool in_simple_optional = false) throws Sparql.Error {
long begin_sql_len = sql.len;
bool object_is_var;
@@ -1639,7 +1639,7 @@ class Tracker.Sparql.Pattern : Object {
}
}
- DataTable get_table (string subject, string db_table, bool share_table, out bool newtable) {
+ private DataTable get_table (string subject, string db_table, bool share_table, out bool newtable) {
string tablestring = "%s.%s".printf (subject, db_table);
DataTable table = null;
newtable = false;
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index b25f416..f6c1249 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -389,7 +389,7 @@ public class Tracker.Sparql.Query : Object {
return ((string) (tokens[last_index].begin.pos + strip)).substring (0, (int) (tokens[last_index].end.pos - tokens[last_index].begin.pos - 2 * strip));
}
- void parse_prologue () throws Sparql.Error {
+ private void parse_prologue () throws Sparql.Error {
if (accept (SparqlTokenType.BASE)) {
expect (SparqlTokenType.IRI_REF);
}
@@ -405,7 +405,7 @@ public class Tracker.Sparql.Query : Object {
}
}
- void prepare_execute () throws DBInterfaceError, Sparql.Error, DateError {
+ private void prepare_execute () throws DBInterfaceError, Sparql.Error, DateError {
assert (!update_extensions);
scanner = new SparqlScanner ((char*) query_string, (long) query_string.length);
@@ -513,7 +513,7 @@ public class Tracker.Sparql.Query : Object {
return result;
}
- DBStatement prepare_for_exec (DBInterface iface, string sql) throws DBInterfaceError, Sparql.Error, DateError {
+ private DBStatement prepare_for_exec (DBInterface iface, string sql) throws DBInterfaceError, Sparql.Error, DateError {
var stmt = iface.create_statement (no_cache ? DBStatementCacheType.NONE : DBStatementCacheType.SELECT, "%s", sql);
// set literals specified in query
@@ -542,13 +542,13 @@ public class Tracker.Sparql.Query : Object {
return stmt;
}
- DBCursor? exec_sql_cursor (DBInterface iface, string sql, PropertyType[]? types, string[]? variable_names) throws DBInterfaceError, Sparql.Error, DateError {
+ private DBCursor? exec_sql_cursor (DBInterface iface, string sql, PropertyType[]? types, string[]? variable_names) throws DBInterfaceError, Sparql.Error, DateError {
var stmt = prepare_for_exec (iface, sql);
return stmt.start_sparql_cursor (types, variable_names);
}
- string get_select_query (out SelectContext context) throws DBInterfaceError, Sparql.Error, DateError {
+ private string get_select_query (out SelectContext context) throws DBInterfaceError, Sparql.Error, DateError {
// SELECT query
// build SQL
@@ -560,7 +560,7 @@ public class Tracker.Sparql.Query : Object {
return sql.str;
}
- DBCursor? execute_select_cursor () throws DBInterfaceError, Sparql.Error, DateError {
+ private DBCursor? execute_select_cursor () throws DBInterfaceError, Sparql.Error, DateError {
SelectContext context;
string sql = get_select_query (out context);
var iface = manager.get_db_interface ();
@@ -568,7 +568,7 @@ public class Tracker.Sparql.Query : Object {
return exec_sql_cursor (iface, sql, context.types, context.variable_names);
}
- string get_ask_query () throws DBInterfaceError, Sparql.Error, DateError {
+ private string get_ask_query () throws DBInterfaceError, Sparql.Error, DateError {
// ASK query
var pattern_sql = new StringBuilder ();
@@ -599,7 +599,7 @@ public class Tracker.Sparql.Query : Object {
return sql.str;
}
- DBCursor? execute_ask_cursor () throws DBInterfaceError, Sparql.Error, DateError {
+ private DBCursor? execute_ask_cursor () throws DBInterfaceError, Sparql.Error, DateError {
var iface = manager.get_db_interface ();
return exec_sql_cursor (iface, get_ask_query (), new PropertyType[] { PropertyType.BOOLEAN }, new string[] { "result" });
}
@@ -617,7 +617,7 @@ public class Tracker.Sparql.Query : Object {
}
}
- void execute_insert_delete (VariantBuilder? update_blank_nodes) throws GLib.Error {
+ private void execute_insert_delete (VariantBuilder? update_blank_nodes) throws GLib.Error {
bool blank = true;
// DELETE and/or INSERT
@@ -828,7 +828,7 @@ public class Tracker.Sparql.Query : Object {
return ns + local_name;
}
- int quad_data_unbound_var_count () throws Sparql.Error {
+ private int quad_data_unbound_var_count () throws Sparql.Error {
SourceLocation current_pos = get_location ();
int n_braces = 1;
int n_unbound = 0;
@@ -853,7 +853,7 @@ public class Tracker.Sparql.Query : Object {
return n_unbound;
}
- void skip_braces () throws Sparql.Error {
+ private void skip_braces () throws Sparql.Error {
expect (SparqlTokenType.OPEN_BRACE);
int n_braces = 1;
while (n_braces > 0) {
@@ -870,7 +870,7 @@ public class Tracker.Sparql.Query : Object {
}
}
- void parse_construct_triples_block (Solution var_value_map, UpdateType type) throws Sparql.Error, DateError {
+ private void parse_construct_triples_block (Solution var_value_map, UpdateType type) throws Sparql.Error, DateError {
expect (SparqlTokenType.OPEN_BRACE);
while (current () != SparqlTokenType.CLOSE_BRACE) {
@@ -925,7 +925,7 @@ public class Tracker.Sparql.Query : Object {
bool anon_blank_node_open = false;
- string? parse_construct_var_or_term (Solution var_value_map, UpdateType type, out bool is_null) throws Sparql.Error, DateError {
+ private string? parse_construct_var_or_term (Solution var_value_map, UpdateType type, out bool is_null) throws Sparql.Error, DateError {
string result = "";
is_null = false;
if (current () == SparqlTokenType.VAR) {
@@ -1012,7 +1012,7 @@ public class Tracker.Sparql.Query : Object {
return result;
}
- void parse_construct_property_list_not_empty (Solution var_value_map, UpdateType type) throws Sparql.Error, DateError {
+ private void parse_construct_property_list_not_empty (Solution var_value_map, UpdateType type) throws Sparql.Error, DateError {
while (true) {
var old_predicate = current_predicate;
@@ -1049,7 +1049,7 @@ public class Tracker.Sparql.Query : Object {
}
}
- void parse_construct_object_list (Solution var_value_map, UpdateType type) throws Sparql.Error, DateError {
+ private void parse_construct_object_list (Solution var_value_map, UpdateType type) throws Sparql.Error, DateError {
while (true) {
parse_construct_object (var_value_map, type);
if (accept (SparqlTokenType.COMMA)) {
@@ -1059,7 +1059,7 @@ public class Tracker.Sparql.Query : Object {
}
}
- void parse_construct_object (Solution var_value_map, UpdateType type) throws Sparql.Error, DateError {
+ private void parse_construct_object (Solution var_value_map, UpdateType type) throws Sparql.Error, DateError {
bool is_null = false;
string object = parse_construct_var_or_term (var_value_map, type, out is_null);
var data = manager.get_data ();
diff --git a/src/libtracker-data/tracker-sparql-scanner.vala b/src/libtracker-data/tracker-sparql-scanner.vala
index 79d181b..28b66a8 100644
--- a/src/libtracker-data/tracker-sparql-scanner.vala
+++ b/src/libtracker-data/tracker-sparql-scanner.vala
@@ -40,7 +40,7 @@ public class Tracker.SparqlScanner : Object {
column = location.column;
}
- SparqlTokenType get_identifier_or_keyword (char* begin, int len) {
+ private SparqlTokenType get_identifier_or_keyword (char* begin, int len) {
switch (len) {
case 1:
switch (begin[0]) {
@@ -539,7 +539,7 @@ public class Tracker.SparqlScanner : Object {
return SparqlTokenType.PN_PREFIX;
}
- SparqlTokenType read_number () {
+ private SparqlTokenType read_number () {
var type = SparqlTokenType.INTEGER;
// integer part
@@ -615,15 +615,15 @@ public class Tracker.SparqlScanner : Object {
return type;
}
- bool is_pn_char (char c) {
+ private bool is_pn_char (char c) {
return (c.isalnum () || c == '_' || c == '-');
}
- bool is_pn_local_char (char c) {
+ private bool is_pn_local_char (char c) {
return (c.isalnum () || c == '_' || c == '-' || c == '.');
}
- bool is_varname_char (char c) {
+ private bool is_varname_char (char c) {
return (c.isalnum () || c == '_');
}
@@ -959,7 +959,7 @@ public class Tracker.SparqlScanner : Object {
return type;
}
- bool matches (char* begin, string keyword) {
+ private bool matches (char* begin, string keyword) {
char* keyword_array = (char*) keyword;
for (int i = 0; keyword_array[i] != 0; i++) {
if (begin[i].toupper () != keyword_array[i]) {
@@ -969,7 +969,7 @@ public class Tracker.SparqlScanner : Object {
return true;
}
- bool whitespace () {
+ private bool whitespace () {
bool found = false;
while (current < end && current[0].isspace ()) {
if (current[0] == '\n') {
@@ -983,7 +983,7 @@ public class Tracker.SparqlScanner : Object {
return found;
}
- bool comment () {
+ private bool comment () {
if (current >= end || current[0] != '#') {
return false;
}
@@ -997,7 +997,7 @@ public class Tracker.SparqlScanner : Object {
return true;
}
- void space () {
+ private void space () {
while (whitespace () || comment ()) {
}
}
diff --git a/src/libtracker-data/tracker-turtle-reader.vala b/src/libtracker-data/tracker-turtle-reader.vala
index abc50e0..5bebdc4 100644
--- a/src/libtracker-data/tracker-turtle-reader.vala
+++ b/src/libtracker-data/tracker-turtle-reader.vala
@@ -90,7 +90,7 @@ public class Tracker.TurtleReader : Object {
prefix_map = new HashTable<string,string>.full (str_hash, str_equal, g_free, g_free);
}
- string generate_bnodeid (string? user_bnodeid) {
+ private string generate_bnodeid (string? user_bnodeid) {
// user_bnodeid is NULL for anonymous nodes
if (user_bnodeid == null) {
return ":%d".printf (++bnodeid);
@@ -109,7 +109,7 @@ public class Tracker.TurtleReader : Object {
}
}
- inline bool next_token () throws Sparql.Error {
+ private inline bool next_token () throws Sparql.Error {
index = (index + 1) % BUFFER_SIZE;
size--;
if (size <= 0) {
@@ -123,11 +123,11 @@ public class Tracker.TurtleReader : Object {
return (tokens[index].type != SparqlTokenType.EOF);
}
- inline SparqlTokenType current () {
+ private inline SparqlTokenType current () {
return tokens[index].type;
}
- inline bool accept (SparqlTokenType type) throws Sparql.Error {
+ private inline bool accept (SparqlTokenType type) throws Sparql.Error {
if (current () == type) {
next_token ();
return true;
@@ -135,11 +135,11 @@ public class Tracker.TurtleReader : Object {
return false;
}
- Sparql.Error get_error (string msg) {
+ private Sparql.Error get_error (string msg) {
return new Sparql.Error.PARSE ("%d.%d: syntax error, %s".printf (tokens[index].begin.line, tokens[index].begin.column, msg));
}
- bool expect (SparqlTokenType type) throws Sparql.Error {
+ private bool expect (SparqlTokenType type) throws Sparql.Error {
if (accept (type)) {
return true;
}
@@ -147,12 +147,12 @@ public class Tracker.TurtleReader : Object {
throw get_error ("expected %s".printf (type.to_string ()));
}
- string get_last_string (int strip = 0) {
+ private string get_last_string (int strip = 0) {
int last_index = (index + BUFFER_SIZE - 1) % BUFFER_SIZE;
return ((string) (tokens[last_index].begin.pos + strip)).substring (0, (int) (tokens[last_index].end.pos - tokens[last_index].begin.pos - 2 * strip));
}
- string resolve_prefixed_name (string prefix, string local_name) throws Sparql.Error {
+ private string resolve_prefixed_name (string prefix, string local_name) throws Sparql.Error {
string ns = prefix_map.lookup (prefix);
if (ns == null) {
throw get_error ("use of undefined prefix `%s'".printf (prefix));
--
cgit v0.12
From 3b6ed2f78ee22e441d417b5d8b225dde65e4f73c Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Sat, 9 Sep 2017 23:59:22 +0200
Subject: libtracker-data: Fix compiler warning
Use hashtables with nullable integer return value the vala way, instead
of using lookup_extended(), which both looks out of place and produces
constness related warnings on gcc.
---
src/libtracker-data/tracker-sparql-query.vala | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index f6c1249..54ce570 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -176,18 +176,18 @@ namespace Tracker.Sparql {
}
class Solution {
- public HashTable<string,int> hash;
+ public HashTable<string,int?> hash;
public GenericArray<string> values;
public int solution_index;
public Solution () {
- this.hash = new HashTable<string,int> (str_hash, str_equal);
+ this.hash = new HashTable<string,int?> (str_hash, str_equal);
this.values = new GenericArray<string> ();
}
public string? lookup (string variable_name) {
- int variable_index;
- if (!hash.lookup_extended (variable_name, null, out variable_index)) {
+ int? variable_index = hash.get (variable_name);
+ if (variable_index == null) {
return null;
}
return values[solution_index * hash.size () + variable_index];
--
cgit v0.12
From f49529d45a29121420b1a2f19c6e125add4464fb Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Sun, 10 Sep 2017 00:01:23 +0200
Subject: libtracker-remote: Fix compiler warning
The return value of the hashtable contents are not variable, so using
"var" rightfully complains about const being passed to non-const.
---
src/libtracker-remote/tracker-xml-cursor.vala | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libtracker-remote/tracker-xml-cursor.vala b/src/libtracker-remote/tracker-xml-cursor.vala
index de0e51a..ef7349e 100644
--- a/src/libtracker-remote/tracker-xml-cursor.vala
+++ b/src/libtracker-remote/tracker-xml-cursor.vala
@@ -104,7 +104,7 @@ public class Tracker.Remote.XmlCursor : Tracker.Sparql.Cursor {
public override Sparql.ValueType get_value_type (int column) requires (_cur_row != null) {
var variable = _vars[column];
- var node = _cur_row_map.get (variable);
+ Xml.Node* node = (Xml.Node*) _cur_row_map.get (variable);
if (node == null)
return Sparql.ValueType.UNBOUND;
@@ -147,7 +147,7 @@ public class Tracker.Remote.XmlCursor : Tracker.Sparql.Cursor {
length = 0;
var variable = _vars[column];
- var node = _cur_row_map.get (variable);
+ Xml.Node* node = (Xml.Node*) _cur_row_map.get (variable);
if (node == null)
return null;
--
cgit v0.12
From 538202566e5c8b4be4cd97618cc16c4dbb8152fb Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Sun, 10 Sep 2017 00:50:59 +0200
Subject: tests: Remove stray semicolon
---
tests/libtracker-miner/tracker-file-notifier-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/libtracker-miner/tracker-file-notifier-test.c b/tests/libtracker-miner/tracker-file-notifier-test.c
index 17ae3d8..1675824 100644
--- a/tests/libtracker-miner/tracker-file-notifier-test.c
+++ b/tests/libtracker-miner/tracker-file-notifier-test.c
@@ -224,7 +224,7 @@ file_notifier_finished_cb (TrackerFileNotifier *notifier,
if (fixture->expect_finished) {
g_main_loop_quit (fixture->main_loop);
- };
+ }
}
static void
--
cgit v0.12