summaryrefslogtreecommitdiff
path: root/src/tracker
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2016-07-17 23:12:54 +0200
committerCarlos Garnacho <carlosg@gnome.org>2016-07-17 23:12:54 +0200
commit031e9e15b9f8c9e305fde4025f56d67bcffd5539 (patch)
tree84f19c688809c07db88b8f85661b233d1597171e /src/tracker
parent3a748f37cf06312a1ba76ce20062f4f3e509805d (diff)
downloadtracker-031e9e15b9f8c9e305fde4025f56d67bcffd5539.tar.gz
tracker: Fix possible warnings with the tracker search -[msivt] subcommands
We used to poke a third column when the "no search term given" queries just return 2. This triggers warnings in the bus backend, but doesn't with the direct backend, which just returns NULL. Some people are seeing these warnings, which sounds bad enough because it means tracker is forcing the "bus" backend for some reason. But of all ways to notice this situation, this should not be one.
Diffstat (limited to 'src/tracker')
-rw-r--r--src/tracker/tracker-search.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tracker/tracker-search.c b/src/tracker/tracker-search.c
index b60302609..d68f58154 100644
--- a/src/tracker/tracker-search.c
+++ b/src/tracker/tracker-search.c
@@ -517,14 +517,16 @@ get_files_results (TrackerSparqlConnection *connection,
disable_color ? "" : TITLE_END,
tracker_sparql_cursor_get_string (cursor, 0, NULL));
- print_snippet (tracker_sparql_cursor_get_string (cursor, 2, NULL));
+ if (tracker_sparql_cursor_get_n_columns (cursor) > 2)
+ print_snippet (tracker_sparql_cursor_get_string (cursor, 2, NULL));
} else {
g_print (" %s%s%s\n",
disable_color ? "" : TITLE_BEGIN,
tracker_sparql_cursor_get_string (cursor, 1, NULL),
disable_color ? "" : TITLE_END);
- print_snippet (tracker_sparql_cursor_get_string (cursor, 2, NULL));
+ if (tracker_sparql_cursor_get_n_columns (cursor) > 2)
+ print_snippet (tracker_sparql_cursor_get_string (cursor, 2, NULL));
}
count++;