aboutsummaryrefslogtreecommitdiff
path: root/src/widgets
diff options
context:
space:
mode:
authorlambdcalculus <64238778+lambdcalculus@users.noreply.github.com>2024-05-09 00:38:09 -0300
committerGitHub <noreply@github.com>2024-05-08 22:38:09 -0500
commitd680a6afdb2a63154be8ba43bdb6b607d46b000a (patch)
tree63cee61d0743bf856a323e7c77a964134aa74e0d /src/widgets
parentad93dd82388c071a1ca5cdb2bff072e96c44265a (diff)
Fix combobox options not persisting (#949)
* fix combobox options not persisting * remove accidental newline * convert combobox data to string
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/aooptionsdialog.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/widgets/aooptionsdialog.cpp b/src/widgets/aooptionsdialog.cpp
index 7bdc5858..72c9f4e8 100644
--- a/src/widgets/aooptionsdialog.cpp
+++ b/src/widgets/aooptionsdialog.cpp
@@ -105,7 +105,7 @@ template <>
void AOOptionsDialog::setWidgetData(QComboBox *widget, const QString &value)
{
for (auto i = 0; i < widget->count(); i++) {
- if (widget->itemText(i) == value) {
+ if (widget->itemData(i).toString() == value) {
widget->setCurrentIndex(i);
return;
}
@@ -614,11 +614,11 @@ void AOOptionsDialog::setupUI()
ui_log_timestamp_format_combobox->setCurrentText(l_current_format);
- ui_log_timestamp_format_combobox->addItem(l_current_format);
- ui_log_timestamp_format_combobox->addItem("h:mm:ss AP");
- ui_log_timestamp_format_combobox->addItem("hh:mm:ss");
- ui_log_timestamp_format_combobox->addItem("h:mm AP");
- ui_log_timestamp_format_combobox->addItem("hh:mm");
+ ui_log_timestamp_format_combobox->addItem(l_current_format, l_current_format);
+ ui_log_timestamp_format_combobox->addItem("h:mm:ss AP", "h:mm:ss AP");
+ ui_log_timestamp_format_combobox->addItem("hh:mm:ss", "hh:mm:ss");
+ ui_log_timestamp_format_combobox->addItem("h:mm AP", "h:mm AP");
+ ui_log_timestamp_format_combobox->addItem("hh:mm", "hh:mm");
if (!Options::getInstance().logTimestampEnabled()) {
ui_log_timestamp_format_combobox->setDisabled(true);