From 3d18f0cd38dc8b7dc980772f986944e5f9327dba Mon Sep 17 00:00:00 2001 From: Jeroen Ruigrok van der Werven Date: Sat, 8 Jun 2024 07:56:25 +0200 Subject: [PATCH] Only list instance directory with a MO INI file (#1965) --- src/instancemanager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/instancemanager.cpp b/src/instancemanager.cpp index ce3fb7906..90e9e5190 100644 --- a/src/instancemanager.cpp +++ b/src/instancemanager.cpp @@ -565,15 +565,17 @@ QString InstanceManager::iniPath(const QString& instanceDir) const std::vector InstanceManager::globalInstancePaths() const { - const std::set ignore = {"cache", "qtwebengine"}; - const QDir root(globalInstancesRootPath()); const auto dirs = root.entryList(QDir::Dirs | QDir::NoDotAndDotDot); std::vector list; for (auto&& d : dirs) { - if (!ignore.contains(QFileInfo(d).fileName().toLower())) { + const QFileInfo iniFile(QDir(root.filePath(d)), "ModOrganizer.ini"); + log::debug("Checking for INI at path '{}'", iniFile.absoluteFilePath()); + + if (iniFile.exists()) { + log::debug("Found INI at path '{}'", iniFile.absoluteFilePath()); list.push_back(root.filePath(d)); } }