From: John Darrington Date: Mon, 20 Apr 2009 12:59:29 +0000 (+0800) Subject: Revert "Made psppire-conf thread safer" X-Git-Tag: v0.7.3~144 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=6d92819eef56352a284f410ac7e356afa4a4ce35 Revert "Made psppire-conf thread safer" This reverts commit 2d983f3e5bd2d5f531cbcbdcebe078034ddb8955. --- diff --git a/src/ui/gui/psppire-conf.c b/src/ui/gui/psppire-conf.c index ed2f9178..4090b74c 100644 --- a/src/ui/gui/psppire-conf.c +++ b/src/ui/gui/psppire-conf.c @@ -95,7 +95,6 @@ static void psppire_conf_finalize (GObject *object) { PsppireConf *conf = PSPPIRE_CONF (object); - g_mutex_free (conf->mutex); g_key_file_free (conf->keyfile); g_free (conf->filename); } @@ -134,6 +133,7 @@ psppire_conf_class_init (PsppireConfClass *class) object_class->finalize = psppire_conf_finalize; object_class->dispose = psppire_conf_dispose; object_class->constructor = psppire_conf_construct; + } @@ -142,8 +142,6 @@ psppire_conf_init (PsppireConf *conf) { const gchar *dirname = g_get_user_config_dir (); - conf->mutex = g_mutex_new (); - conf->filename = g_strdup_printf ("%s/%s", dirname, "psppirerc"); conf->keyfile = g_key_file_new (); @@ -166,8 +164,6 @@ psppire_conf_get_int (PsppireConf *conf, const gchar *base, { gboolean ok; GError *err = NULL; - - g_mutex_lock (conf->mutex); conf_read (conf); *value = g_key_file_get_integer (conf->keyfile, base, @@ -177,9 +173,6 @@ psppire_conf_get_int (PsppireConf *conf, const gchar *base, if ( err != NULL ) g_error_free (err); - - g_mutex_unlock (conf->mutex); - return ok; } @@ -190,8 +183,6 @@ psppire_conf_get_boolean (PsppireConf *conf, const gchar *base, gboolean ok; gboolean b; GError *err = NULL; - g_mutex_lock (conf->mutex); - conf_read (conf); b = g_key_file_get_boolean (conf->keyfile, base, @@ -204,8 +195,6 @@ psppire_conf_get_boolean (PsppireConf *conf, const gchar *base, if (ok) *value = b; - g_mutex_unlock (conf->mutex); - return ok; } @@ -215,10 +204,8 @@ psppire_conf_set_int (PsppireConf *conf, const gchar *base, const gchar *name, gint value) { - g_mutex_lock (conf->mutex); g_key_file_set_integer (conf->keyfile, base, name, value); conf_write (conf); - g_mutex_unlock (conf->mutex); } void @@ -226,10 +213,8 @@ psppire_conf_set_boolean (PsppireConf *conf, const gchar *base, const gchar *name, gboolean value) { - g_mutex_lock (conf->mutex); g_key_file_set_boolean (conf->keyfile, base, name, value); conf_write (conf); - g_mutex_unlock (conf->mutex); } /* diff --git a/src/ui/gui/psppire-conf.h b/src/ui/gui/psppire-conf.h index 7e9ab6ad..a7415b24 100644 --- a/src/ui/gui/psppire-conf.h +++ b/src/ui/gui/psppire-conf.h @@ -61,7 +61,6 @@ struct _PsppireConf gboolean dispose_has_run ; GKeyFile *keyfile; - GMutex *mutex; gchar *filename; };