Commit 6e9637f8 authored by Geoffrey Métais's avatar Geoffrey Métais

Use specific dialog for playlist deletion

Fixes #14357  Common delete dialog was deleting provided path anyway
parent d22a1060
......@@ -37,6 +37,7 @@
<string name="set_song">Set as ringtone</string>
<string name="info">Information</string>
<string name="confirm_delete">Delete the file \'%1$s\'?</string>
<string name="confirm_delete_playlist">Delete playlist \'%1$s\'?</string>
<string name="ringtone_set">The file \'%1$s\' was set as the ringtone.</string>
<string name="ringtone_error">An error occurred while setting the ringtone.</string>
<string name="pause">Pause</string>
......@@ -64,6 +64,23 @@ public class CommonDialogs {
public static AlertDialog deletePlaylist(final Context context,
final String name,
final VLCRunnable runnable) {
return confirmDialog(
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (runnable != null);
public static AlertDialog confirmDialog(final Context context,
final String confirmationString,
final DialogInterface.OnClickListener callback) {
......@@ -437,14 +437,13 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements SwipeR
List<MediaWrapper> mediaList = adapter.getMedias(groupPosition);
if (adapter.getCount() <= groupPosition || mediaList == null || mediaList.isEmpty())
return false;
AlertDialog alertDialog = CommonDialogs.deleteMedia(
AlertDialog alertDialog = CommonDialogs.deletePlaylist(
new VLCRunnable(adapter.getItem(groupPosition)) {
public void run(Object o) {
AudioBrowserListAdapter.ListItem listItem = (AudioBrowserListAdapter.ListItem)o;
AudioBrowserListAdapter.ListItem listItem = (AudioBrowserListAdapter.ListItem) o;
if (!MediaDatabase.getInstance().playlistExists(listItem.mTitle)) {
MediaWrapper media = listItem.mMediaList.get(0);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment