[tracker/wip/sam/meson] tracker: Fix possible warnings with the tracker search -[msivt] subcommands



commit 93abdc91b5581ecf2f867945a63642a5a235fe55
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jul 17 23:12:54 2016 +0200

    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.

 src/tracker/tracker-search.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker/tracker-search.c b/src/tracker/tracker-search.c
index b603026..d68f581 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++;


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