[tracker/anonymous-file-nodes] Make tracker-info work again with URNs besides URIs and paths.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/anonymous-file-nodes] Make tracker-info work again with URNs besides URIs and paths.
- Date: Fri, 29 Jan 2010 13:42:15 +0000 (UTC)
commit fb22ad850ab9d9a092accf48a7030ab63068c9d5
Author: Carlos Garnacho <carlos lanedo com>
Date: Fri Jan 29 14:21:15 2010 +0100
Make tracker-info work again with URNs besides URIs and paths.
src/tracker-utils/tracker-info.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/tracker-utils/tracker-info.c b/src/tracker-utils/tracker-info.c
index ed0145f..b00015f 100644
--- a/src/tracker-utils/tracker-info.c
+++ b/src/tracker-utils/tracker-info.c
@@ -144,7 +144,7 @@ main (int argc, char **argv)
gchar *urn;
g_print ("%s:'%s'\n",
- _("Querying information for file"),
+ _("Querying information for entity"),
*p);
/* support both, URIs and local file paths */
@@ -158,6 +158,7 @@ main (int argc, char **argv)
g_object_unref (file);
}
+ /* First check whether there's some entity with nie:url like this */
query = g_strdup_printf ("SELECT ?urn WHERE { ?urn nie:url \"%s\" }", uri);
results = tracker_resources_sparql_query (client, query, &error);
g_free (query);
@@ -171,11 +172,10 @@ main (int argc, char **argv)
continue;
}
- if (!results) {
- g_print (" %s\n",
- _("No URN available for that URI"));
- continue;
- } else {
+ if (!results || results->len == 0) {
+ /* No URN matches, use uri as URN */
+ urn = g_strdup (uri);
+ } else {
gchar **args;
args = g_ptr_array_index (results, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]