This commit is contained in:
twinaphex 2017-11-25 21:45:28 +01:00
parent 7f3738d3cd
commit c992d92c99

View File

@ -1443,14 +1443,19 @@ static int action_ok_file_load(const char *path,
return 0; return 0;
} }
static void generic_playlist_update_write(size_t idx, static void generic_playlist_update_write(
playlist_t *plist,
size_t idx,
const char *core_display_name, const char *core_display_name,
const char *label, const char *label,
const char *path) const char *path)
{ {
playlist_t *playlist = NULL; playlist_t *playlist = NULL;
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist); if (plist)
playlist = plist;
else
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist);
retro_assert(playlist != NULL); retro_assert(playlist != NULL);
@ -1561,15 +1566,12 @@ static int action_ok_playlist_entry_collection(const char *path,
strlcpy(new_display_name, strlcpy(new_display_name,
core_info.inf->display_name, sizeof(new_display_name)); core_info.inf->display_name, sizeof(new_display_name));
playlist_update(tmp_playlist,
generic_playlist_update_write(tmp_playlist,
selection_ptr, selection_ptr,
NULL,
NULL,
new_core_path,
new_display_name, new_display_name,
NULL, NULL,
NULL); new_core_path);
playlist_write_file(tmp_playlist);
} }
else else
{ {
@ -1655,7 +1657,8 @@ static int action_ok_playlist_entry(const char *path,
new_display_name = strdup(core_info.inf->display_name); new_display_name = strdup(core_info.inf->display_name);
generic_playlist_update_write(selection_ptr, generic_playlist_update_write(NULL,
selection_ptr,
new_display_name, new_display_name,
NULL, NULL,
new_core_path); new_core_path);
@ -1766,15 +1769,13 @@ static int action_ok_playlist_entry_start_content(const char *path,
strlcpy(new_display_name, strlcpy(new_display_name,
core_info.inf->display_name, sizeof(new_display_name)); core_info.inf->display_name, sizeof(new_display_name));
playlist_update(tmp_playlist,
generic_playlist_update_write(
tmp_playlist,
selection_ptr, selection_ptr,
NULL,
NULL,
new_core_path,
new_display_name, new_display_name,
NULL, NULL,
NULL); new_core_path);
playlist_write_file(tmp_playlist);
} }
playlist_info.data = playlist; playlist_info.data = playlist;
@ -1948,7 +1949,8 @@ static void menu_input_st_string_cb_rename_entry(void *userdata,
const char *label = menu_input_dialog_get_buffer(); const char *label = menu_input_dialog_get_buffer();
if (!string_is_empty(label)) if (!string_is_empty(label))
generic_playlist_update_write(menu_input_dialog_get_kb_idx(), generic_playlist_update_write(NULL,
menu_input_dialog_get_kb_idx(),
NULL, NULL,
label, label,
NULL); NULL);
@ -2325,7 +2327,8 @@ static int action_ok_core_deferred_set(const char *path,
core_display_name[0] = '\0'; core_display_name[0] = '\0';
core_info_get_name(path, core_display_name, sizeof(core_display_name)); core_info_get_name(path, core_display_name, sizeof(core_display_name));
generic_playlist_update_write(rdb_entry_start_game_selection_ptr, generic_playlist_update_write(NULL,
rdb_entry_start_game_selection_ptr,
core_display_name, NULL, path); core_display_name, NULL, path);
menu_entries_pop_stack(&selection, 0, 1); menu_entries_pop_stack(&selection, 0, 1);
@ -2343,7 +2346,8 @@ static int action_ok_core_deferred_set_current_core(const char *path,
core_display_name[0] = '\0'; core_display_name[0] = '\0';
core_info_get_name(path, core_display_name, sizeof(core_display_name)); core_info_get_name(path, core_display_name, sizeof(core_display_name));
generic_playlist_update_write(rdb_entry_start_game_selection_ptr, generic_playlist_update_write(NULL,
rdb_entry_start_game_selection_ptr,
core_display_name, NULL, path); core_display_name, NULL, path);
menu_entries_pop_stack(&selection, 0, 1); menu_entries_pop_stack(&selection, 0, 1);