From 919723a7ca0e0180a7beb540f6c29d4aaae57e57 Mon Sep 17 00:00:00 2001 From: jdgordon Date: Mon, 21 Dec 2009 05:44:00 +0000 Subject: [PATCH] Fix FS#9660 - make warn on playlist erase work correctly when creating a new playlist from the database (a bit of a hack, but not bad enough to outright reject) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24089 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist.c | 5 ++++- apps/playlist.h | 1 + apps/tagtree.c | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/playlist.c b/apps/playlist.c index fba9b6f4b..133820ebc 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -2776,7 +2776,10 @@ int playlist_set_current(struct playlist_info* playlist) return 0; } - +struct playlist_info *playlist_get_current(void) +{ + return ¤t_playlist; +} /* * Close files and delete control file for non-current playlist. */ diff --git a/apps/playlist.h b/apps/playlist.h index fa234f6c1..638e3949b 100644 --- a/apps/playlist.h +++ b/apps/playlist.h @@ -135,6 +135,7 @@ int playlist_update_resume_info(const struct mp3entry* id3); int playlist_get_display_index(void); int playlist_amount(void); void playlist_set_last_shuffled_start(void); +struct playlist_info *playlist_get_current(void); /* Exported functions for all playlists. Pass NULL for playlist_info structure to work with current playlist. */ diff --git a/apps/tagtree.c b/apps/tagtree.c index 4b67b73ca..ef9c9d2de 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -1507,7 +1507,6 @@ int tagtree_enter(struct tree_context* c) allow user to cancel the operation */ if (!warn_on_pl_erase()) break; - if (tagtree_play_folder(c) >= 0) rc = 2; break; @@ -1729,7 +1728,7 @@ static int tagtree_play_folder(struct tree_context* c) gui_synclist_select_item(&tree_lists, c->selected_item); playlist_start(c->selected_item,0); - + playlist_get_current()->num_inserted_tracks = 0; /* make warn on playlist erase work */ return 0; } -- 2.11.4.GIT