mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-20 21:42:27 +01:00
Don't try to load projectM presets from an empty directory
This commit is contained in:
parent
0d8019de0d
commit
72fec9a8d1
@ -28,6 +28,7 @@
|
||||
#include <QSettings>
|
||||
#include <QCoreApplication>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
|
||||
#include <projectM.hpp>
|
||||
|
||||
@ -75,10 +76,15 @@ void ProjectMVisualisation::InitProjectM() {
|
||||
|
||||
QString preset_path;
|
||||
foreach (const QString& path, paths) {
|
||||
if (QFile::exists(path)) {
|
||||
preset_path = path;
|
||||
break;
|
||||
}
|
||||
if (!QFile::exists(path))
|
||||
continue;
|
||||
|
||||
// Don't use empty directories
|
||||
if (QDir(path).entryList(QDir::Files | QDir::NoDotAndDotDot).isEmpty())
|
||||
continue;
|
||||
|
||||
preset_path = path;
|
||||
break;
|
||||
}
|
||||
|
||||
if (preset_path.isNull()) {
|
||||
|
Loading…
Reference in New Issue
Block a user