diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2023-03-02 13:23:33 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2023-03-02 15:44:59 +0100 |
commit | 76f7d6da7fd155b5a54482bc459d5d2001aa1ec7 (patch) | |
tree | c7ee9d6bba0ccafc491b9cd13a41440d5aa4c771 /src/libtracker-common | |
parent | e12f03d62079294a4349e33ff9a36fea8a1fea73 (diff) | |
download | tracker-76f7d6da7fd155b5a54482bc459d5d2001aa1ec7.tar.gz |
libtracker-sparql: Use setlocale() directly to query locale
Long long ago, this was an integration point since the Maemo platform
(I thought I'd never write that in 2023) had some infrastructure to
allow on-the-fly locale changes.
This is long long gone, and nowadays it's just a setlocale() wrapper
with a recursive lock that does nothing since all MT-unsafety of this
function comes from the global environment.
We can just setlocale() directly to query the locale details, with
pretty much all the same guarantees.
Diffstat (limited to 'src/libtracker-common')
-rw-r--r-- | src/libtracker-common/tracker-parser-libicu.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libtracker-common/tracker-parser-libicu.c b/src/libtracker-common/tracker-parser-libicu.c index 06ba77da5..ede943003 100644 --- a/src/libtracker-common/tracker-parser-libicu.c +++ b/src/libtracker-common/tracker-parser-libicu.c @@ -32,7 +32,6 @@ #include <unicode/unorm.h> #include <unicode/ucol.h> -#include "tracker-locale.h" #include "tracker-debug.h" #include "tracker-parser.h" #include "tracker-parser-utils.h" @@ -764,10 +763,10 @@ tracker_collation_init (void) { UCollator *collator = NULL; UErrorCode status = U_ZERO_ERROR; - gchar *locale; + const gchar *locale; /* Get locale! */ - locale = tracker_locale_get (TRACKER_LOCALE_COLLATE); + locale = setlocale (LC_COLLATE, NULL); TRACKER_NOTE (COLLATION, g_message ("[ICU collation] Initializing collator for locale '%s'", locale)); collator = ucol_open (locale, &status); @@ -782,7 +781,6 @@ tracker_collation_init (void) u_errorName (status)); } } - g_free (locale); return collator; } |