[tracker-miners/wip/carlosg/compiler-warnings: 6/8] libtracker-miner: Avoid deprecated g_pattern_match*() API




commit 8a4b486a31659ae32b5400d90e5a93f891133539
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Aug 28 23:10:33 2022 +0200

    libtracker-miner: Avoid deprecated g_pattern_match*() API
    
    If glib is greater than 2.70.0, use the newer API that replaces it.

 src/libtracker-miner/tracker-indexing-tree.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-miner/tracker-indexing-tree.c b/src/libtracker-miner/tracker-indexing-tree.c
index e653f30ac..fa030b370 100644
--- a/src/libtracker-miner/tracker-indexing-tree.c
+++ b/src/libtracker-miner/tracker-indexing-tree.c
@@ -778,7 +778,13 @@ tracker_indexing_tree_file_matches_filter (TrackerIndexingTree *tree,
                        break;
                }
 
-               if (g_pattern_match (data->pattern, len, str, reverse)) {
+#if GLIB_CHECK_VERSION (2, 70, 0)
+               if (g_pattern_spec_match (data->pattern, len, str, reverse))
+#else
+               if (g_pattern_match (data->pattern, len, str, reverse))
+#endif
+
+               {
                        match = TRUE;
                        break;
                }


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