X-Git-Url: http://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fcfg.c;h=0e7ab2b495e192982ad54480ced704c41f2a831a;hb=3dfbff93411ec794a377472d062a716af5c992bc;hp=6fd812ae8addbb8798840c025b18641a0cecb803;hpb=cc35e177d57bc4ee2cc57ae25f130dfc168aa61d;p=psensor.git diff --git a/src/cfg.c b/src/cfg.c index 6fd812a..0e7ab2b 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -33,6 +33,7 @@ static const char *ATT_SENSOR_COLOR = "color"; static const char *ATT_SENSOR_ENABLED = "enabled"; static const char *ATT_SENSOR_NAME = "name"; static const char *ATT_SENSOR_APPINDICATOR_DISABLED = "appindicator/disabled"; +static const char *ATT_SENSOR_POSITION = "position"; static const char *KEY_SENSOR_UPDATE_INTERVAL = "/apps/psensor/sensor/update_interval"; @@ -366,6 +367,27 @@ void config_set_sensor_name(const char *sid, const char *name) free(key); } +int config_get_sensor_position(const char *sid) +{ + char *key; + int pos; + + key = get_sensor_att_key(sid, ATT_SENSOR_POSITION); + pos = gconf_client_get_int(client, key, NULL); + free(key); + + return pos; +} + +void config_set_sensor_position(const char *sid, int pos) +{ + char *key; + + key = get_sensor_att_key(sid, ATT_SENSOR_POSITION); + gconf_client_set_int(client, key, pos, NULL); + free(key); +} + bool config_is_appindicator_enabled(const char *sid) { char *key; @@ -397,7 +419,6 @@ static void set_slog_enabled(bool enabled) gconf_client_set_bool(client, KEY_SLOG_ENABLED, enabled, NULL); } - void config_slog_enabled_notify_add(GConfClientNotifyFunc cbk, void *data) { log_debug("config_slog_enabled_notify_add");