/* Update interval of the measures of the sensors */
static const char *KEY_SENSOR_UPDATE_INTERVAL
-= "/apps/psensor/sensor/update_interval";
+= "sensor-update-interval";
/* Graph settings */
static const char *KEY_GRAPH_UPDATE_INTERVAL = "graph-update-interval";
= "interface-temperature-unit";
/* Sensor logging settings */
-static const char *KEY_SLOG_ENABLED = "/apps/psensor/slog/enabled";
-static const char *KEY_SLOG_INTERVAL = "/apps/psensor/slog/interval";
+static const char *KEY_SLOG_ENABLED = "slog-enabled";
+static const char *KEY_SLOG_INTERVAL = "slog-interval";
/* Path to the script called when a notification is raised */
static const char *KEY_NOTIFICATION_SCRIPT = "notif-script";
if (!scolor)
scolor = strdup(DEFAULT_GRAPH_BACKGROUND_COLOR);
- gconf_client_set_string(client,
- KEY_GRAPH_BACKGROUND_COLOR, scolor, NULL);
+ set_string(KEY_GRAPH_BACKGROUND_COLOR, scolor);
free(scolor);
}
if (!str)
str = strdup(DEFAULT_GRAPH_FOREGROUND_COLOR);
- gconf_client_set_string(client, KEY_GRAPH_FOREGROUND_COLOR, str, NULL);
+ set_string(KEY_GRAPH_FOREGROUND_COLOR, str);
free(str);
}
bool is_slog_enabled()
{
- return gconf_client_get_bool(client, KEY_SLOG_ENABLED, NULL);
+ return get_bool(KEY_SLOG_ENABLED);
}
static void set_slog_enabled(bool enabled)
{
- gconf_client_set_bool(client, KEY_SLOG_ENABLED, enabled, NULL);
+ set_bool(KEY_SLOG_ENABLED, enabled);
}
void config_slog_enabled_notify_add(GConfClientNotifyFunc cbk, void *data)
int config_get_slog_interval()
{
- int res;
-
- res = gconf_client_get_int(client, KEY_SLOG_INTERVAL, NULL);
-
- if (res <= 0)
- return 300;
- else
- return res;
+ return get_int(KEY_SLOG_INTERVAL);
}
static void set_slog_interval(int interval)
if (interval <= 0)
interval = 300;
- gconf_client_set_int(client, KEY_SLOG_INTERVAL, interval, NULL);
+ set_int(KEY_SLOG_INTERVAL, interval);
}
static bool is_window_decoration_enabled()
c->slog_interval = config_get_slog_interval();
c->sensor_update_interval
- = gconf_client_get_int(client, KEY_SENSOR_UPDATE_INTERVAL, NULL);
+ = get_int(KEY_SENSOR_UPDATE_INTERVAL);
if (c->sensor_update_interval < 1)
c->sensor_update_interval = 1;
set_int(KEY_GRAPH_MONITORING_DURATION, c->graph_monitoring_duration);
- gconf_client_set_int(client,
- KEY_SENSOR_UPDATE_INTERVAL,
- c->sensor_update_interval, NULL);
+ set_int(KEY_SENSOR_UPDATE_INTERVAL, c->sensor_update_interval);
set_bool(KEY_INTERFACE_MENU_BAR_DISABLED, c->menu_bar_disabled);
&err);
if (!ret) {
- if (err->code == G_KEY_FILE_ERROR_NOT_FOUND) {
+ if (err->code == G_KEY_FILE_ERROR_NOT_FOUND)
log_fct(_("The configuration file "
"does not exist."));
- } else {
+ else
log_err(_("Failed to parse configuration "
"file: %s"),
path);
- }
}
}