mirror of
https://github.com/clementine-player/Clementine
synced 2025-02-01 11:56:45 +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 <QSettings>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QDir>
|
||||||
|
|
||||||
#include <projectM.hpp>
|
#include <projectM.hpp>
|
||||||
|
|
||||||
@ -75,11 +76,16 @@ void ProjectMVisualisation::InitProjectM() {
|
|||||||
|
|
||||||
QString preset_path;
|
QString preset_path;
|
||||||
foreach (const QString& path, paths) {
|
foreach (const QString& path, paths) {
|
||||||
if (QFile::exists(path)) {
|
if (!QFile::exists(path))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Don't use empty directories
|
||||||
|
if (QDir(path).entryList(QDir::Files | QDir::NoDotAndDotDot).isEmpty())
|
||||||
|
continue;
|
||||||
|
|
||||||
preset_path = path;
|
preset_path = path;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (preset_path.isNull()) {
|
if (preset_path.isNull()) {
|
||||||
qFatal("ProjectM presets could not be found, search path was:\n %s",
|
qFatal("ProjectM presets could not be found, search path was:\n %s",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user