X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-conf.c;h=09f6d68a124b5cabaa2c6e5d07fb0aefc1be4c14;hb=cdfb21de2cbbf921b4e1fe0662439da1c460eabc;hp=e917ecebb87f294fd1b4b8e3a6e15a69af023cb1;hpb=b2b2b0a29f80de89d96bcceea90f117930ab47b9;p=pspp diff --git a/src/ui/gui/psppire-conf.c b/src/ui/gui/psppire-conf.c index e917ecebb8..09f6d68a12 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