diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2020-11-19 03:19:30 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2020-11-19 03:19:30 +0000 |
commit | f2e5a6b54fa38b10d822609939b8108bd8fe041b (patch) | |
tree | 63a7f90b96e9602b25ee92d57e2a12cd6e79e4b4 /src/qt/intro.cpp | |
parent | 62932cc686dc46ce14c026993deea8e561654177 (diff) | |
download | bitcoin-f2e5a6b54fa38b10d822609939b8108bd8fe041b.tar.xz |
GUI/Intro: Abstract GUI-to-option into Intro::getPrune
Diffstat (limited to 'src/qt/intro.cpp')
-rw-r--r-- | src/qt/intro.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index 437c941f70..61fb1463b9 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -182,6 +182,16 @@ void Intro::setDataDirectory(const QString &dataDir) } } +int64_t Intro::getPruneMiB() const +{ + switch (ui->prune->checkState()) { + case Qt::Checked: + return PruneGBtoMiB(m_prune_target_gb); + case Qt::Unchecked: default: + return 0; + } +} + bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB) { did_show_intro = false; @@ -233,7 +243,7 @@ bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB) } // Additional preferences: - prune_MiB = intro.ui->prune->isChecked() ? PruneGBtoMiB(intro.m_prune_target_gb) : int64_t(0); + prune_MiB = intro.getPruneMiB(); settings.setValue("strDataDir", dataDir); settings.setValue("fReset", false); |