mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Delete bookmarks when replacing unrelated playlist
After saving a playlist to an existing file with a different name, any saved bookmarks for the old playlist were still displayed for the new one. Change-Id: Ic2666bdaf7ec6e25456283fc15760c568dd7ac38
This commit is contained in:
parent
e43c703480
commit
8f3cb75df0
1 changed files with 10 additions and 0 deletions
|
@ -411,6 +411,7 @@ static int remove_extension(char* path)
|
||||||
bool catalog_pick_new_playlist_name(char *pl_name, size_t buf_size,
|
bool catalog_pick_new_playlist_name(char *pl_name, size_t buf_size,
|
||||||
const char* curr_pl_name)
|
const char* curr_pl_name)
|
||||||
{
|
{
|
||||||
|
char bmark_file[MAX_PATH + 7];
|
||||||
bool do_save = false;
|
bool do_save = false;
|
||||||
while (!do_save && !remove_extension(pl_name) &&
|
while (!do_save && !remove_extension(pl_name) &&
|
||||||
!kbd_input(pl_name, buf_size - 7, NULL))
|
!kbd_input(pl_name, buf_size - 7, NULL))
|
||||||
|
@ -421,7 +422,16 @@ bool catalog_pick_new_playlist_name(char *pl_name, size_t buf_size,
|
||||||
/* warn before overwriting existing (different) playlist */
|
/* warn before overwriting existing (different) playlist */
|
||||||
if ((!curr_pl_name || strcmp(curr_pl_name, pl_name)) &&
|
if ((!curr_pl_name || strcmp(curr_pl_name, pl_name)) &&
|
||||||
file_exists(pl_name))
|
file_exists(pl_name))
|
||||||
|
{
|
||||||
do_save = confirm_overwrite_yesno() == YESNO_YES;
|
do_save = confirm_overwrite_yesno() == YESNO_YES;
|
||||||
|
|
||||||
|
if (do_save) /* delete bookmark file unrelated to new playlist */
|
||||||
|
{
|
||||||
|
snprintf(bmark_file, sizeof(bmark_file), "%s.bmark", pl_name);
|
||||||
|
if (file_exists(bmark_file))
|
||||||
|
remove(bmark_file);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return do_save;
|
return do_save;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue