mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-28 04:54:13 +02:00
Upgrade old element type names in saved query presets too
A query saved to nomenclature.json (Load/Save in the query editor, since 2020) before June 2022 still says element_type = 'Simple'. Loading it ticked none of the type boxes and kept the old query, so the new table came out empty. Pass it through LegacyElementTypes::upgradeQuery() as ProjectDBModel::fromXml() now does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "../../properties/elementdata.h"
|
||||
#include "../../qetapp.h"
|
||||
#include "../../qetinformation.h"
|
||||
#include "../legacyelementtypes.h"
|
||||
#include "../projectdatabase.h"
|
||||
#include "ui_elementquerywidget.h"
|
||||
|
||||
@@ -674,7 +675,9 @@ void ElementQueryWidget::on_m_load_pb_clicked()
|
||||
|
||||
auto value_object = value.toObject();
|
||||
if (value_object.value("query").isString()) {
|
||||
setQuery(value_object.value("query").toString());
|
||||
//A query saved before June 2022 names element types the old way
|
||||
setQuery(LegacyElementTypes::upgradeQuery(
|
||||
value_object.value("query").toString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user