Changeset View
Changeset View
Standalone View
Standalone View
src/qt/optionsmodel.cpp
Show First 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | static const QString GetDefaultProxyAddress() { | ||||
return QString("%1:%2") | return QString("%1:%2") | ||||
.arg(DEFAULT_GUI_PROXY_HOST) | .arg(DEFAULT_GUI_PROXY_HOST) | ||||
.arg(DEFAULT_GUI_PROXY_PORT); | .arg(DEFAULT_GUI_PROXY_PORT); | ||||
} | } | ||||
void OptionsModel::SetPruneEnabled(bool prune, bool force) { | void OptionsModel::SetPruneEnabled(bool prune, bool force) { | ||||
QSettings settings; | QSettings settings; | ||||
settings.setValue("bPrune", prune); | settings.setValue("bPrune", prune); | ||||
// Convert prune size from GB to MiB: | const int64_t prune_target_mib = | ||||
const uint64_t nPruneSizeMiB = | PruneGBtoMiB(settings.value("nPruneSize").toInt()); | ||||
(settings.value("nPruneSize").toInt() * GB_BYTES) >> 20; | std::string prune_val = prune ? ToString(prune_target_mib) : "0"; | ||||
std::string prune_val = prune ? ToString(nPruneSizeMiB) : "0"; | |||||
if (force) { | if (force) { | ||||
gArgs.ForceSetArg("-prune", prune_val); | gArgs.ForceSetArg("-prune", prune_val); | ||||
return; | return; | ||||
} | } | ||||
if (!gArgs.SoftSetArg("-prune", prune_val)) { | if (!gArgs.SoftSetArg("-prune", prune_val)) { | ||||
addOverriddenOption("-prune"); | addOverriddenOption("-prune"); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 296 Lines • Show Last 20 Lines |