refactor(cpn): introduce BoundedString<N> for ModelData string fields (#7438)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Raphael Coeffic
2026-07-10 13:50:53 +10:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 68873e2955
commit 9326a202b2
21 changed files with 490 additions and 440 deletions
+3 -3
View File
@@ -357,9 +357,9 @@ void SetupPanel::on_throttleTrimSwitch_currentIndexChanged(int index)
void SetupPanel::on_name_editingFinished()
{
if (QString(model->name) != ui->name->text()) {
if (model->name.toQString() != ui->name->text()) {
int length = ui->name->maxLength();
strncpy(model->name, ui->name->text().toLatin1(), length);
model->name = ui->name->text().left(length).toLatin1().constData();
emit modified();
}
}
@@ -410,7 +410,7 @@ void SetupPanel::populateThrottleTrimSwitchCB()
void SetupPanel::update()
{
ui->name->setText(model->name);
ui->name->setText(model->name.toQString());
ui->throttleReverse->setChecked(model->throttleReversed);
ui->throttleSource->updateValue();
populateThrottleTrimSwitchCB();