X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-conf.c;h=561f933ff061369243647d6e791e471072adac29;hb=d6fb2728eb8a99e89165c45d8e5d4a482114d3a0;hp=fe4f934bd640193e382f1fc077c7ff661f91850b;hpb=7a48928f76e0f4599be8f65b1b3bafd03d73a628;p=pspp diff --git a/src/ui/gui/psppire-conf.c b/src/ui/gui/psppire-conf.c index fe4f934bd6..561f933ff0 100644 --- a/src/ui/gui/psppire-conf.c +++ b/src/ui/gui/psppire-conf.c @@ -223,6 +223,31 @@ psppire_conf_get_boolean (PsppireConf *conf, const gchar *base, } + +gboolean +psppire_conf_get_string (PsppireConf *conf, const gchar *base, + const gchar *name, gchar **value) +{ + gboolean ok; + gchar *b; + GError *err = NULL; + conf_read (conf); + b = g_key_file_get_string (conf->keyfile, + base, + name, &err); + + ok = (err == NULL); + if ( err != NULL ) + g_error_free (err); + + if (ok) + *value = b; + + return ok; +} + + + void psppire_conf_set_int (PsppireConf *conf, const gchar *base, const gchar *name, @@ -241,6 +266,18 @@ psppire_conf_set_boolean (PsppireConf *conf, conf_write (conf); } + +void +psppire_conf_set_string (PsppireConf *conf, + const gchar *base, const gchar *name, + const gchar *value) +{ + g_key_file_set_string (conf->keyfile, base, name, value); + conf_write (conf); +} + + + /* A convenience function to set the geometry of a window from from a saved config