Skip to content

Commit 061baa3

Browse files
author
Meinhard Ritscher
committed
custom baud rate is not being restored - FIX
1 parent 6d99acb commit 061baa3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

controlpanel.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ void ControlPanel::applySessionSettings(Settings::Session session)
168168
} else {
169169
index = m_combo_Baud->findData(-1);
170170
if (index != -1) {
171+
m_combo_Baud->setItemText(index, QString::number(session.baudRate));
171172
m_combo_Baud->setCurrentIndex(index);
172-
m_combo_Baud->setCurrentText(QString::number(session.baudRate));
173173
}
174174
}
175175

@@ -296,7 +296,10 @@ void ControlPanel::fillBaudCombo()
296296
m_combo_Baud->addItem(QStringLiteral("Custom"), -1);
297297

298298
connect(m_combo_Baud, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
299-
[=]() { emit settingChanged(Settings::BaudRate, m_combo_Baud->currentData()); });
299+
[=]() { int custom = m_combo_Baud->currentData().toInt();
300+
emit settingChanged(Settings::BaudRate,
301+
(custom == -1) ? m_combo_Baud->currentText() : m_combo_Baud->currentData());
302+
});
300303
}
301304

302305
void ControlPanel::fillFlowCombo()

0 commit comments

Comments
 (0)