diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-12-24 09:36:04 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-12-24 09:36:04 -0500 |
| commit | b2af1e340f956c11a7c522e8c4b5900925417634 (patch) | |
| tree | ae8d9b2541491b0a7ac73d3395e175bd57982732 | |
| parent | c676247f99ceb8ae365fd6c9ca86981dd309082c (diff) | |
dump nxmhandler.ini
| -rw-r--r-- | src/settings.cpp | 50 | ||||
| -rw-r--r-- | src/settings.h | 4 | ||||
| -rw-r--r-- | src/shared/appconfig.inc | 2 |
3 files changed, 54 insertions, 2 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 04e407fc..f554bc64 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -21,6 +21,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "settingsutilities.h" #include "serverinfo.h" #include "executableslist.h" +#include "instancemanager.h" #include "shared/appconfig.h" #include "env.h" #include "envmetrics.h" @@ -499,6 +500,7 @@ void Settings::dump() const } m_Network.dump(); + m_Nexus.dump(); } void Settings::managedGameChanged(IPluginGame const *gamePlugin) @@ -1526,7 +1528,7 @@ std::map<QString, QString> PathSettings::recent() const if (name.isValid() && dir.isValid()) { map.emplace(name.toString(), dir.toString()); } - }); + }); return map; } @@ -1893,7 +1895,10 @@ void NexusSettings::setTrackedIntegration(bool b) const void NexusSettings::registerAsNXMHandler(bool force) { - const auto nxmPath = QCoreApplication::applicationDirPath() + "/nxmhandler.exe"; + const auto nxmPath = + QCoreApplication::applicationDirPath() + "/" + + QString::fromStdWString(AppConfig::nxmHandlerExe()); + const auto executable = QCoreApplication::applicationFilePath(); QString mode = force ? "forcereg" : "reg"; @@ -1946,6 +1951,47 @@ std::vector<std::chrono::seconds> NexusSettings::validationTimeouts() const return v; } +void NexusSettings::dump() const +{ + const auto iniPath = + InstanceManager::singleton().globalInstancesRootPath() + "/" + + QString::fromStdWString(AppConfig::nxmHandlerIni()); + + if (!QFileInfo(iniPath).exists()) { + log::debug("nxm ini not found at {}", iniPath); + return; + } + + QSettings s(iniPath, QSettings::IniFormat); + if (const auto st=s.status(); st != QSettings::NoError) { + log::debug("can't read nxm ini from {}", iniPath); + return; + } + + log::debug("nxmhandler settings:"); + + const auto noregister = getOptional<bool>(s, "General", "noregister"); + + if (noregister) { + log::debug(" - noregister: {}", *noregister); + } else { + log::debug(" - noregister: (not found)"); + } + + ScopedReadArray sra(s, "handlers"); + + sra.for_each([&] { + const auto games = sra.get<QVariant>("games"); + const auto executable = sra.get<QVariant>("executable"); + const auto arguments = sra.get<QVariant>("arguments"); + + log::debug(" - handler:"); + log::debug(" - games: {}", games.toString()); + log::debug(" - executable: {}", executable.toString()); + log::debug(" - arguments: {}", arguments.toString()); + }); +} + SteamSettings::SteamSettings(Settings& parent, QSettings& settings) : m_Parent(parent), m_Settings(settings) diff --git a/src/settings.h b/src/settings.h index 48aefc27..82c3a615 100644 --- a/src/settings.h +++ b/src/settings.h @@ -528,6 +528,10 @@ public: std::vector<std::chrono::seconds> validationTimeouts() const; + // dumps nxmhandler stuff + // + void dump() const; + private: Settings& m_Parent; QSettings& m_Settings; diff --git a/src/shared/appconfig.inc b/src/shared/appconfig.inc index 5839c2f4..9058bf18 100644 --- a/src/shared/appconfig.inc +++ b/src/shared/appconfig.inc @@ -18,6 +18,8 @@ APPPARAM(std::wstring, proxyDLLOrig, L"steam_api_orig.dll") // needs to be ident APPPARAM(std::wstring, proxyDLLSource, L"proxy.dll")
APPPARAM(std::wstring, vfs32DLLName, L"usvfs_x86.dll")
APPPARAM(std::wstring, vfs64DLLName, L"usvfs_x64.dll")
+APPPARAM(std::wstring, nxmHandlerExe, L"nxmhandler.exe")
+APPPARAM(std::wstring, nxmHandlerIni, L"nxmhandler.ini")
APPPARAM(std::wstring, portableLockFileName, L"portable.txt")
APPPARAM(const wchar_t*, localSavePlaceholder, L"__MOProfileSave__\\")
|
