mirror of
https://github.com/ModOrganizer2/modorganizer-diagnose_basic.git
synced 2026-07-27 14:03:10 -07:00
Skip empty mod dirs when evaluating overwrite
This commit is contained in:
+13
-1
@@ -204,10 +204,22 @@ bool DiagnoseBasic::overwriteFiles() const
|
||||
//QString dirname(qApp->property("dataPath").toString() + "/overwrite");
|
||||
QString dirname(m_MOInfo->overwritePath());
|
||||
if (m_MOInfo->pluginSetting(name(), "ow_ignore_empty").toBool() ||
|
||||
m_MOInfo->pluginSetting(name(), "ow_ignore_log").toBool()) {
|
||||
m_MOInfo->pluginSetting(name(), "ow_ignore_log").toBool()) {
|
||||
return !checkEmpty(dirname);
|
||||
}
|
||||
QDir dir(dirname);
|
||||
bool checkDirs = m_MOInfo->managedGame()->getModMappings().keys().size() > 1 || m_MOInfo->managedGame()->getModMappings().keys().first() != "";
|
||||
if (checkDirs) {
|
||||
bool empty = true;
|
||||
for (auto dir : m_MOInfo->managedGame()->getModMappings().keys()) {
|
||||
auto mapDir = QDir(dirname).filePath(dir);
|
||||
if (QDir(mapDir).exists()) {
|
||||
empty = QDir(mapDir).count() == 2; // account for . and ..
|
||||
}
|
||||
if (!empty) break;
|
||||
}
|
||||
return !empty;
|
||||
}
|
||||
return dir.count() != 2; // account for . and ..
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user