Check that Qt version is higher than 5.9 to use QDir::isEmpty()

This commit is contained in:
Jonas Kvinge
2020-02-29 21:40:20 +01:00
parent 6a2be22fa1
commit 72913ceb1a

View File

@@ -74,11 +74,13 @@ bool FilesystemMusicStorage::CopyToStorage(const CopyJob &job) {
QFile::rename(cover_src.absoluteFilePath(), cover_dest.absoluteFilePath());
}
// Remove empty directories.
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
QDir remove_dir(src.absolutePath(), QString(), QDir::Name, QDir::NoDotAndDotDot);
while (remove_dir.isEmpty()) {
if (!QDir().rmdir(remove_dir.absolutePath())) break;
remove_dir.cdUp();
}
#endif
}
else {
if (!dest.exists()) {