From b2af1e340f956c11a7c522e8c4b5900925417634 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Thu, 24 Dec 2020 09:36:04 -0500 Subject: dump nxmhandler.ini --- src/settings.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) (limited to 'src/settings.cpp') 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 . #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 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 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(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("games"); + const auto executable = sra.get("executable"); + const auto arguments = sra.get("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) -- cgit v1.3.1