Implement action start callback for ST_PATH and ST_DIR

This commit is contained in:
twinaphex 2014-10-16 18:07:57 +02:00
parent be5914d006
commit e49cad7b68
2 changed files with 18 additions and 7 deletions

View File

@ -114,7 +114,8 @@ static int menu_entries_set_current_path_selection(
setting->cmd_trigger.triggered = true;
break;
case MENU_ACTION_START:
*setting->value.string = '\0';
if (setting->action_start)
setting->action_start(setting);
break;
}

View File

@ -1071,14 +1071,24 @@ rarch_setting_t setting_data_string_setting(enum setting_type type,
rarch_setting_t result = { type, name, size, short_description, group,
subgroup };
result.dir.empty_path = empty;
result.change_handler = change_handler;
result.read_handler = read_handler;
result.value.string = target;
result.dir.empty_path = empty;
result.change_handler = change_handler;
result.read_handler = read_handler;
result.value.string = target;
result.default_value.string = default_value;
result.action_start = NULL;
if (type == ST_DIR)
result.action_start = setting_data_string_dir_action_start_default;
switch (type)
{
case ST_DIR:
result.action_start = setting_data_string_dir_action_start_default;
break;
case ST_PATH:
result.action_start = setting_data_string_dir_action_start_default;
break;
default:
break;
}
return result;
}