mirror of
https://github.com/ModOrganizer2/modorganizer-diagnose_basic.git
synced 2026-07-27 14:03:10 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51099bed28 | ||
|
|
5b3d2adac5 | ||
|
|
d56d51e37c | ||
|
|
8d4c514c4d | ||
|
|
aa1b0d725c | ||
|
|
e508f7bcd7 | ||
|
|
477aa4c034 | ||
|
|
33c2867336 | ||
|
|
dd93b7e35e | ||
|
|
c893767bb2 | ||
|
|
cccdc4ece9 | ||
|
|
6b1f817f29 | ||
|
|
409850c044 | ||
|
|
1c8895ed3c | ||
|
|
9a9181621a | ||
|
|
9d4ba2d0d1 | ||
|
|
78b7a0a523 | ||
|
|
ba0a2df34f | ||
|
|
6a037f89a3 | ||
|
|
253c2ad05f | ||
|
|
3e2067a185 | ||
|
|
941ce462e1 | ||
|
|
9d9172b7d1 | ||
|
|
d0acab52df | ||
|
|
8d46fd9725 | ||
|
|
3c71a048d7 | ||
|
|
76d722710c | ||
|
|
9bc94001ff | ||
|
|
a56e18142a | ||
|
|
ef723d00f6 |
+8
-11
@@ -1,13 +1,10 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
ADD_COMPILE_OPTIONS($<$<CXX_COMPILER_ID:MSVC>:/MP> $<$<CXX_COMPILER_ID:MSVC>:$<$<CONFIG:RELEASE>:/O2>> $<$<CXX_COMPILER_ID:MSVC>:$<$<CONFIG:RELWITHDEBINFO>:/O2>>)
|
||||
if(DEFINED DEPENDENCIES_DIR)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake)
|
||||
else()
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake)
|
||||
endif()
|
||||
|
||||
SET(PROJ_NAME diagnose_basic)
|
||||
PROJECT(${PROJ_NAME})
|
||||
|
||||
SET(DEPENDENCIES_DIR CACHE PATH "")
|
||||
|
||||
# hint to find qt in dependencies path
|
||||
LIST(APPEND CMAKE_PREFIX_PATH ${QT_ROOT}/lib/cmake)
|
||||
|
||||
ADD_SUBDIRECTORY(src)
|
||||
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
-64
@@ -1,65 +1,5 @@
|
||||
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.11)
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
CMAKE_POLICY(SET CMP0020 NEW)
|
||||
CMAKE_POLICY(SET CMP0043 NEW)
|
||||
|
||||
FILE(GLOB ${PROJ_NAME}_SRCS *.cpp)
|
||||
FILE(GLOB ${PROJ_NAME}_HDRS *.h)
|
||||
FILE(GLOB ${PROJ_NAME}_FORMS *.ui)
|
||||
|
||||
|
||||
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
SET(CMAKE_AUTOMOC ON)
|
||||
SET(CMAKE_AUTOUIC ON)
|
||||
FIND_PACKAGE(Qt5Widgets REQUIRED)
|
||||
FIND_PACKAGE(Qt5LinguistTools)
|
||||
QT5_WRAP_UI(${PROJ_NAME}_UIHDRS ${${PROJ_NAME}_FORMS})
|
||||
QT5_CREATE_TRANSLATION(${PROJ_NAME}_translations_qm ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/diagnose_basic_en.ts)
|
||||
|
||||
SET(Boost_USE_STATIC_LIBS ON)
|
||||
SET(Boost_USE_MULTITHREADED ON)
|
||||
SET(Boost_USE_STATIC_RUNTIME OFF)
|
||||
FIND_PACKAGE(Boost)
|
||||
|
||||
IF (Boost_FOUND)
|
||||
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
|
||||
ENDIF (Boost_FOUND)
|
||||
|
||||
SET(default_project_path "${DEPENDENCIES_DIR}/modorganizer_super")
|
||||
GET_FILENAME_COMPONENT(${default_project_path} ${default_project_path} REALPATH)
|
||||
|
||||
SET(project_path "${default_project_path}" CACHE PATH "path to the other mo projects")
|
||||
SET(lib_path "${project_path}/../../install/libs")
|
||||
|
||||
INCLUDE_DIRECTORIES(${project_path}/uibase/src)
|
||||
LINK_DIRECTORIES(${lib_path})
|
||||
|
||||
ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
|
||||
ADD_LIBRARY(${PROJ_NAME} SHARED ${${PROJ_NAME}_HDRS} ${${PROJ_NAME}_SRCS} ${${PROJ_NAME}_UIHDRS} ${${PROJ_NAME}_translations_qm})
|
||||
TARGET_LINK_LIBRARIES(${PROJ_NAME}
|
||||
Qt5::Widgets
|
||||
${Boost_LIBRARIES}
|
||||
uibase)
|
||||
|
||||
IF (MSVC)
|
||||
SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES COMPILE_FLAGS "/std:c++latest")
|
||||
ENDIF()
|
||||
IF (MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
# 32 bits
|
||||
SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES LINK_FLAGS "/LARGEADDRESSAWARE")
|
||||
ENDIF()
|
||||
|
||||
IF (NOT "${OPTIMIZE_COMPILE_FLAGS}" STREQUAL "")
|
||||
SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES COMPILE_FLAGS_RELWITHDEBINFO ${OPTIMIZE_COMPILE_FLAGS})
|
||||
ENDIF()
|
||||
IF (NOT "${OPTIMIZE_LINK_FLAGS}" STREQUAL "")
|
||||
SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES LINK_FLAGS_RELWITHDEBINFO ${OPTIMIZE_LINK_FLAGS})
|
||||
ENDIF()
|
||||
|
||||
###############
|
||||
## Installation
|
||||
|
||||
INSTALL(TARGETS ${PROJ_NAME}
|
||||
RUNTIME DESTINATION bin/plugins)
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:${PROJ_NAME}>
|
||||
DESTINATION pdb)
|
||||
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
+15
-13
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "diagnosebasic.h"
|
||||
|
||||
#include "filenamestring.h"
|
||||
#include "ifiletree.h"
|
||||
#include "iplugingame.h"
|
||||
#include <report.h>
|
||||
#include <utility.h>
|
||||
@@ -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()) {
|
||||
FileNameString file(f);
|
||||
if (! m_MOInfo->pluginSetting(name(), "ow_ignore_log").toBool() ||
|
||||
! file.endsWith(".log")) {
|
||||
for (auto const &file : dir.entryList()) {
|
||||
if (!m_MOInfo->pluginSetting(name(), "ow_ignore_log").toBool()
|
||||
|| !RE_LOG_FILE.match(file).hasMatch()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -243,9 +244,9 @@ bool DiagnoseBasic::missingMasters() const
|
||||
std::set<QString> enabledPlugins;
|
||||
|
||||
QStringList esps = m_MOInfo->findFiles("",
|
||||
[] (const QString &fileName) -> bool { return fileName.endsWith(".esp", Qt::CaseInsensitive)
|
||||
|| fileName.endsWith(".esm", Qt::CaseInsensitive)
|
||||
|| fileName.endsWith(".esl", Qt::CaseInsensitive); });
|
||||
[] (const QString &fileName) -> bool { return fileName.endsWith(".esp", FileNameComparator::CaseSensitivity)
|
||||
|| fileName.endsWith(".esm", FileNameComparator::CaseSensitivity)
|
||||
|| fileName.endsWith(".esl", FileNameComparator::CaseSensitivity); });
|
||||
// gather enabled masters first
|
||||
for (const QString &esp : esps) {
|
||||
QString baseName = QFileInfo(esp).fileName();
|
||||
@@ -255,6 +256,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();
|
||||
@@ -310,7 +312,7 @@ bool DiagnoseBasic::invalidFontConfig() const
|
||||
QString path(temp.c_str());
|
||||
bool isDefault = false;
|
||||
for (const QString &def : defaultFonts) {
|
||||
if (QString::compare(def, path, Qt::CaseInsensitive) == 0) {
|
||||
if (QString::compare(def, path, FileNameComparator::CaseSensitivity) == 0) {
|
||||
isDefault = true;
|
||||
break;
|
||||
}
|
||||
@@ -486,7 +488,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