diff --git a/.clang-format b/.clang-format
new file mode 100644
index 000000000..6098e1f5f
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,41 @@
+---
+# We'll use defaults from the LLVM style, but with 4 columns indentation.
+BasedOnStyle: LLVM
+IndentWidth: 2
+---
+Language: Cpp
+DeriveLineEnding: false
+UseCRLF: true
+DerivePointerAlignment: false
+PointerAlignment: Left
+AlignConsecutiveAssignments: true
+AllowShortFunctionsOnASingleLine: Inline
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLambdasOnASingleLine: Empty
+AlwaysBreakTemplateDeclarations: Yes
+AccessModifierOffset: -2
+AlignTrailingComments: true
+SpacesBeforeTrailingComments: 2
+NamespaceIndentation: Inner
+MaxEmptyLinesToKeep: 1
+BreakBeforeBraces: Custom
+BraceWrapping:
+ AfterCaseLabel: false
+ AfterClass: true
+ AfterControlStatement: false
+ AfterEnum: true
+ AfterFunction: true
+ AfterNamespace: true
+ AfterStruct: true
+ AfterUnion: true
+ AfterExternBlock: true
+ BeforeCatch: false
+ BeforeElse: false
+ BeforeLambdaBody: false
+ BeforeWhile: false
+ IndentBraces: false
+ SplitEmptyFunction: false
+ SplitEmptyRecord: false
+ SplitEmptyNamespace: true
+ColumnLimit: 88
+ForEachMacros: ['Q_FOREACH', 'foreach']
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 000000000..cf5f6c126
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,2 @@
+d13f6bb870cdda71257f665367be8ef9fca86255
+86bb01ba9eac879d3685c439ac9da0028bc4bc80
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..f86971274
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,7 @@
+# Set the default behavior, in case people don't have core.autocrlf set.
+* text=auto
+
+# Explicitly declare text files you want to always be normalized and converted
+# to native line endings on checkout.
+*.cpp text eol=crlf
+*.h text eol=crlf
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000..098a8d852
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,20 @@
+name: Build ModOrganizer 2
+
+on:
+ push:
+ branches: master
+ pull_request:
+ types: [opened, synchronize, reopened]
+
+jobs:
+ build:
+ runs-on: windows-2022
+ steps:
+ - name: Build ModOrganizer 2
+ uses: ModOrganizer2/build-with-mob-action@master
+ with:
+ qt-modules: qtpositioning qtwebchannel qtwebengine qtwebsockets
+ mo2-third-parties:
+ 7z zlib fmt gtest libbsarch libloot openssl libffi bzip2 python lz4 spdlog
+ boost boost-di sip pyqt pybind11 ss licenses explorerpp usvfs
+ mo2-dependencies: cmake_common uibase githubpp bsatk esptk archive lootcli game_gamebryo
diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml
new file mode 100644
index 000000000..43cdeeaed
--- /dev/null
+++ b/.github/workflows/linting.yml
@@ -0,0 +1,17 @@
+name: Lint ModOrganizer 2
+
+on:
+ push:
+ pull_request:
+ types: [opened, synchronize, reopened]
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Run clang-format
+ uses: jidicula/clang-format-action@v4.11.0
+ with:
+ clang-format-version: "15"
+ check-path: "."
diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp
index 781848735..1c70d91e4 100644
--- a/src/aboutdialog.cpp
+++ b/src/aboutdialog.cpp
@@ -1,126 +1,126 @@
-/*
-Copyright (C) 2014 Sebastian Herbord. All rights reserved.
-
-This file is part of Mod Organizer.
-
-Mod Organizer is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Mod Organizer is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Mod Organizer. If not, see .
-*/
-
-
-#include "aboutdialog.h"
-#include "ui_aboutdialog.h"
-#include "shared/util.h"
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-AboutDialog::AboutDialog(const QString &version, QWidget *parent)
- : QDialog(parent)
- , ui(new Ui::AboutDialog)
-{
- ui->setupUi(this);
-
- m_LicenseFiles[LICENSE_LGPL3] = "LGPL-v3.0.txt";
- m_LicenseFiles[LICENSE_LGPL21] = "GNU-LGPL-v2.1.txt";
- m_LicenseFiles[LICENSE_GPL3] = "GPL-v3.0.txt";
- m_LicenseFiles[LICENSE_GPL2] = "GPL-v2.0.txt";
- m_LicenseFiles[LICENSE_BOOST] = "boost.txt";
- m_LicenseFiles[LICENSE_7ZIP] = "7zip.txt";
- m_LicenseFiles[LICENSE_CCBY3] = "BY-SA-v3.0.txt";
- m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt";
- m_LicenseFiles[LICENSE_PYTHON] = "python.txt";
- m_LicenseFiles[LICENSE_SSL] = "openssl.txt";
- m_LicenseFiles[LICENSE_CPPTOML] = "cpptoml.txt";
- m_LicenseFiles[LICENSE_UDIS] = "udis86.txt";
- m_LicenseFiles[LICENSE_SPDLOG] = "spdlog.txt";
- m_LicenseFiles[LICENSE_FMT] = "fmt.txt";
- m_LicenseFiles[LICENSE_SIP] = "sip.txt";
- m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt";
- m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt";
- m_LicenseFiles[LICENSE_DXTEX] = "DXTex.txt";
- m_LicenseFiles[LICENSE_VDF] = "ValveFileVDF.txt";
-
- addLicense("Qt", LICENSE_LGPL3);
- addLicense("Qt Json", LICENSE_GPL3);
- addLicense("Boost Library", LICENSE_BOOST);
- addLicense("7-zip", LICENSE_7ZIP);
- addLicense("ZLib", LICENSE_NONE);
- addLicense("Tango Icon Theme", LICENSE_NONE);
- addLicense("RRZE Icon Set", LICENSE_CCBY3);
- addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net", LICENSE_CCBY3);
- addLicense("Castle Core", LICENSE_CASTLE);
- addLicense("ANTLR", LICENSE_ANTLR);
- addLicense("LOOT", LICENSE_GPL3);
- addLicense("Python", LICENSE_PYTHON);
- addLicense("OpenSSL", LICENSE_SSL);
- addLicense("cpptoml", LICENSE_CPPTOML);
- addLicense("Udis86", LICENSE_UDIS);
- addLicense("spdlog", LICENSE_SPDLOG);
- addLicense("{fmt}", LICENSE_FMT);
- addLicense("SIP", LICENSE_SIP);
- addLicense("DXTex Headers", LICENSE_DXTEX);
- addLicense("Valve File VDF Reader", LICENSE_VDF);
-
- ui->nameLabel->setText(QString("%1 %2").arg(ui->nameLabel->text()).arg(version));
-#if defined(HGID)
- ui->revisionLabel->setText(ui->revisionLabel->text() + " " + HGID);
-#elif defined(GITID)
- ui->revisionLabel->setText(ui->revisionLabel->text() + " " + GITID);
-#else
- ui->revisionLabel->setText(ui->revisionLabel->text() + " unknown");
-#endif
-
-
- ui->usvfsLabel->setText(ui->usvfsLabel->text() + " " + MOShared::getUsvfsVersionString());
- ui->licenseText->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
-}
-
-
-AboutDialog::~AboutDialog()
-{
- delete ui;
-}
-
-
-void AboutDialog::addLicense(const QString &name, Licenses license)
-{
- QListWidgetItem *item = new QListWidgetItem(name);
- item->setData(Qt::UserRole, license);
- ui->creditsList->addItem(item);
-}
-
-
-void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem*)
-{
- auto iter = m_LicenseFiles.find(current->data(Qt::UserRole).toInt());
- if (iter != m_LicenseFiles.end()) {
- QString filePath = qApp->applicationDirPath() + "/licenses/" + iter->second;
- QString text = MOBase::readFileText(filePath);
- ui->licenseText->setText(text);
- } else {
- ui->licenseText->setText(tr("No license"));
- }
-}
-
-void AboutDialog::on_sourceText_linkActivated(const QString &link)
-{
- MOBase::shell::Open(QUrl(link));
-}
+/*
+Copyright (C) 2014 Sebastian Herbord. All rights reserved.
+
+This file is part of Mod Organizer.
+
+Mod Organizer is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Mod Organizer is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mod Organizer. If not, see .
+*/
+
+#include "aboutdialog.h"
+#include "shared/util.h"
+#include "ui_aboutdialog.h"
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+AboutDialog::AboutDialog(const QString& version, QWidget* parent)
+ : QDialog(parent), ui(new Ui::AboutDialog)
+{
+ ui->setupUi(this);
+
+ m_LicenseFiles[LICENSE_LGPL3] = "LGPL-v3.0.txt";
+ m_LicenseFiles[LICENSE_LGPL21] = "GNU-LGPL-v2.1.txt";
+ m_LicenseFiles[LICENSE_GPL3] = "GPL-v3.0.txt";
+ m_LicenseFiles[LICENSE_GPL2] = "GPL-v2.0.txt";
+ m_LicenseFiles[LICENSE_BOOST] = "boost.txt";
+ m_LicenseFiles[LICENSE_7ZIP] = "7zip.txt";
+ m_LicenseFiles[LICENSE_CCBY3] = "BY-SA-v3.0.txt";
+ m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt";
+ m_LicenseFiles[LICENSE_PYTHON] = "python.txt";
+ m_LicenseFiles[LICENSE_SSL] = "openssl.txt";
+ m_LicenseFiles[LICENSE_CPPTOML] = "cpptoml.txt";
+ m_LicenseFiles[LICENSE_UDIS] = "udis86.txt";
+ m_LicenseFiles[LICENSE_SPDLOG] = "spdlog.txt";
+ m_LicenseFiles[LICENSE_FMT] = "fmt.txt";
+ m_LicenseFiles[LICENSE_SIP] = "sip.txt";
+ m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt";
+ m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt";
+ m_LicenseFiles[LICENSE_DXTEX] = "DXTex.txt";
+ m_LicenseFiles[LICENSE_VDF] = "ValveFileVDF.txt";
+
+ addLicense("Qt", LICENSE_LGPL3);
+ addLicense("Qt Json", LICENSE_GPL3);
+ addLicense("Boost Library", LICENSE_BOOST);
+ addLicense("7-zip", LICENSE_7ZIP);
+ addLicense("ZLib", LICENSE_NONE);
+ addLicense("Tango Icon Theme", LICENSE_NONE);
+ addLicense("RRZE Icon Set", LICENSE_CCBY3);
+ addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net",
+ LICENSE_CCBY3);
+ addLicense("Castle Core", LICENSE_CASTLE);
+ addLicense("ANTLR", LICENSE_ANTLR);
+ addLicense("LOOT", LICENSE_GPL3);
+ addLicense("Python", LICENSE_PYTHON);
+ addLicense("OpenSSL", LICENSE_SSL);
+ addLicense("cpptoml", LICENSE_CPPTOML);
+ addLicense("Udis86", LICENSE_UDIS);
+ addLicense("spdlog", LICENSE_SPDLOG);
+ addLicense("{fmt}", LICENSE_FMT);
+ addLicense("SIP", LICENSE_SIP);
+ addLicense("DXTex Headers", LICENSE_DXTEX);
+ addLicense("Valve File VDF Reader", LICENSE_VDF);
+
+ ui->nameLabel->setText(
+ QString("%1 %2")
+ .arg(ui->nameLabel->text())
+ .arg(version));
+#if defined(HGID)
+ ui->revisionLabel->setText(ui->revisionLabel->text() + " " + HGID);
+#elif defined(GITID)
+ ui->revisionLabel->setText(ui->revisionLabel->text() + " " + GITID);
+#else
+ ui->revisionLabel->setText(ui->revisionLabel->text() + " unknown");
+#endif
+
+ ui->usvfsLabel->setText(ui->usvfsLabel->text() + " " +
+ MOShared::getUsvfsVersionString());
+ ui->licenseText->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
+}
+
+AboutDialog::~AboutDialog()
+{
+ delete ui;
+}
+
+void AboutDialog::addLicense(const QString& name, Licenses license)
+{
+ QListWidgetItem* item = new QListWidgetItem(name);
+ item->setData(Qt::UserRole, license);
+ ui->creditsList->addItem(item);
+}
+
+void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem* current,
+ QListWidgetItem*)
+{
+ auto iter = m_LicenseFiles.find(current->data(Qt::UserRole).toInt());
+ if (iter != m_LicenseFiles.end()) {
+ QString filePath = qApp->applicationDirPath() + "/licenses/" + iter->second;
+ QString text = MOBase::readFileText(filePath);
+ ui->licenseText->setText(text);
+ } else {
+ ui->licenseText->setText(tr("No license"));
+ }
+}
+
+void AboutDialog::on_sourceText_linkActivated(const QString& link)
+{
+ MOBase::shell::Open(QUrl(link));
+}
diff --git a/src/aboutdialog.h b/src/aboutdialog.h
index ec1bb9d59..f76cdd3f2 100644
--- a/src/aboutdialog.h
+++ b/src/aboutdialog.h
@@ -1,84 +1,82 @@
-#ifndef ABOUTDIALOG_H
-/*
-Copyright (C) 2014 Sebastian Herbord. All rights reserved.
-
-This file is part of Mod Organizer.
-
-Mod Organizer is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Mod Organizer is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Mod Organizer. If not, see .
-*/
-
-
-#define ABOUTDIALOG_H
-
-#include
-class QListWidgetItem;
-#include
-#include
-
-#include