diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2023-11-19 01:12:36 +0100 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2023-11-19 01:13:49 +0100 |
commit | a7d0ff200066ff4d102ffff9e24d3c2b8ef7fde5 (patch) | |
tree | e59eb45e671daa85505e878cfd7b73db86aa9071 | |
parent | 35f9a5b41501502d6bb21cad64be515a73bc360c (diff) | |
download | rockbox-a7d0ff2000.tar.gz rockbox-a7d0ff2000.zip |
Playlist Viewer: Reload indices after saving currently playing playlist
First index may have changed
Change-Id: If6c2fbb42014610aeae48918168c32ca82fb9b5b
-rw-r--r-- | apps/playlist_viewer.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index d0fc9a8370..1d8b1b1b03 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c @@ -81,6 +81,7 @@ enum pv_onplay_result { PV_ONPLAY_ITEM_REMOVED, PV_ONPLAY_CHANGED, PV_ONPLAY_UNCHANGED, + PV_ONPLAY_SAVED, }; struct playlist_buffer @@ -661,7 +662,8 @@ static enum pv_onplay_result onplay_menu(int index) break; case 6: save_playlist_screen(viewer.playlist); - ret = PV_ONPLAY_UNCHANGED; + /* playlist indices of current playlist may have changed */ + ret = viewer.playlist ? PV_ONPLAY_UNCHANGED : PV_ONPLAY_SAVED; break; case 7: /* playlist viewer settings */ @@ -784,11 +786,9 @@ static int playlist_callback_voice(int selected_item, void *data) static void update_lists(struct gui_synclist * playlist_lists, bool init) { if (init) - { gui_synclist_init(playlist_lists, playlist_callback_name, &viewer, false, 1, NULL); - gui_synclist_set_nb_items(playlist_lists, viewer.num_tracks); - } + gui_synclist_set_nb_items(playlist_lists, viewer.num_tracks); gui_synclist_set_voice_callback(playlist_lists, global_settings.talk_file? &playlist_callback_voice:NULL); @@ -805,9 +805,11 @@ static bool update_viewer_with_changes(struct gui_synclist *playlist_lists, enum { bool exit = false; if (res == PV_ONPLAY_CHANGED || + res == PV_ONPLAY_SAVED || res == PV_ONPLAY_ITEM_REMOVED) { - playlist_set_modified(viewer.playlist, true); + if (res != PV_ONPLAY_SAVED) + playlist_set_modified(viewer.playlist, true); if (res == PV_ONPLAY_ITEM_REMOVED) gui_synclist_del_item(playlist_lists); |