@@ -92,7 +92,7 @@ void OptionsModel::Init(bool resetSettings)
9292 settings.setValue (" bPrune" , false );
9393 if (!settings.contains (" nPruneSize" ))
9494 settings.setValue (" nPruneSize" , DEFAULT_PRUNE_TARGET_GB);
95- SetPrune (settings.value (" bPrune" ).toBool ());
95+ SetPruneEnabled (settings.value (" bPrune" ).toBool ());
9696
9797 if (!settings.contains (" nDatabaseCache" ))
9898 settings.setValue (" nDatabaseCache" , (qint64)nDefaultDbCache);
@@ -236,7 +236,7 @@ static const QString GetDefaultProxyAddress()
236236 return QString (" %1:%2" ).arg (DEFAULT_GUI_PROXY_HOST).arg (DEFAULT_GUI_PROXY_PORT);
237237}
238238
239- void OptionsModel::SetPrune (bool prune, bool force)
239+ void OptionsModel::SetPruneEnabled (bool prune, bool force)
240240{
241241 QSettings settings;
242242 settings.setValue (" bPrune" , prune);
@@ -252,6 +252,16 @@ void OptionsModel::SetPrune(bool prune, bool force)
252252 }
253253}
254254
255+ void OptionsModel::SetPruneTargetGB (int prune_target_gb, bool force)
256+ {
257+ const bool prune = prune_target_gb > 0 ;
258+ if (prune) {
259+ QSettings settings;
260+ settings.setValue (" nPruneSize" , prune_target_gb);
261+ }
262+ SetPruneEnabled (prune, force);
263+ }
264+
255265// read QSettings values and return them
256266QVariant OptionsModel::data (const QModelIndex & index, int role) const
257267{
0 commit comments