mirror of
https://github.com/ModOrganizer2/modorganizer-diagnose_basic.git
synced 2026-07-27 14:03:10 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9531efe2f0 | ||
|
|
7fc98c5d4e | ||
|
|
3b0e5c44ed | ||
|
|
cde4731e5e | ||
|
|
51099bed28 | ||
|
|
5b3d2adac5 | ||
|
|
d56d51e37c | ||
|
|
8d4c514c4d | ||
|
|
aa1b0d725c | ||
|
|
e508f7bcd7 | ||
|
|
477aa4c034 | ||
|
|
33c2867336 | ||
|
|
dd93b7e35e | ||
|
|
c893767bb2 | ||
|
|
cccdc4ece9 | ||
|
|
6b1f817f29 | ||
|
|
409850c044 | ||
|
|
1c8895ed3c | ||
|
|
9a9181621a | ||
|
|
9d4ba2d0d1 | ||
|
|
78b7a0a523 | ||
|
|
ba0a2df34f | ||
|
|
6a037f89a3 | ||
|
|
253c2ad05f | ||
|
|
3e2067a185 | ||
|
|
941ce462e1 | ||
|
|
9d9172b7d1 | ||
|
|
d0acab52df |
+4
-6
@@ -1,12 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(diagnose_basic)
|
||||
set(project_type plugin)
|
||||
set(enable_warnings OFF)
|
||||
|
||||
if(DEFINED DEPENDENCIES_DIR)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/project.cmake)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake)
|
||||
else()
|
||||
include(../cmake_common/project.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake)
|
||||
endif()
|
||||
|
||||
project(diagnose_basic)
|
||||
add_subdirectory(src)
|
||||
|
||||
+15
-7
@@ -5,20 +5,28 @@ environment:
|
||||
WEBHOOK_URL:
|
||||
secure: gOKbXaZM9ImtMD5XrYITvdyZUW/az082G9OIN1EC1Vbg57wBaeLhi49uGjxPw5GVujHku6kxN6ab89zhbS5GVeluR76GM83IbKV4Sh7udXzoYZZdg6YudtYHzdhCgUeiedpswbuczTq9ceIkkfSEWZuh/lMAAVVwvcGsJAnoPFw=
|
||||
build_script:
|
||||
- cmd: >-
|
||||
git clone --depth=1 --branch=%APPVEYOR_REPO_BRANCH% https://github.com/ModOrganizer2/modorganizer-umbrella.git c:\projects\modorganizer-umbrella 2> $null
|
||||
- pwsh: >-
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
mkdir c:\projects\modorganizer-build -type directory
|
||||
git clone --depth=1 --no-single-branch https://github.com/ModOrganizer2/modorganizer-umbrella.git c:\projects\modorganizer-umbrella
|
||||
|
||||
New-Item -ItemType Directory -Path c:\projects\modorganizer-build
|
||||
|
||||
cd c:\projects\modorganizer-umbrella
|
||||
|
||||
($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH -eq $null) ? ($branch = $env:APPVEYOR_REPO_BRANCH) : ($branch = $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH)
|
||||
|
||||
C:\Python37-x64\python.exe unimake.py -d c:\projects\modorganizer-build -s Appveyor_Build=True %APPVEYOR_PROJECT_NAME%
|
||||
git checkout $(git show-ref --verify --quiet refs/remotes/origin/${branch} || echo '-b') ${branch}
|
||||
|
||||
C:\Python37-x64\python.exe unimake.py -d c:\projects\modorganizer-build -s Appveyor_Build=True ${env:APPVEYOR_PROJECT_NAME}
|
||||
|
||||
if($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode ) }
|
||||
artifacts:
|
||||
- path: build\src\diagnose_basic.dll
|
||||
- path: vsbuild\src\RelWithDebInfo\diagnose_basic.dll
|
||||
name: diagnose_basic_dll
|
||||
- path: build\src\diagnose_basic.pdb
|
||||
- path: vsbuild\src\RelWithDebInfo\diagnose_basic.pdb
|
||||
name: diagnose_basic_pdb
|
||||
- path: build\src\diagnose_basic.lib
|
||||
- path: vsbuild\src\RelWithDebInfo\diagnose_basic.lib
|
||||
name: diagnose_basic_lib
|
||||
on_success:
|
||||
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
|
||||
|
||||
+4
-5
@@ -1,6 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
if(DEFINED DEPENDENCIES_DIR)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/src.cmake)
|
||||
else()
|
||||
include(../../cmake_common/src.cmake)
|
||||
endif()
|
||||
|
||||
add_library(diagnose_basic SHARED)
|
||||
mo2_configure_plugin(diagnose_basic WARNINGS OFF PRIVATE_DEPENDS boost)
|
||||
mo2_install_target(diagnose_basic)
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
Import('qt_env')
|
||||
|
||||
env = qt_env.Clone()
|
||||
|
||||
env.AppendUnique(CPPDEFINES = [
|
||||
'DIAGNOSEBASIC_LIBRARY',
|
||||
'NOMINMAX',
|
||||
# suppress a few warnings caused by boost vs vc++ paranoia
|
||||
'_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}'
|
||||
])
|
||||
|
||||
lib = env.SharedLibrary('diagnoseBasic', env.Glob('*.cpp'))
|
||||
env.InstallModule(lib)
|
||||
|
||||
res = env['QT_USED_MODULES']
|
||||
Return('res')
|
||||
@@ -1,35 +0,0 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2013-04-05T21:08:10
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
TARGET = diagnoseBasic
|
||||
TEMPLATE = lib
|
||||
|
||||
CONFIG += plugins
|
||||
CONFIG += dll
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
DEFINES += DIAGNOSEBASIC_LIBRARY
|
||||
DEFINES += NOMINMAX
|
||||
|
||||
# suppress a few warnings caused by boost vs vc++ paranoia
|
||||
DEFINES += _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
SOURCES += diagnosebasic.cpp
|
||||
|
||||
HEADERS += diagnosebasic.h
|
||||
|
||||
include(../plugin_template.pri)
|
||||
|
||||
INCLUDEPATH += "$${BOOSTPATH}"
|
||||
|
||||
#CONFIG += dll
|
||||
|
||||
#DEFINES += INIEDITOR_LIBRARY
|
||||
|
||||
OTHER_FILES += \
|
||||
diagnosebasic.json\
|
||||
SConscript
|
||||
+34
-34
File diff suppressed because one or more lines are too long
+24
-10
@@ -55,6 +55,8 @@
|
||||
|
||||
using namespace MOBase;
|
||||
|
||||
const QRegularExpression DiagnoseBasic::RE_LOG_FILE(".*[.]log[0-9]*$");
|
||||
|
||||
DiagnoseBasic::DiagnoseBasic()
|
||||
: m_MOInfo(nullptr)
|
||||
{
|
||||
@@ -64,8 +66,8 @@ bool DiagnoseBasic::init(IOrganizer *moInfo)
|
||||
{
|
||||
m_MOInfo = moInfo;
|
||||
|
||||
m_MOInfo->modList()->onModStateChanged([&] (const QString &modName, IModList::ModStates) {
|
||||
if (modName == "Overwrite") invalidate();
|
||||
m_MOInfo->modList()->onModStateChanged([&] (const std::map<QString, IModList::ModStates>& mods) {
|
||||
if (mods.contains("Overwrite")) invalidate();
|
||||
});
|
||||
m_MOInfo->modList()->onModMoved([&] (const QString&, int, int) {
|
||||
// invalidates only the assetOrder check but there is currently no way to recheck individual
|
||||
@@ -76,7 +78,7 @@ bool DiagnoseBasic::init(IOrganizer *moInfo)
|
||||
invalidate();
|
||||
});
|
||||
m_MOInfo->pluginList()->onRefreshed([&] () { invalidate(); });
|
||||
m_MOInfo->pluginList()->onPluginStateChanged([&] (const QString &, IPluginList::PluginStates) {
|
||||
m_MOInfo->pluginList()->onPluginStateChanged([&] (auto const& ) {
|
||||
invalidate();
|
||||
});
|
||||
m_MOInfo->onAboutToRun([&] (const QString &executable) { return fileAttributes(executable); });
|
||||
@@ -179,10 +181,9 @@ bool DiagnoseBasic::checkEmpty(QString const &path) const
|
||||
dir.setFilter(QDir::Files | QDir::Hidden | QDir::System);
|
||||
|
||||
//Search files first
|
||||
for (QString const &f : dir.entryList()) {
|
||||
QString file(f);
|
||||
if (! m_MOInfo->pluginSetting(name(), "ow_ignore_log").toBool() ||
|
||||
! file.endsWith(".log", FileNameComparator::CaseSensitivity)) {
|
||||
for (auto const &file : dir.entryList()) {
|
||||
if (!m_MOInfo->pluginSetting(name(), "ow_ignore_log").toBool()
|
||||
|| !RE_LOG_FILE.match(file).hasMatch()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -203,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 ..
|
||||
}
|
||||
|
||||
@@ -255,6 +268,7 @@ bool DiagnoseBasic::missingMasters() const
|
||||
}
|
||||
|
||||
m_MissingMasters.clear();
|
||||
m_PluginChildren.clear();
|
||||
// for each required master in each esp, test if it's in the list of enabled masters.
|
||||
for (const QString &esp : esps) {
|
||||
QString baseName = QFileInfo(esp).fileName();
|
||||
@@ -282,7 +296,7 @@ bool DiagnoseBasic::alternateGame() const
|
||||
|
||||
bool DiagnoseBasic::invalidFontConfig() const
|
||||
{
|
||||
if ((m_MOInfo->managedGame()->gameName() != "Skyrim") && (m_MOInfo->managedGame()->gameName() != "SkyrimSE")) {
|
||||
if ((m_MOInfo->managedGame()->gameName() != "Skyrim") && (m_MOInfo->managedGame()->gameShortName() != "SkyrimSE")) {
|
||||
// this check is only for skyrim
|
||||
return false;
|
||||
}
|
||||
@@ -486,7 +500,7 @@ bool DiagnoseBasic::fileAttributes(const QString &executable) const
|
||||
// Find the active mods to search them too
|
||||
for (QString mod : m_MOInfo->modList()->allMods()) {
|
||||
if (m_MOInfo->modList()->state(mod) & MOBase::IModList::STATE_ACTIVE) {
|
||||
directoriesToSearch << m_MOInfo->getMod(mod)->absolutePath();
|
||||
directoriesToSearch << m_MOInfo->modList()->getMod(mod)->absolutePath();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ along with this plugin. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include <imodlist.h>
|
||||
#include <QString>
|
||||
#include <QSet>
|
||||
#include <QRegularExpression>
|
||||
|
||||
|
||||
class DiagnoseBasic : public QObject, public MOBase::IPlugin, public MOBase::IPluginDiagnose
|
||||
@@ -82,6 +83,8 @@ private:
|
||||
|
||||
static const unsigned int NUM_CONTEXT_ROWS = 5;
|
||||
|
||||
static const QRegularExpression RE_LOG_FILE;
|
||||
|
||||
private:
|
||||
|
||||
struct ListElement {
|
||||
|
||||
Reference in New Issue
Block a user