From f06e76301ed56a4e6619a1495ec8c34b12506a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 29 Aug 2016 02:22:05 +0200 Subject: [PATCH] (Menu) Get Remove from Playlist to work on history playlists --- menu/cbs/menu_cbs_ok.c | 9 +++++++++ playlist.c | 19 ------------------- playlist.h | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 620be2fb59..6072a2d0e8 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -2544,6 +2544,15 @@ static int action_ok_delete_entry(const char *path, menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist); + if (!strcmp(playlist->conf_path, g_defaults.music_history->conf_path)) + playlist = g_defaults.music_history; + else if (!strcmp(playlist->conf_path, g_defaults.video_history->conf_path)) + playlist = g_defaults.video_history; + else if (!strcmp(playlist->conf_path, g_defaults.image_history->conf_path)) + playlist = g_defaults.image_history; + else if (!strcmp(playlist->conf_path, g_defaults.content_history->conf_path)) + playlist = g_defaults.content_history; + playlist_delete_index(playlist, rpl_entry_selection_ptr); size_t new_selection_ptr; diff --git a/playlist.c b/playlist.c index 5ad11904a4..d53848ea7e 100644 --- a/playlist.c +++ b/playlist.c @@ -33,25 +33,6 @@ #define PLAYLIST_ENTRIES 6 #endif -struct playlist_entry -{ - char *path; - char *label; - char *core_path; - char *core_name; - char *db_name; - char *crc32; -}; - -struct content_playlist -{ - struct playlist_entry *entries; - size_t size; - size_t cap; - - char *conf_path; -}; - typedef int (playlist_sort_fun_t)( const struct playlist_entry *a, const struct playlist_entry *b); diff --git a/playlist.h b/playlist.h index eee10c7ba2..f147f78224 100644 --- a/playlist.h +++ b/playlist.h @@ -27,6 +27,25 @@ RETRO_BEGIN_DECLS typedef struct content_playlist playlist_t; +struct playlist_entry +{ + char *path; + char *label; + char *core_path; + char *core_name; + char *db_name; + char *crc32; +}; + +struct content_playlist +{ + struct playlist_entry *entries; + size_t size; + size_t cap; + + char *conf_path; +}; + /** * playlist_init: * @path : Path to playlist contents file.