[gnome-photos/gnome-3-12] Use ' instead of " for quoting strings in SPARQL



commit 6d76e4334cfeffcc56372d64439b104ba67efcbb
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 7 09:43:22 2014 +0100

    Use ' instead of " for quoting strings in SPARQL
    
    Consistency makes it easier to copy paste strings from the debug
    output into tracker-sparql(1), and ' does not need to be escaped in C
    string literals.

 src/photos-query-builder.c |   10 +++++-----
 src/photos-source.c        |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/photos-query-builder.c b/src/photos-query-builder.c
index ac0d72d..6e866d2 100644
--- a/src/photos-query-builder.c
+++ b/src/photos-query-builder.c
@@ -352,7 +352,7 @@ photos_query_builder_update_mtime_query (PhotosSearchContextState *state, const
   tv.tv_usec = 0;
   time = g_time_val_to_iso8601 (&tv);
 
-  sparql = g_strdup_printf ("INSERT OR REPLACE { <%s> nie:contentLastModified \"%s\" }", resource, time);
+  sparql = g_strdup_printf ("INSERT OR REPLACE { <%s> nie:contentLastModified '%s' }", resource, time);
   g_free (time);
 
   return photos_query_new (state, sparql);
@@ -377,10 +377,10 @@ photos_query_builder_filter_local (void)
   path = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
   pictures_uri = photos_query_builder_convert_path_to_uri (path);
 
-  filter = g_strdup_printf ("(fn:contains (nie:url (?urn), \"%s\")"
-                            " || fn:contains (nie:url (?urn), \"%s\")"
-                            " || fn:contains (nie:url (?urn), \"%s\")"
-                            " || fn:starts-with (nao:identifier (?urn), \"%s\")"
+  filter = g_strdup_printf ("(fn:contains (nie:url (?urn), '%s')"
+                            " || fn:contains (nie:url (?urn), '%s')"
+                            " || fn:contains (nie:url (?urn), '%s')"
+                            " || fn:starts-with (nao:identifier (?urn), '%s')"
                             " || (?urn = nfo:image-category-screenshot))",
                             desktop_uri,
                             download_uri,
diff --git a/src/photos-source.c b/src/photos-source.c
index bbaf3d2..e64aea4 100644
--- a/src/photos-source.c
+++ b/src/photos-source.c
@@ -66,7 +66,7 @@ photos_source_build_filter_resource (PhotosSource *self)
   gchar *filter;
 
   if (!priv->builtin)
-    filter = g_strdup_printf ("(nie:dataSource (?urn) = \"%s\")", priv->id);
+    filter = g_strdup_printf ("(nie:dataSource (?urn) = '%s')", priv->id);
   else
     filter = g_strdup ("(false)");
 


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