projects
/
psensor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed config_init. config_load initializes automaticaly the gconf client
[psensor.git]
/
src
/
cfg.c
diff --git
a/src/cfg.c
b/src/cfg.c
index
daa0a89
..
55a20e5
100644
(file)
--- a/
src/cfg.c
+++ b/
src/cfg.c
@@
-74,7
+74,7
@@
#define KEY_INTERFACE_TEMPERATURE_UNIT \
"/apps/psensor/interface/temperature_unit"
#define KEY_INTERFACE_TEMPERATURE_UNIT \
"/apps/psensor/interface/temperature_unit"
-GConfClient *client;
+
static
GConfClient *client;
static char *get_string(char *key, char *default_value)
{
static char *get_string(char *key, char *default_value)
{
@@
-424,9
+424,13
@@
static void config_set_window_keep_below_enabled(int enabled)
FALSE, NULL);
}
FALSE, NULL);
}
-void config_init()
+/*
+ * Initializes the GConf client.
+ */
+static void init()
{
{
- client = gconf_client_get_default();
+ if (!client)
+ client = gconf_client_get_default();
}
void config_cleanup()
}
void config_cleanup()
@@
-441,6
+445,8
@@
struct config *config_load()
{
struct config *c;
{
struct config *c;
+ init();
+
c = malloc(sizeof(struct config));
c->graph_bgcolor = config_get_background_color();
c = malloc(sizeof(struct config));
c->graph_bgcolor = config_get_background_color();