diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-12-24 23:06:53 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-24 23:06:53 -0500 |
| commit | 89bbdf22cde8d16d2d5e72999abf97b38ecd7b11 (patch) | |
| tree | 3f4c4de743acdbb90e7e9997147f478c0c1f698e /src/settings.cpp | |
| parent | 06ca11edfb2957d07f9e7bccce1e8a765b1d0209 (diff) | |
| parent | 9441d49c6d7dff23395460076112b57d4c0e8743 (diff) | |
Merge pull request #1328 from isanae/stuff
Stuff
Diffstat (limited to 'src/settings.cpp')
| -rw-r--r-- | src/settings.cpp | 57 |
1 files changed, 54 insertions, 3 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 85aa5f2f..ebb4fabe 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" @@ -479,7 +480,9 @@ QSettings::Status Settings::iniStatus() const void Settings::dump() const { static const QStringList ignore({ - "username", "password", "nexus_api_key", "nexus_username", "nexus_password" + "username", "password", + "nexus_api_key", "nexus_username", "nexus_password", + "steam_username" }); log::debug("settings:"); @@ -497,6 +500,7 @@ void Settings::dump() const } m_Network.dump(); + m_Nexus.dump(); } void Settings::managedGameChanged(IPluginGame const *gamePlugin) @@ -1524,7 +1528,7 @@ std::map<QString, QString> PathSettings::recent() const if (name.isValid() && dir.isValid()) { map.emplace(name.toString(), dir.toString()); } - }); + }); return map; } @@ -1891,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"; @@ -1944,6 +1951,50 @@ 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:"); + + QSettings handler("HKEY_CURRENT_USER\\Software\\Classes\\nxm\\", QSettings::NativeFormat); + log::debug(" . primary: {}", handler.value("shell/open/command/Default").toString()); + + 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) |
