From 20e8e524a5ae4d9e053b7196c3b247664d266e69 Mon Sep 17 00:00:00 2001 From: jNullj <15849761+jNullj@users.noreply.github.com> Date: Sun, 12 Feb 2023 22:39:10 +0200 Subject: [PATCH] Fix/database settings spin box bug (#9101) Co-authored-by: jNullj --- src/gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp b/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp index ac883ac7a9..a146ebd7e1 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp +++ b/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp @@ -50,14 +50,16 @@ void DatabaseSettingsWidgetGeneral::initialize() m_ui->historyMaxItemsCheckBox->setChecked(true); } else { m_ui->historyMaxItemsSpinBox->setValue(Metadata::DefaultHistoryMaxItems); + m_ui->historyMaxItemsSpinBox->setEnabled(false); m_ui->historyMaxItemsCheckBox->setChecked(false); } - int historyMaxSizeMiB = qRound(meta->historyMaxSize() / qreal(1048576)); + int historyMaxSizeMiB = qRound(meta->historyMaxSize() / qreal(1024 * 1024)); if (historyMaxSizeMiB > 0) { m_ui->historyMaxSizeSpinBox->setValue(historyMaxSizeMiB); m_ui->historyMaxSizeCheckBox->setChecked(true); } else { - m_ui->historyMaxSizeSpinBox->setValue(Metadata::DefaultHistoryMaxSize); + m_ui->historyMaxSizeSpinBox->setValue(qRound(Metadata::DefaultHistoryMaxSize / qreal(1024 * 1024))); + m_ui->historyMaxSizeSpinBox->setEnabled(false); m_ui->historyMaxSizeCheckBox->setChecked(false); } }