From 8a6f69f2c87b3a13ce4705f2f6ca0c6dcc9a89cb Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Tue, 20 Jul 2021 12:21:59 +0200 Subject: [PATCH] SoundPlayer: Use full path for playlist items This fixes an issue with not opening tracks if they have been placed in a subfolder. --- .../SoundPlayer/SoundPlayerWidgetAdvancedView.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp index 294b3dfd17..c2b8ceb2cf 100644 --- a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp +++ b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp @@ -288,13 +288,12 @@ void SoundPlayerWidgetAdvancedView::try_fill_missing_info(Vector& entr LexicalPath playlist_path(playlist_p); Vector to_delete; for (auto& entry : entries) { - LexicalPath entry_path(entry.path); - if (!entry_path.is_absolute()) { - entry.path = String::formatted("{}/{}", playlist_path.dirname(), entry_path.basename()); + if (!LexicalPath(entry.path).is_absolute()) { + entry.path = String::formatted("{}/{}", playlist_path.dirname(), entry.path); } if (!Core::File::exists(entry.path)) { - GUI::MessageBox::show(window(), String::formatted("The file \"{}\" present in the playlist does not exist or was not found. This file will be ignored.", entry_path.basename()), "Error reading playlist", GUI::MessageBox::Type::Warning); + GUI::MessageBox::show(window(), String::formatted("The file \"{}\" present in the playlist does not exist or was not found. This file will be ignored.", entry.path), "Error reading playlist", GUI::MessageBox::Type::Warning); to_delete.append(&entry); continue; }