diff --git a/sources/TerminalStrip/terminalstrip.cpp b/sources/TerminalStrip/terminalstrip.cpp index 4b47c76cd..2b1b86da9 100644 --- a/sources/TerminalStrip/terminalstrip.cpp +++ b/sources/TerminalStrip/terminalstrip.cpp @@ -176,28 +176,30 @@ class PhysicalTerminal */ TerminalStrip::TerminalStrip(const QString &name, QETProject *project) : QObject(project), - m_name(name), m_project(project) -{} +{ + m_data.m_name = name; +} TerminalStrip::TerminalStrip(const QString &installation, const QString &location, const QString &name, QETProject *project) : QObject(project), - m_installation(installation), - m_location(location), - m_name(name), m_project(project) -{} +{ + m_data.m_installation = installation; + m_data.m_location = location; + m_data.m_name = name; +} void TerminalStrip::setInstallation(const QString &installation) { - m_installation = installation; + m_data.m_installation = installation; } void TerminalStrip::setLocation(const QString &location) { - m_location = location; + m_data.m_location = location; } void TerminalStrip::setName(const QString &name) { - m_name = name; + m_data.m_name = name; } /** diff --git a/sources/TerminalStrip/terminalstrip.h b/sources/TerminalStrip/terminalstrip.h index a6c8d1475..65fc9d999 100644 --- a/sources/TerminalStrip/terminalstrip.h +++ b/sources/TerminalStrip/terminalstrip.h @@ -20,6 +20,7 @@ #include #include +#include "terminalstripdata.h" class Element; class RealTerminal; @@ -33,9 +34,9 @@ class TerminalStrip : public QObject TerminalStrip(const QString &name, QETProject *project); TerminalStrip(const QString &installation, - const QString &location, - const QString &name, - QETProject *project); + const QString &location, + const QString &name, + QETProject *project); void setInstallation(const QString &installation); void setLocation(const QString &location); @@ -50,9 +51,7 @@ class TerminalStrip : public QObject QSharedPointer physicalTerminal(QSharedPointer terminal); private: - QString m_installation; - QString m_location; - QString m_name; + TerminalStripData m_data; QPointer m_project; QVector> m_terminal_elements_vector; QVector> m_real_terminals; diff --git a/sources/TerminalStrip/terminalstripdata.cpp b/sources/TerminalStrip/terminalstripdata.cpp new file mode 100644 index 000000000..f40a410b2 --- /dev/null +++ b/sources/TerminalStrip/terminalstripdata.cpp @@ -0,0 +1,33 @@ +/* + Copyright 2006-2021 The QElectroTech Team + This file is part of QElectroTech. + + QElectroTech is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + QElectroTech is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with QElectroTech. If not, see . +*/ +#include "terminalstripdata.h" + +TerminalStripData::TerminalStripData() +{ + +} + +QDomElement TerminalStripData::toXml(QDomDocument &xml_document) const +{ + +} + +bool TerminalStripData::fromXml(const QDomElement &xml_element) +{ + +} diff --git a/sources/TerminalStrip/terminalstripdata.h b/sources/TerminalStrip/terminalstripdata.h new file mode 100644 index 000000000..4704bf251 --- /dev/null +++ b/sources/TerminalStrip/terminalstripdata.h @@ -0,0 +1,42 @@ +/* + Copyright 2006-2021 The QElectroTech Team + This file is part of QElectroTech. + + QElectroTech is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + QElectroTech is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with QElectroTech. If not, see . +*/ +#ifndef TERMINALSTRIPDATA_H +#define TERMINALSTRIPDATA_H + +#include "../properties/propertiesinterface.h" +//#include "terminalstrip.h" + +class TerminalStripData : public PropertiesInterface +{ + friend class TerminalStrip; + + public: + TerminalStripData(); + + void toSettings(QSettings &/*settings*/, const QString = QString()) const override {} + void fromSettings (const QSettings &/*settings*/, const QString = QString()) override {} + + QDomElement toXml (QDomDocument &xml_document) const override; + bool fromXml (const QDomElement &xml_element) override; + + private : + QString m_installation, m_location, m_name; + +}; + +#endif // TERMINALSTRIPDATA_H