mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 23:32:04 +02:00
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.
This commit is contained in:
@@ -41,6 +41,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <gobject/gvaluecollector.h>
|
#include <gobject/gvaluecollector.h>
|
||||||
|
#include <gio/gsettingsbackend.h>
|
||||||
|
|
||||||
#include "clapper-enhancer-proxy-private.h"
|
#include "clapper-enhancer-proxy-private.h"
|
||||||
#include "clapper-enhancer-proxy-list.h"
|
#include "clapper-enhancer-proxy-list.h"
|
||||||
@@ -896,8 +897,18 @@ clapper_enhancer_proxy_get_settings (ClapperEnhancerProxy *self)
|
|||||||
/* Try to lazy load schemas */
|
/* Try to lazy load schemas */
|
||||||
_init_schema (self);
|
_init_schema (self);
|
||||||
|
|
||||||
if (self->schema)
|
if (self->schema) {
|
||||||
settings = g_settings_new_full (self->schema, NULL, NULL);
|
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;
|
return settings;
|
||||||
}
|
}
|
||||||
|
@@ -172,6 +172,7 @@ clapper_c_args = [
|
|||||||
'-DG_LOG_DOMAIN="Clapper"',
|
'-DG_LOG_DOMAIN="Clapper"',
|
||||||
'-DCLAPPER_COMPILATION',
|
'-DCLAPPER_COMPILATION',
|
||||||
'-DGST_USE_UNSTABLE_API',
|
'-DGST_USE_UNSTABLE_API',
|
||||||
|
'-DG_SETTINGS_ENABLE_BACKEND',
|
||||||
]
|
]
|
||||||
|
|
||||||
if get_option('default_library') == 'static'
|
if get_option('default_library') == 'static'
|
||||||
|
Reference in New Issue
Block a user