summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Toso <victortoso@gnome.org>2021-03-20 20:04:35 +0100
committerVictor Toso <victortoso@gnome.org>2021-03-27 19:39:34 +0000
commitabbca701bd45c0710cb1bd69c0bded002405c336 (patch)
treed7d855c027555986c5ceb837479b7e8d202855e8
parent7ffb45b104ea78fe9938909b43d4ae81cbc55bf4 (diff)
downloadgrilo-abbca701bd45c0710cb1bd69c0bded002405c336.tar.gz
registry: load config from GRL_CONFIG_PATH_VAR if set
This is a simple way to share a GrlConfig between multiple applications. The environment is set by the user and it should not conflict with applications cache if any.
-rw-r--r--src/grl-registry.c4
-rw-r--r--src/grl-registry.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/grl-registry.c b/src/grl-registry.c
index 51223e9..9caf9e3 100644
--- a/src/grl-registry.c
+++ b/src/grl-registry.c
@@ -328,6 +328,10 @@ grl_registry_init (GrlRegistry *registry)
key_id_handler_init (&registry->priv->key_id_handler);
grl_registry_setup_ranks (registry);
+
+ const gchar *config_path = g_getenv (GRL_CONFIG_PATH_VAR);
+ if (config_path != NULL)
+ grl_registry_add_config_from_file (registry, config_path, NULL);
}
/* ================ Utitilies ================ */
diff --git a/src/grl-registry.h b/src/grl-registry.h
index 349c967..c9f25ff 100644
--- a/src/grl-registry.h
+++ b/src/grl-registry.h
@@ -40,6 +40,7 @@
#define GRL_PLUGIN_PATH_VAR "GRL_PLUGIN_PATH"
#define GRL_PLUGIN_LIST_VAR "GRL_PLUGIN_LIST"
#define GRL_PLUGIN_RANKS_VAR "GRL_PLUGIN_RANKS"
+#define GRL_CONFIG_PATH_VAR "GRL_CONFIG_PATH"
/* Macros */