From aded236b0ca04ed7bc9b70ed04112b451bcc1728 Mon Sep 17 00:00:00 2001 From: Joni Kokko Date: Wed, 28 Jan 2009 15:12:52 +0200 Subject: [PATCH] Changed hardkey ids to start from 1 --- irreco/src/core/irreco_config.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/irreco/src/core/irreco_config.c b/irreco/src/core/irreco_config.c index 4c0ea900..972853ff 100644 --- a/irreco/src/core/irreco_config.c +++ b/irreco/src/core/irreco_config.c @@ -64,7 +64,7 @@ void irreco_config_read_layout_from_keyfile(IrrecoData * irreco_data, void irreco_config_save_layout_to_keyfile(GKeyFile * keyfile, IrrecoButtonLayout * layout, gint * command_index, - gint * hardkey_index); + gint * hardkey_id); void irreco_config_save_hardkey_to_file(IrrecoHardkeyMap *hardkey_map, guint keyval, IrrecoCmdChainId chain_id, @@ -577,7 +577,7 @@ struct _IrrecoConfigCmdAndButton { typedef struct _IrrecoConfigSaveHardkeyData IrrecoConfigSaveHardkeyData; struct _IrrecoConfigSaveHardkeyData { GKeyFile *keyfile; - gint *hardkey_index; + gint hardkey_index; IrrecoButtonLayout *layout; gint *hardkey_id; }; @@ -593,7 +593,7 @@ struct _IrrecoConfigSaveHardkeyData { gboolean irreco_config_save_layouts(IrrecoData * irreco_data) { gint command_index = 1; - gint hardkey_index = 1; + gint hardkey_id = 1; GKeyFile *keyfile; IrrecoStringTable *table; gboolean success; @@ -610,7 +610,7 @@ gboolean irreco_config_save_layouts(IrrecoData * irreco_data) irreco_config_save_layout_to_keyfile(keyfile, layout, &command_index, - &hardkey_index); + &hardkey_id); filename = irreco_create_uniq_layout_filename( layout->filename->str); @@ -702,7 +702,7 @@ static void irreco_config_cmd_chain_save(gpointer key, void irreco_config_save_layout_to_keyfile(GKeyFile * keyfile, IrrecoButtonLayout * layout, gint * command_index, - gint * hardkey_index) + gint * hardkey_id) { GdkColor *color; gint button_index = 1; @@ -736,9 +736,9 @@ void irreco_config_save_layout_to_keyfile(GKeyFile * keyfile, /* Save Hardkeys. */ hardkey_data.keyfile = keyfile; - hardkey_data.hardkey_index = hardkey_index; + hardkey_data.hardkey_index = 1; hardkey_data.layout = layout; - hardkey_data.hardkey_id = hardkey_index; + hardkey_data.hardkey_id = hardkey_id; irreco_hardkey_map_chain_foreach(layout->hardkey_map, irreco_config_save_hardkey_to_file, &hardkey_data); @@ -759,7 +759,7 @@ void irreco_config_save_hardkey_to_file(IrrecoHardkeyMap *hardkey_map, hardkey_data = (IrrecoConfigSaveHardkeyData*) user_data; g_snprintf(group, IRRECO_CONFIG_GROUP_LEN, "hardkey-%i", - *hardkey_data->hardkey_index); + hardkey_data->hardkey_index); irreco_gkeyfile_set_string(hardkey_data->keyfile, group, "layout", irreco_button_layout_get_name(hardkey_data->layout)); g_key_file_set_integer(hardkey_data->keyfile, group, @@ -773,7 +773,7 @@ void irreco_config_save_hardkey_to_file(IrrecoHardkeyMap *hardkey_map, irreco_config_save_hardkey_to_keyfile, hardkey_data); - *hardkey_data->hardkey_index = *hardkey_data->hardkey_index + 1; + hardkey_data->hardkey_index = hardkey_data->hardkey_index + 1; IRRECO_RETURN } -- 2.11.4.GIT