Compare commits

..
Author SHA1 Message Date
Tannin 043f45ab70 Merge 2015-08-31 21:26:47 +02:00
Tom Tanner fb294651c3 Merge 2015-08-28 20:04:15 +01:00
Tannin f4e1b296ad Merge 2015-08-27 20:59:37 +02:00
Tom Tanner bd55424d8e Small fix to shut up messages about long boost names 2015-08-20 19:53:39 +01:00
Tannin d56a520815 Simplified the PMOP message 2015-08-19 19:05:15 +02:00
Tannin fe8966e279 small code beautification 2015-07-07 20:53:38 +02:00
Tom Tanner 98bd1d4780 And now I find the place I should have altered.
Added some options to the diagnosis plugin to ignore .log files and empty
directories in overwrite folder
2015-06-24 20:46:31 +01:00
Tom Tanner c345cacbc9 and now I find out I don't need to do it at all 2015-06-23 20:27:38 +01:00
Tom Tanner b78ae57ed4 Factor out general, nexis, plugins tab code into individual classes
Add some code and page to control what is/isn't significant in overwrite
2015-06-20 15:37:32 +01:00
3 changed files with 47 additions and 9 deletions
+4
View File
@@ -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
View File
@@ -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) {
+1
View File
@@ -124,6 +124,7 @@ private:
private:
void topoSort(std::vector<ListElement> &list) const;
bool checkEmpty(const QString &path) const;
private: