diff options
Diffstat (limited to 'src/qt/optionsmodel.cpp')
-rw-r--r-- | src/qt/optionsmodel.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index d04a2cf862..5b4fb4cc18 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -9,6 +9,7 @@ #include <qt/optionsmodel.h> #include <qt/bitcoinunits.h> +#include <qt/guiconstants.h> #include <qt/guiutil.h> #include <interfaces/node.h> @@ -16,7 +17,6 @@ #include <net.h> #include <netbase.h> #include <txdb.h> // for -dbcache defaults -#include <qt/intro.h> #include <QNetworkProxy> #include <QSettings> @@ -92,10 +92,10 @@ void OptionsModel::Init(bool resetSettings) settings.setValue("bPrune", false); if (!settings.contains("nPruneSize")) settings.setValue("nPruneSize", 2); - // Convert prune size to MB: - const uint64_t nPruneSizeMB = settings.value("nPruneSize").toInt() * 1000; - if (!m_node.softSetArg("-prune", settings.value("bPrune").toBool() ? std::to_string(nPruneSizeMB) : "0")) { - addOverriddenOption("-prune"); + // Convert prune size from GB to MiB: + const uint64_t nPruneSizeMiB = (settings.value("nPruneSize").toInt() * GB_BYTES) >> 20; + if (!m_node.softSetArg("-prune", settings.value("bPrune").toBool() ? std::to_string(nPruneSizeMiB) : "0")) { + addOverriddenOption("-prune"); } if (!settings.contains("nDatabaseCache")) @@ -109,7 +109,7 @@ void OptionsModel::Init(bool resetSettings) addOverriddenOption("-par"); if (!settings.contains("strDataDir")) - settings.setValue("strDataDir", Intro::getDefaultDataDirectory()); + settings.setValue("strDataDir", GUIUtil::getDefaultDataDirectory()); // Wallet #ifdef ENABLE_WALLET @@ -186,7 +186,7 @@ void OptionsModel::Reset() BackupSettings(GetDataDir(true) / "guisettings.ini.bak", settings); // Save the strDataDir setting - QString dataDir = Intro::getDefaultDataDirectory(); + QString dataDir = GUIUtil::getDefaultDataDirectory(); dataDir = settings.value("strDataDir", dataDir).toString(); // Remove all entries from our QSettings object |