From 67112bf8e504ce50751913dc75b0280e7a4a3abc Mon Sep 17 00:00:00 2001 From: plc-user <74435298+plc-user@users.noreply.github.com> Date: Mon, 17 Feb 2025 09:33:35 +0100 Subject: [PATCH] fix typo in enum-entry and comments --- sources/TerminalStrip/terminalstrip.cpp | 2 +- sources/dataBase/projectdatabase.cpp | 8 ++++---- sources/dataBase/ui/elementquerywidget.cpp | 4 ++-- sources/editor/elementscene.cpp | 4 ++-- sources/editor/ui/elementpropertieseditorwidget.cpp | 10 +++++----- sources/elementprovider.cpp | 2 +- sources/properties/elementdata.cpp | 12 ++++++------ sources/properties/elementdata.h | 2 +- sources/qetgraphicsitem/element.cpp | 4 ++-- sources/ui/elementinfowidget.cpp | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sources/TerminalStrip/terminalstrip.cpp b/sources/TerminalStrip/terminalstrip.cpp index 55eb1b4f6..2222a50fb 100644 --- a/sources/TerminalStrip/terminalstrip.cpp +++ b/sources/TerminalStrip/terminalstrip.cpp @@ -250,7 +250,7 @@ bool TerminalStrip::addTerminal(Element *terminal) } } - if (terminal->elementData().m_type != ElementData::Terminale) { + if (terminal->elementData().m_type != ElementData::Terminal) { return false; } diff --git a/sources/dataBase/projectdatabase.cpp b/sources/dataBase/projectdatabase.cpp index f645a8d4d..f042417c2 100644 --- a/sources/dataBase/projectdatabase.cpp +++ b/sources/dataBase/projectdatabase.cpp @@ -450,8 +450,8 @@ void projectDataBase::populateElementTable() for (auto diagram : m_project->diagrams()) { const ElementProvider ep(diagram); - const auto elmt_vector = ep.find(ElementData::Simple | ElementData::Terminale | ElementData::Master | ElementData::Thumbnail); - //Insert all value into the database + const auto elmt_vector = ep.find(ElementData::Simple | ElementData::Terminal | ElementData::Master | ElementData::Thumbnail); + //Insert all values into the database for (const auto &elmt : elmt_vector) { const auto elmt_data = elmt->elementData(); @@ -479,9 +479,9 @@ void projectDataBase::populateElementInfoTable() for (const auto &diagram : m_project->diagrams()) { const ElementProvider ep(diagram); - const auto elmt_vector = ep.find(ElementData::Simple | ElementData::Terminale | ElementData::Master | ElementData::Thumbnail); + const auto elmt_vector = ep.find(ElementData::Simple | ElementData::Terminal | ElementData::Master | ElementData::Thumbnail); - //Insert all value into the database + //Insert all values into the database for (const auto &elmt : elmt_vector) { m_insert_element_info_query.bindValue(QStringLiteral(":uuid"), elmt->uuid().toString()); diff --git a/sources/dataBase/ui/elementquerywidget.cpp b/sources/dataBase/ui/elementquerywidget.cpp index ecdc6b5b4..84956fb28 100644 --- a/sources/dataBase/ui/elementquerywidget.cpp +++ b/sources/dataBase/ui/elementquerywidget.cpp @@ -171,7 +171,7 @@ void ElementQueryWidget::setQuery(const QString &query) if (ui->m_simple_cb->isChecked()) { ++c; } - ui->m_terminal_cb->setChecked (str_type.contains(ElementData::typeToString(ElementData::Terminale)) ? true : false); + ui->m_terminal_cb->setChecked (str_type.contains(ElementData::typeToString(ElementData::Terminal)) ? true : false); if (ui->m_terminal_cb->isChecked()) { ++c; } @@ -340,7 +340,7 @@ QString ElementQueryWidget::queryStr() const bool b = false; if (ui->m_terminal_cb->isChecked()) { if (b) where +=" OR"; - where += QStringLiteral(" element_type = '") += ElementData::typeToString(ElementData::Terminale) += "'"; + where += QStringLiteral(" element_type = '") += ElementData::typeToString(ElementData::Terminal) += "'"; b = true; } if (ui->m_thumbnail_cb->isChecked()) { diff --git a/sources/editor/elementscene.cpp b/sources/editor/elementscene.cpp index c0bc81ab5..93ae7351e 100644 --- a/sources/editor/elementscene.cpp +++ b/sources/editor/elementscene.cpp @@ -463,7 +463,7 @@ const QDomDocument ElementScene::toXml(bool all_parts) auto type_ = m_element_data.m_type; if (type_ == ElementData::Slave || type_ == ElementData::Master || - type_ == ElementData::Terminale || + type_ == ElementData::Terminal || type_ == ElementData::Thumbnail) { root.appendChild(m_element_data.kindInfoToXml(xml_document)); @@ -471,7 +471,7 @@ const QDomDocument ElementScene::toXml(bool all_parts) if (type_ == ElementData::Simple || type_ == ElementData::Master || - type_ == ElementData::Terminale || + type_ == ElementData::Terminal || type_ == ElementData::Thumbnail) { QDomElement element_info = xml_document.createElement("elementInformations"); diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index 5bf01379b..3ba805601 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -98,7 +98,7 @@ void ElementPropertiesEditorWidget::upDateInterface() ui->m_master_type_cb->setCurrentIndex( ui->m_master_type_cb->findData ( m_data.m_master_type)); - } else if (m_data.m_type == ElementData::Terminale) { + } else if (m_data.m_type == ElementData::Terminal) { ui->m_terminal_type_cb->setCurrentIndex( ui->m_terminal_type_cb->findData( m_data.m_terminal_type)); @@ -121,7 +121,7 @@ void ElementPropertiesEditorWidget::setUpInterface() ui->m_base_type_cb->addItem (tr("Esclave"), ElementData::Slave); ui->m_base_type_cb->addItem (tr("Renvoi de folio suivant"), ElementData::NextReport); ui->m_base_type_cb->addItem (tr("Renvoi de folio précédent"), ElementData::PreviousReport); - ui->m_base_type_cb->addItem (tr("Bornier"), ElementData::Terminale); + ui->m_base_type_cb->addItem (tr("Bornier"), ElementData::Terminal); ui->m_base_type_cb->addItem (tr("Vignette"), ElementData::Thumbnail); // Slave option @@ -181,7 +181,7 @@ void ElementPropertiesEditorWidget::updateTree() case ElementData::Slave: ui->m_tree->setDisabled(true); break; - case ElementData::Terminale: + case ElementData::Terminal: ui->m_tree->setEnabled(true); break; default: @@ -227,7 +227,7 @@ void ElementPropertiesEditorWidget::on_m_buttonBox_accepted() else if (m_data.m_type == ElementData::Master) { m_data.m_master_type = ui->m_master_type_cb->currentData().value(); } - else if (m_data.m_type == ElementData::Terminale) + else if (m_data.m_type == ElementData::Terminal) { m_data.m_terminal_type = ui->m_terminal_type_cb->currentData().value(); m_data.m_terminal_function = ui->m_terminal_func_cb->currentData().value(); @@ -260,7 +260,7 @@ void ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged(int in slave = true; else if (type_ == ElementData::Master) master = true; - else if (type_ == ElementData::Terminale) + else if (type_ == ElementData::Terminal) terminal = true; ui->m_slave_gb->setVisible(slave); diff --git a/sources/elementprovider.cpp b/sources/elementprovider.cpp index fdf89c049..f3bf9b308 100644 --- a/sources/elementprovider.cpp +++ b/sources/elementprovider.cpp @@ -204,7 +204,7 @@ QVector ElementProvider::freeTerminal() const for (const auto element : elmt_list) { - if (element->elementData().m_type == ElementData::Terminale) + if (element->elementData().m_type == ElementData::Terminal) { const auto te{static_cast(element)}; if (!te->parentTerminalStrip()) { diff --git a/sources/properties/elementdata.cpp b/sources/properties/elementdata.cpp index 535c1a6cc..ba926dc35 100644 --- a/sources/properties/elementdata.cpp +++ b/sources/properties/elementdata.cpp @@ -102,7 +102,7 @@ QDomElement ElementData::kindInfoToXml(QDomDocument &document) returned_elmt.appendChild(xml_count); } - else if (m_type == ElementData::Terminale) + else if (m_type == ElementData::Terminal) { //type auto xml_type = document.createElement(QStringLiteral("kindInformation")); @@ -233,7 +233,7 @@ bool ElementData::operator==(const ElementData &data) const return false; } } - else if (data.m_type == ElementData::Terminale) { + else if (data.m_type == ElementData::Terminal) { //Check terminal type or overrided terminal type if (data.m_terminal_type_is_override != m_terminal_type_is_override) { return false; @@ -309,7 +309,7 @@ QString ElementData::typeToString(ElementData::Type type) return QStringLiteral("master"); case ElementData::Slave : return QStringLiteral("slave"); - case ElementData::Terminale : + case ElementData::Terminal : return QStringLiteral("terminal"); case ElementData::Thumbnail: return QStringLiteral("thumbnail"); @@ -333,7 +333,7 @@ ElementData::Type ElementData::typeFromString(const QString &string) } else if (string == QLatin1String("slave")) { return ElementData::Slave; } else if (string == QLatin1String("terminal")) { - return ElementData::Terminale; + return ElementData::Terminal; } else if (string == QLatin1String("thumbnail")) { return ElementData::Thumbnail; } @@ -548,7 +548,7 @@ void ElementData::kindInfoFromXml(const QDomElement &xml_element) { if (m_type == ElementData::Master || m_type == ElementData::Slave || - m_type == ElementData::Terminale) + m_type == ElementData::Terminal) { auto xml_kind = xml_element.firstChildElement(QStringLiteral("kindInformations")); for (const auto &dom_elmt : QETXML::findInDomElement(xml_kind, QStringLiteral("kindInformation"))) @@ -571,7 +571,7 @@ void ElementData::kindInfoFromXml(const QDomElement &xml_element) m_contact_count = dom_elmt.text().toInt(); } } - else if (m_type == ElementData::Terminale) { + else if (m_type == ElementData::Terminal) { if (name == QLatin1String("type")) { m_terminal_type = terminalTypeFromString(dom_elmt.text()); } else if (name == QLatin1String("function")) { diff --git a/sources/properties/elementdata.h b/sources/properties/elementdata.h index 3aa451f4a..ba99ea0eb 100644 --- a/sources/properties/elementdata.h +++ b/sources/properties/elementdata.h @@ -40,7 +40,7 @@ class ElementData : public PropertiesInterface AllReport = 6, Master = 8, Slave = 16, - Terminale = 32, + Terminal = 32, Thumbnail = 64}; Q_ENUM(Type) Q_DECLARE_FLAGS(Types, Type) diff --git a/sources/qetgraphicsitem/element.cpp b/sources/qetgraphicsitem/element.cpp index 86d3a5dc8..ba31b815e 100644 --- a/sources/qetgraphicsitem/element.cpp +++ b/sources/qetgraphicsitem/element.cpp @@ -845,7 +845,7 @@ bool Element::fromXml(QDomElement &e, QStringLiteral("elementInformation")); //Load override properties (For now, only used when the element is a terminal) - if (m_data.m_type == ElementData::Terminale) + if (m_data.m_type == ElementData::Terminal) { auto elmt_type_list = QETXML::subChild(e, QStringLiteral("properties"), QStringLiteral("element_type")); @@ -976,7 +976,7 @@ QDomElement Element::toXml( } //Save override properties (For now, only used when the element is a terminal) - if (m_data.m_type == ElementData::Terminale) + if (m_data.m_type == ElementData::Terminal) { QDomElement properties = document.createElement(QStringLiteral("properties")); QDomElement element_type = document.createElement(QStringLiteral("element_type")); diff --git a/sources/ui/elementinfowidget.cpp b/sources/ui/elementinfowidget.cpp index 951623070..e2dd7d1a7 100644 --- a/sources/ui/elementinfowidget.cpp +++ b/sources/ui/elementinfowidget.cpp @@ -179,7 +179,7 @@ void ElementInfoWidget::disableLiveEdit() void ElementInfoWidget::buildInterface() { QStringList keys; - if (m_element.data()->elementData().m_type == ElementData::Terminale) { + if (m_element.data()->elementData().m_type == ElementData::Terminal) { keys = QETInformation::terminalElementInfoKeys(); } else { keys = QETInformation::elementInfoKeys();