[tracker/wip/carlosg/compiler-warnings: 72/80] libtracker-sparql: Avoid deprecated API usage warnings better




commit 7818fbc60bf58fdf0ea6f555d5466bfe7bf7bffa
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Aug 28 11:14:21 2022 +0200

    libtracker-sparql: Avoid deprecated API usage warnings better
    
    Or the right way. We still use at places
    tracker_namespace_manager_get_default() to preserve backwards compatible
    behavior, so these deprecated warnings should be avoided with
    G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS.

 src/libtracker-sparql/tracker-resource.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-sparql/tracker-resource.c b/src/libtracker-sparql/tracker-resource.c
index c027eecee..fa3d1fe2f 100644
--- a/src/libtracker-sparql/tracker-resource.c
+++ b/src/libtracker-sparql/tracker-resource.c
@@ -19,9 +19,6 @@
 
 #include "config.h"
 
-/* Allow usage of tracker_namespace_manager_get_default() */
-#define TRACKER_VERSION_MIN_REQUIRED TRACKER_VERSION_3_2
-
 #include <glib.h>
 #include <json-glib/json-glib.h>
 
@@ -1169,7 +1166,9 @@ tracker_resource_print_turtle (TrackerResource         *self,
        g_return_val_if_fail (TRACKER_IS_RESOURCE (self), "");
 
        if (namespaces == NULL) {
+               G_GNUC_BEGIN_IGNORE_DEPRECATIONS
                namespaces = tracker_namespace_manager_get_default ();
+               G_GNUC_END_IGNORE_DEPRECATIONS
        }
 
        return tracker_resource_print_rdf (self, namespaces, TRACKER_RDF_FORMAT_TURTLE, NULL);
@@ -1403,7 +1402,9 @@ tracker_resource_print_sparql_update (TrackerResource         *resource,
        priv = GET_PRIVATE(resource);
 
        if (namespaces == NULL) {
+               G_GNUC_BEGIN_IGNORE_DEPRECATIONS
                namespaces = tracker_namespace_manager_get_default ();
+               G_GNUC_END_IGNORE_DEPRECATIONS
        }
 
        if (g_hash_table_size (priv->properties) == 0) {
@@ -1587,7 +1588,9 @@ tracker_resource_print_jsonld (TrackerResource         *self,
        char *result;
 
        if (namespaces == NULL) {
+               G_GNUC_BEGIN_IGNORE_DEPRECATIONS
                namespaces = tracker_namespace_manager_get_default ();
+               G_GNUC_END_IGNORE_DEPRECATIONS
        }
 
        context.all_namespaces = namespaces;


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