mirror of
https://github.com/ModOrganizer2/modorganizer-diagnose_basic.git
synced 2026-07-27 14:03:10 -07:00
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
043f45ab70 | ||
|
|
fb294651c3 | ||
|
|
f4e1b296ad | ||
|
|
bd55424d8e | ||
|
|
d56a520815 | ||
|
|
fe8966e279 | ||
|
|
98bd1d4780 | ||
|
|
c345cacbc9 | ||
|
|
b78ae57ed4 |
@@ -9,6 +9,10 @@ env.AppendUnique(CPPDEFINES = [
|
||||
'_SCL_SECURE_NO_WARNINGS'
|
||||
])
|
||||
|
||||
# Boost produces very long names with msvc truncates. Doesn't seem to cause
|
||||
# problems.
|
||||
env.AppendUnique(CPPFLAGS = [ '-wd4503' ])
|
||||
|
||||
env.AppendUnique(CPPPATH = [
|
||||
'${BOOSTPATH}'
|
||||
])
|
||||
|
||||
+42
-9
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
|
||||
#include "diagnosebasic.h"
|
||||
|
||||
#include "filenamestring.h"
|
||||
#include <report.h>
|
||||
#include <utility.h>
|
||||
#include <imodlist.h>
|
||||
@@ -26,6 +28,7 @@
|
||||
#include <QtPlugin>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QDebug>
|
||||
#include <QCoreApplication>
|
||||
#include <QMessageBox>
|
||||
@@ -108,7 +111,10 @@ QList<PluginSetting> DiagnoseBasic::settings() const
|
||||
<< PluginSetting("check_font", tr("Warn when the font configuration refers to files that aren't installed"), true)
|
||||
<< PluginSetting("check_conflict", tr("Warn when mods are installed that conflict with MO functionality"), true)
|
||||
<< PluginSetting("check_modorder", tr("Warn when MO determins the mod order may cause problems"), true)
|
||||
<< PluginSetting("check_missingmasters", tr("Warn when there are esps with missing masters"), true);
|
||||
<< PluginSetting("check_missingmasters", tr("Warn when there are esps with missing masters"), true)
|
||||
<< PluginSetting("ow_ignore_empty", tr("Ignore empty directories when checking overwrite directory"), false)
|
||||
<< PluginSetting("ow_ignore_log", tr("Ignore .log files and empty directories when checking overwrite directory"), false)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -160,11 +166,39 @@ bool DiagnoseBasic::errorReported() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DiagnoseBasic::checkEmpty(QString const &path) const
|
||||
{
|
||||
QDir dir(path);
|
||||
dir.setFilter(QDir::Files | QDir::Hidden | QDir::System);
|
||||
|
||||
//Search files first
|
||||
for (QString const &f : dir.entryList()) {
|
||||
FileNameString file(f);
|
||||
if (! m_MOInfo->pluginSetting(name(), "ow_ignore_log").toBool() ||
|
||||
! file.endsWith(".log")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Then directories
|
||||
dir.setFilter(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
|
||||
for (QFileInfo const &subdir : dir.entryInfoList()) {
|
||||
if (!checkEmpty(subdir.absoluteFilePath())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DiagnoseBasic::overwriteFiles() const
|
||||
{
|
||||
QDir dir(qApp->property("dataPath").toString() + "/overwrite");
|
||||
|
||||
QString dirname(qApp->property("dataPath").toString() + "/overwrite");
|
||||
if (m_MOInfo->pluginSetting(name(), "ow_ignore_empty").toBool() ||
|
||||
m_MOInfo->pluginSetting(name(), "ow_ignore_log").toBool()) {
|
||||
return !checkEmpty(dirname);
|
||||
}
|
||||
QDir dir(dirname);
|
||||
return dir.count() != 2; // account for . and ..
|
||||
}
|
||||
|
||||
@@ -564,12 +598,11 @@ QString DiagnoseBasic::fullDescription(unsigned int key) const
|
||||
return tr("You have the nitpick skse plugin installed. This plugin is not needed with Mod Organizer because MO already offers the same functionality. "
|
||||
"Worse: The two solutions may conflict so it's strongly suggested you remove this plugin.");
|
||||
case PROBLEM_ASSETORDER: {
|
||||
QString res = tr("The conflict resolution order for some mods containing scripts differs from that of the corresponding esp.<br>"
|
||||
"This may lead to subtle, hard to locate bugs. <b>You should re-order the affected mods (<font color=\"red\">left list!</font>).</b><br>"
|
||||
"There is no way to reliably know if each of these changes is absolutely necessary but its definitively safer.<br>"
|
||||
"If someone suggested you ignore this message, please give them a proper slapping from me. <b>Do not ignore this warning</b><br>"
|
||||
"The following changes should prevent these kinds of errors:") + "<ul>";
|
||||
foreach(const Move &op, m_SuggestedMoves) {
|
||||
QString res = tr("The conflict resolution order for some mods with scripts differs from that of the corresponding esp.<br>"
|
||||
"This may lead to subtle, hard to locate bugs.<br>"
|
||||
"<b>Please first ensure your load order is correct!</b><br>"
|
||||
"If it is you should re-order the affected mods (<b><font color=\"red\">left list!</font></b>) like this:") + "<br><ul>";
|
||||
for (const Move &op : m_SuggestedMoves) {
|
||||
QString itemName = m_MOInfo->modList()->displayName(op.item.modName);
|
||||
QString referenceName = m_MOInfo->modList()->displayName(op.reference.modName);
|
||||
if (op.type == Move::BEFORE) {
|
||||
|
||||
@@ -124,6 +124,7 @@ private:
|
||||
private:
|
||||
|
||||
void topoSort(std::vector<ListElement> &list) const;
|
||||
bool checkEmpty(const QString &path) const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user