Skip to content

Commit

Permalink
Only list instance directory with a MO INI file (#1965)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashemedai authored Jun 8, 2024
1 parent a11617f commit 3d18f0c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/instancemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,15 +565,17 @@ QString InstanceManager::iniPath(const QString& instanceDir) const

std::vector<QString> InstanceManager::globalInstancePaths() const
{
const std::set<QString> ignore = {"cache", "qtwebengine"};

const QDir root(globalInstancesRootPath());
const auto dirs = root.entryList(QDir::Dirs | QDir::NoDotAndDotDot);

std::vector<QString> 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));
}
}
Expand Down

0 comments on commit 3d18f0c

Please sign in to comment.