[aisleriot] sol: Fix game options saving when using key files
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aisleriot] sol: Fix game options saving when using key files
- Date: Sun, 4 Dec 2011 19:32:40 +0000 (UTC)
commit 318ef91245e05921222b801688a7542344abb032
Author: Christian Persch <chpe gnome org>
Date: Sun Dec 4 20:32:14 2011 +0100
sol: Fix game options saving when using key files
src/conf.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/conf.c b/src/conf.c
index 733856e..408653c 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -81,7 +81,11 @@ options_gconf_key (const char *game_module)
static char *
game_module_to_game_name (const char *game_module)
{
- return g_strdelimit (g_strconcat (game_module, ".scm", NULL), "-", '_');
+ char *game_name;
+
+ game_name = g_strdelimit (g_strconcat (game_module, ".scm", NULL), "-", '_');
+
+ return game_name;
}
static void
@@ -250,8 +254,11 @@ aisleriot_conf_get_options (const char *game_module,
return TRUE;
#else
GError *error = NULL;
+ char *game_name;
- *options = ar_conf_get_integer (game_module, "Options", &error);
+ game_name = game_module_to_game_name (game_module);
+ *options = ar_conf_get_integer (game_name, "Options", &error);
+ g_free (game_name);
if (error) {
g_error_free (error);
return FALSE;
@@ -302,7 +309,11 @@ aisleriot_conf_set_options (const char *game_module,
gconf_client_set_int (gconf_client, gconf_key, value, NULL);
g_free (gconf_key);
#else
- ar_conf_set_integer (game_module, "Options", value);
+ char *game_name;
+
+ game_name = game_module_to_game_name (game_module);
+ ar_conf_set_integer (game_name, "Options", value);
+ g_free (game_name);
#endif /* HAVE_GNOME */
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]