From 2a1260b79e1a63e2d5850f4802c9225f518c0978 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sun, 4 Dec 2022 00:18:55 +0100 Subject: [PATCH] PlaylistParser: Resolve symbolic links when creating relative paths Fixes #1071 --- src/playlistparsers/playlistparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playlistparsers/playlistparser.cpp b/src/playlistparsers/playlistparser.cpp index b7f917f68..b23e986eb 100644 --- a/src/playlistparsers/playlistparser.cpp +++ b/src/playlistparsers/playlistparser.cpp @@ -209,10 +209,10 @@ void PlaylistParser::Save(const SongList &songs, const QString &filename, const } // Open the file - QFile file(filename); + QFile file(path_type == PlaylistSettingsPage::PathType_Absolute ? fileinfo.absoluteFilePath() : fileinfo.canonicalFilePath()); if (!file.open(QIODevice::WriteOnly)) return; - parser->Save(songs, &file, fileinfo.absolutePath(), path_type); + parser->Save(songs, &file, path_type == PlaylistSettingsPage::PathType_Absolute ? fileinfo.absolutePath() : fileinfo.canonicalPath(), path_type); file.close();