Use QFileInfo instead of custom functions

This commit is contained in:
Jonas Kvinge
2020-10-18 14:07:48 +02:00
parent 2ad1a60e59
commit 7ca65c81d8
5 changed files with 5 additions and 19 deletions

View File

@@ -115,7 +115,7 @@ QString OrganizeFormat::GetFilenameForSong(const Song &song, QString extension)
if (QFileInfo(filename).completeBaseName().isEmpty()) {
// Avoid having empty filenames, or filenames with extension only: in this case, keep the original filename.
// We remove the extension from "filename" if it exists, as song.basefilename() also contains the extension.
filename = Utilities::PathWithoutFilenameExtension(filename) + song.basefilename();
filename = QFileInfo(filename).path() + "/" + song.basefilename();
}
if (remove_problematic_) filename = filename.remove(kProblematicCharacters);