mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-13 16:34:14 +02:00
Remove auto_num_locked/potential_isolating/exclude_from_bom checkboxes'
"false" writes, delete key instead Unchecking a checkbox previously wrote the key with value "false" rather than omitting it -- behaviorally identical to every consumer (all three do a case-sensitive == "true" comparison), but left dead entries cluttering the .elmt file, inconsistent with how other elementInformation fields (manufacturer, designation) are only present when actually set. Now removes the key entirely when unchecked.
This commit is contained in:
@@ -410,13 +410,21 @@ void ElementPropertiesEditorWidget::on_m_buttonBox_accepted()
|
||||
|
||||
if (m_data.m_type == ElementData::Terminal)
|
||||
{
|
||||
m_data.m_informations.addValue(QStringLiteral("auto_num_locked"),
|
||||
ui->m_auto_num_locked_cb->isChecked() ? QStringLiteral("true") : QStringLiteral("false"));
|
||||
m_data.m_informations.addValue(QStringLiteral("potential_isolating"),
|
||||
ui->m_potential_isolating_cb->isChecked() ? QStringLiteral("true") : QStringLiteral("false"));
|
||||
if (ui->m_auto_num_locked_cb->isChecked())
|
||||
m_data.m_informations.addValue(QStringLiteral("auto_num_locked"), QStringLiteral("true"));
|
||||
else
|
||||
m_data.m_informations.remove(QStringLiteral("auto_num_locked"));
|
||||
|
||||
if (ui->m_potential_isolating_cb->isChecked())
|
||||
m_data.m_informations.addValue(QStringLiteral("potential_isolating"), QStringLiteral("true"));
|
||||
else
|
||||
m_data.m_informations.remove(QStringLiteral("potential_isolating"));
|
||||
}
|
||||
m_data.m_informations.addValue(QStringLiteral("exclude_from_bom"),
|
||||
ui->m_exclude_from_bom_cb->isChecked() ? QStringLiteral("true") : QStringLiteral("false"));
|
||||
|
||||
if (ui->m_exclude_from_bom_cb->isChecked())
|
||||
m_data.m_informations.addValue(QStringLiteral("exclude_from_bom"), QStringLiteral("true"));
|
||||
else
|
||||
m_data.m_informations.remove(QStringLiteral("exclude_from_bom"));
|
||||
|
||||
this->close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user