Skip to content

Commit

Permalink
Fix/database settings spin box bug (#9101)
Browse files Browse the repository at this point in the history
Co-authored-by: jNullj <jNullj@users.noreply.github.com>
  • Loading branch information
2 people authored and droidmonkey committed Feb 19, 2023
1 parent 95aaa96 commit d362b51
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,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);
}
}
Expand Down

0 comments on commit d362b51

Please sign in to comment.