From ceed179e7cb91bdfc5545db6ae95e2d2c0599e4d Mon Sep 17 00:00:00 2001 From: Jeroen Ruigrok van der Werven Date: Mon, 1 Jan 2024 22:22:54 +0100 Subject: [PATCH] Only push directory if we find a MO INI file --- 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)); } }