From 659de807410089e41b7753ae3750c331cc33eb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Mon, 11 Aug 2025 17:24:55 +0200 Subject: [PATCH] clapper: Store enhancers settings in separate config file By enforcing keyfile GSettings backend with a custom file path, we can store all enhancers settings within known location. It makes it much easier to share them in between apps in Flatpak. --- src/lib/clapper/clapper-enhancer-proxy.c | 15 +++++++++++++-- src/lib/clapper/meson.build | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/clapper/clapper-enhancer-proxy.c b/src/lib/clapper/clapper-enhancer-proxy.c index 76cbe4a0..9e2622b6 100644 --- a/src/lib/clapper/clapper-enhancer-proxy.c +++ b/src/lib/clapper/clapper-enhancer-proxy.c @@ -41,6 +41,7 @@ #include "config.h" #include +#include #include "clapper-enhancer-proxy-private.h" #include "clapper-enhancer-proxy-list.h" @@ -896,8 +897,18 @@ clapper_enhancer_proxy_get_settings (ClapperEnhancerProxy *self) /* Try to lazy load schemas */ _init_schema (self); - if (self->schema) - settings = g_settings_new_full (self->schema, NULL, NULL); + if (self->schema) { + GSettingsBackend *backend; + gchar *filename; + + filename = g_build_filename (g_get_user_config_dir (), + CLAPPER_API_NAME, "enhancers", "keyfile", NULL); + backend = g_keyfile_settings_backend_new (filename, "/", NULL); + g_free (filename); + + settings = g_settings_new_full (self->schema, backend, NULL); + g_object_unref (backend); + } return settings; } diff --git a/src/lib/clapper/meson.build b/src/lib/clapper/meson.build index 50e36928..3c337380 100644 --- a/src/lib/clapper/meson.build +++ b/src/lib/clapper/meson.build @@ -172,6 +172,7 @@ clapper_c_args = [ '-DG_LOG_DOMAIN="Clapper"', '-DCLAPPER_COMPILATION', '-DGST_USE_UNSTABLE_API', + '-DG_SETTINGS_ENABLE_BACKEND', ] if get_option('default_library') == 'static'