mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Playlist Viewer: Delete playlist when emptied
When you removed all tracks from an on-disk playlist, you were asked whether you wanted to save it, which would fail, but did not show any accompanying message. Instead of trying to save the playlist, after getting the confirmation, delete the playlist file from disk. Change-Id: Iad54f2f490b15dd9c8a8fdfb8f12e58fd17d5e36
This commit is contained in:
parent
0012411fc5
commit
6a865f2430
1 changed files with 8 additions and 2 deletions
|
@ -638,8 +638,14 @@ static void close_playlist_viewer(void)
|
|||
if (viewer.initial_selection)
|
||||
*(viewer.initial_selection) = viewer.selected_track;
|
||||
|
||||
if(playlist_modified(viewer.playlist) && yesno_pop(ID2P(LANG_SAVE_CHANGES)))
|
||||
save_playlist_screen(viewer.playlist);
|
||||
if(playlist_modified(viewer.playlist))
|
||||
{
|
||||
if (viewer.num_tracks && yesno_pop(ID2P(LANG_SAVE_CHANGES)))
|
||||
save_playlist_screen(viewer.playlist);
|
||||
else if (!viewer.num_tracks &&
|
||||
confirm_delete_yesno(viewer.playlist->filename) == YESNO_YES)
|
||||
remove(viewer.playlist->filename);
|
||||
}
|
||||
playlist_close(viewer.playlist);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue