From d2ada6e63583cad91e92b49c4dbf8c7ff086a758 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Mon, 18 Apr 2022 19:19:02 -0400 Subject: Migrate -upnp and -natpmp settings from QSettings to settings.json This also effectively reverts 58e8364dcdc4e57b0caac09f8402e6535301de9b from #18077, applying upnp and natpmp settings from the optionsmodel class instead of the optionsdialog class. This makes sense because model code, not view code is responsible for applying all other settings, and because leaving these settings half-applied in optionsmodel seems error prone and could lead to bugs. (These things were discussed a little in https://github.com/bitcoin/bitcoin/pull/18077#discussion_r560381734) --- src/qt/test/optiontests.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/qt/test') diff --git a/src/qt/test/optiontests.cpp b/src/qt/test/optiontests.cpp index fa3fe031ec..d84dc524cd 100644 --- a/src/qt/test/optiontests.cpp +++ b/src/qt/test/optiontests.cpp @@ -34,6 +34,7 @@ void OptionTests::migrateSettings() QSettings settings; settings.setValue("nDatabaseCache", 600); settings.setValue("nThreadsScriptVerif", 12); + settings.setValue("fUseUPnP", false); settings.sync(); @@ -42,6 +43,7 @@ void OptionTests::migrateSettings() QVERIFY(options.Init(error)); QVERIFY(!settings.contains("nDatabaseCache")); QVERIFY(!settings.contains("nThreadsScriptVerif")); + QVERIFY(!settings.contains("fUseUPnP")); std::ifstream file(gArgs.GetDataDirNet() / "settings.json"); QCOMPARE(std::string(std::istreambuf_iterator(file), std::istreambuf_iterator()).c_str(), "{\n" -- cgit v1.2.3