[qet] qet/qet: [5448] Apply clang-tidy's performance-unnecessary-value-param, performance-for- |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5448
Author: scorpio810
Date: 2018-07-19 16:14:31 +0200 (Thu, 19 Jul 2018)
Log Message:
-----------
Apply clang-tidy's performance-unnecessary-value-param, performance-for-
range-copy
Modified Paths:
--------------
trunk/sources/ElementsCollection/elementcollectionhandler.cpp
trunk/sources/ElementsCollection/elementcollectionhandler.h
trunk/sources/ElementsCollection/elementcollectionitem.cpp
trunk/sources/ElementsCollection/elementcollectionitem.h
trunk/sources/ElementsCollection/elementscollectionmodel.cpp
trunk/sources/ElementsCollection/elementscollectionmodel.h
trunk/sources/ElementsCollection/elementscollectionwidget.cpp
trunk/sources/ElementsCollection/elementscollectionwidget.h
trunk/sources/ElementsCollection/fileelementcollectionitem.cpp
trunk/sources/ElementsCollection/fileelementcollectionitem.h
trunk/sources/ElementsCollection/ui/renamedialog.cpp
trunk/sources/ElementsCollection/xmlelementcollection.cpp
trunk/sources/ElementsCollection/xmlelementcollection.h
trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp
trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.h
trunk/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp
trunk/sources/autoNum/assignvariables.cpp
trunk/sources/autoNum/assignvariables.h
trunk/sources/autoNum/numerotationcontext.cpp
trunk/sources/autoNum/numerotationcontext.h
trunk/sources/autoNum/ui/formulaautonumberingw.cpp
trunk/sources/autoNum/ui/formulaautonumberingw.h
trunk/sources/bordertitleblock.cpp
trunk/sources/bordertitleblock.h
trunk/sources/conductorautonumerotation.cpp
trunk/sources/conductorautonumerotation.h
trunk/sources/conductorproperties.cpp
trunk/sources/configpages.cpp
trunk/sources/createdxf.cpp
trunk/sources/createdxf.h
trunk/sources/diagram.cpp
trunk/sources/diagram.h
trunk/sources/diagramcommands.cpp
trunk/sources/diagramcommands.h
trunk/sources/diagramfoliolist.cpp
trunk/sources/diagramfoliolist.h
trunk/sources/diagramprintdialog.cpp
trunk/sources/diagramprintdialog.h
trunk/sources/editor/editorcommands.cpp
trunk/sources/editor/editorcommands.h
trunk/sources/editor/elementscene.cpp
trunk/sources/editor/elementscene.h
trunk/sources/editor/graphicspart/partdynamictextfield.cpp
trunk/sources/editor/graphicspart/partdynamictextfield.h
trunk/sources/editor/qetelementeditor.cpp
trunk/sources/editor/ui/dynamictextfieldeditor.cpp
trunk/sources/editor/ui/dynamictextfieldeditor.h
trunk/sources/editor/ui/elementpropertieseditorwidget.cpp
trunk/sources/elementspanel.cpp
trunk/sources/elementspanel.h
trunk/sources/elementtextpattern.cpp
trunk/sources/elementtextpattern.h
trunk/sources/exportdialog.cpp
trunk/sources/exportdialog.h
trunk/sources/projectconfigpages.cpp
trunk/sources/projectconfigpages.h
trunk/sources/qet.cpp
trunk/sources/qet.h
trunk/sources/qetapp.cpp
trunk/sources/qetgraphicsitem/conductor.cpp
trunk/sources/qetgraphicsitem/conductor.h
trunk/sources/qetgraphicsitem/crossrefitem.cpp
trunk/sources/qetgraphicsitem/crossrefitem.h
trunk/sources/qetgraphicsitem/diagramtextitem.cpp
trunk/sources/qetgraphicsitem/diagramtextitem.h
trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp
trunk/sources/qetgraphicsitem/element.cpp
trunk/sources/qetgraphicsitem/elementtextitemgroup.cpp
trunk/sources/qetgraphicsitem/qetshapeitem.cpp
trunk/sources/qetgraphicsitem/reportelement.cpp
trunk/sources/qetgraphicsitem/reportelement.h
trunk/sources/qetgraphicsitem/terminal.cpp
trunk/sources/qetproject.cpp
trunk/sources/qetproject.h
trunk/sources/qetsingleapplication.cpp
trunk/sources/qetsingleapplication.h
trunk/sources/qetxml.cpp
trunk/sources/qetxml.h
trunk/sources/titleblock/qettemplateeditor.cpp
trunk/sources/titleblock/qettemplateeditor.h
trunk/sources/ui/compositetexteditdialog.cpp
trunk/sources/ui/dynamicelementtextmodel.cpp
trunk/sources/ui/elementinfopartwidget.cpp
trunk/sources/ui/elementinfopartwidget.h
trunk/sources/ui/formulaassistantdialog.cpp
trunk/sources/ui/formulaassistantdialog.h
trunk/sources/ui/reportpropertiewidget.cpp
trunk/sources/ui/reportpropertiewidget.h
trunk/sources/ui/titleblockpropertieswidget.cpp
trunk/sources/ui/xrefpropertieswidget.cpp
trunk/sources/undocommand/addelementtextcommand.cpp
trunk/sources/undocommand/addelementtextcommand.h
trunk/sources/undocommand/linkelementcommand.cpp
trunk/sources/undocommand/linkelementcommand.h
trunk/sources/undocommand/rotateselectioncommand.cpp
trunk/sources/undocommand/rotatetextscommand.cpp
trunk/sources/undocommand/rotatetextscommand.h
Modified: trunk/sources/ElementsCollection/elementcollectionhandler.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementcollectionhandler.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/elementcollectionhandler.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -76,7 +76,7 @@
return copyDirectory(m_source, m_destination, rename);
}
-ElementsLocation ECHSFileToFile::copyDirectory(ElementsLocation &source, ElementsLocation &destination, QString rename)
+ElementsLocation ECHSFileToFile::copyDirectory(ElementsLocation &source, ElementsLocation &destination, const QString& rename)
{
QDir source_dir(source.fileSystemPath());
QDir destination_dir(destination.fileSystemPath());
@@ -130,7 +130,7 @@
return ElementsLocation();
}
-ElementsLocation ECHSFileToFile::copyElement(ElementsLocation &source, ElementsLocation &destination, QString rename)
+ElementsLocation ECHSFileToFile::copyElement(ElementsLocation &source, ElementsLocation &destination, const QString& rename)
{
QString new_elmt_name = rename.isEmpty() ? source.fileName() : rename;
bool rb = QFile::copy(source.fileSystemPath(), destination.fileSystemPath() + "/" + new_elmt_name);
@@ -184,7 +184,7 @@
return copyDirectory(m_source, m_destination, rename);
}
-ElementsLocation ECHSXmlToFile::copyDirectory(ElementsLocation &source, ElementsLocation &destination, QString rename)
+ElementsLocation ECHSXmlToFile::copyDirectory(ElementsLocation &source, ElementsLocation &destination, const QString& rename)
{
QDir destination_dir(destination.fileSystemPath());
@@ -231,7 +231,7 @@
return ElementsLocation();
}
-ElementsLocation ECHSXmlToFile::copyElement(ElementsLocation &source, ElementsLocation &destination, QString rename)
+ElementsLocation ECHSXmlToFile::copyElement(ElementsLocation &source, ElementsLocation &destination, const QString& rename)
{
if (!(destination.exist() && source.exist())) return ElementsLocation();
Modified: trunk/sources/ElementsCollection/elementcollectionhandler.h
===================================================================
--- trunk/sources/ElementsCollection/elementcollectionhandler.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/elementcollectionhandler.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -48,8 +48,8 @@
ElementsLocation copy() override;
private:
- ElementsLocation copyDirectory(ElementsLocation &source, ElementsLocation &destination, QString rename = QString());
- ElementsLocation copyElement(ElementsLocation &source, ElementsLocation &destination, QString rename = QString());
+ ElementsLocation copyDirectory(ElementsLocation &source, ElementsLocation &destination, const QString& rename = QString());
+ ElementsLocation copyElement(ElementsLocation &source, ElementsLocation &destination, const QString& rename = QString());
};
/**
@@ -63,8 +63,8 @@
ElementsLocation copy() override;
private:
- ElementsLocation copyDirectory(ElementsLocation &source, ElementsLocation &destination, QString rename = QString());
- ElementsLocation copyElement(ElementsLocation &source, ElementsLocation &destination, QString rename = QString());
+ ElementsLocation copyDirectory(ElementsLocation &source, ElementsLocation &destination, const QString& rename = QString());
+ ElementsLocation copyElement(ElementsLocation &source, ElementsLocation &destination, const QString& rename = QString());
};
/**
Modified: trunk/sources/ElementsCollection/elementcollectionitem.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementcollectionitem.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/elementcollectionitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -71,7 +71,7 @@
* @param name
* @return
*/
-ElementCollectionItem *ElementCollectionItem::childWithCollectionName(QString name) const
+ElementCollectionItem *ElementCollectionItem::childWithCollectionName(const QString& name) const
{
rowCount();
foreach (QStandardItem *qsi, directChilds()) {
Modified: trunk/sources/ElementsCollection/elementcollectionitem.h
===================================================================
--- trunk/sources/ElementsCollection/elementcollectionitem.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/elementcollectionitem.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -46,7 +46,7 @@
virtual void clearData();
ElementCollectionItem *lastItemForPath(const QString &path, QString &no_found_path);
- ElementCollectionItem *childWithCollectionName(QString name) const;
+ ElementCollectionItem *childWithCollectionName(const QString& name) const;
QList<QStandardItem *> directChilds() const;
int rowForInsertItem(const QString &name);
ElementCollectionItem *itemAtPath(const QString &path);
Modified: trunk/sources/ElementsCollection/elementscollectionmodel.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementscollectionmodel.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/elementscollectionmodel.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -286,7 +286,7 @@
* If the location is already managed by this model, do nothing.
* @param location
*/
-void ElementsCollectionModel::addLocation(ElementsLocation location)
+void ElementsCollectionModel::addLocation(const ElementsLocation& location)
{
QModelIndex index = indexFromLocation(location);
if (index.isValid())
@@ -504,7 +504,7 @@
* this method create and display the new element
* @param path -The path of the new element in the embedded collection of a project
*/
-void ElementsCollectionModel::elementIntegratedToCollection(QString path)
+void ElementsCollectionModel::elementIntegratedToCollection(const QString& path)
{
QObject *object = sender();
XmlElementCollection *collection = static_cast<XmlElementCollection *> (object);
@@ -537,7 +537,7 @@
* This method must be called by a signal, to get a sender.
* @param path
*/
-void ElementsCollectionModel::itemRemovedFromCollection(QString path)
+void ElementsCollectionModel::itemRemovedFromCollection(const QString& path)
{
QObject *object = sender();
XmlElementCollection *collection = static_cast<XmlElementCollection *> (object);
@@ -565,7 +565,7 @@
* Update the item at path
* @param path
*/
-void ElementsCollectionModel::updateItem(QString path)
+void ElementsCollectionModel::updateItem(const QString& path)
{
QObject *object = sender();
XmlElementCollection *collection = static_cast<XmlElementCollection *> (object);
Modified: trunk/sources/ElementsCollection/elementscollectionmodel.h
===================================================================
--- trunk/sources/ElementsCollection/elementscollectionmodel.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/elementscollectionmodel.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -45,7 +45,7 @@
void addCommonCollection(bool set_data = true);
void addCustomCollection(bool set_data = true);
- void addLocation(ElementsLocation location);
+ void addLocation(const ElementsLocation& location);
void addProject(QETProject *project, bool set_data = true);
void removeProject(QETProject *project);
@@ -64,9 +64,9 @@
void loadingProgressValue(int);
private:
- void elementIntegratedToCollection (QString path);
- void itemRemovedFromCollection (QString path);
- void updateItem (QString path);
+ void elementIntegratedToCollection (const QString& path);
+ void itemRemovedFromCollection (const QString& path);
+ void updateItem (const QString& path);
private:
QList <QETProject *> m_project_list;
Modified: trunk/sources/ElementsCollection/elementscollectionwidget.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementscollectionwidget.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/elementscollectionwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -566,7 +566,7 @@
* Update or add the item represented by location to m_model
* @param location
*/
-void ElementsCollectionWidget::locationWasSaved(ElementsLocation location)
+void ElementsCollectionWidget::locationWasSaved(const ElementsLocation& location)
{
//Because this method update an item in the model, location must
//represente an existing element (in file system of project)
Modified: trunk/sources/ElementsCollection/elementscollectionwidget.h
===================================================================
--- trunk/sources/ElementsCollection/elementscollectionwidget.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/elementscollectionwidget.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -81,7 +81,7 @@
void reload();
private:
- void locationWasSaved(ElementsLocation location);
+ void locationWasSaved(const ElementsLocation& location);
private:
Modified: trunk/sources/ElementsCollection/fileelementcollectionitem.cpp
===================================================================
--- trunk/sources/ElementsCollection/fileelementcollectionitem.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/fileelementcollectionitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -37,7 +37,7 @@
* @param path
* @return true if path exist.
*/
-bool FileElementCollectionItem::setRootPath(QString path, bool set_data, bool hide_element)
+bool FileElementCollectionItem::setRootPath(const QString& path, bool set_data, bool hide_element)
{
QDir dir(path);
if (dir.exists()) {
@@ -278,7 +278,7 @@
* For create a new file collection see setRootPath.
* @param path_name
*/
-void FileElementCollectionItem::setPathName(QString path_name, bool set_data, bool hide_element)
+void FileElementCollectionItem::setPathName(const QString& path_name, bool set_data, bool hide_element)
{
m_path = path_name;
Modified: trunk/sources/ElementsCollection/fileelementcollectionitem.h
===================================================================
--- trunk/sources/ElementsCollection/fileelementcollectionitem.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/fileelementcollectionitem.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -33,7 +33,7 @@
enum { Type = UserType+2 };
int type() const override { return Type;}
- bool setRootPath(QString path, bool set_data = true, bool hide_element = false);
+ bool setRootPath(const QString& path, bool set_data = true, bool hide_element = false);
QString fileSystemPath() const;
QString dirPath() const;
@@ -54,7 +54,7 @@
private:
- void setPathName(QString path_name, bool set_data = true, bool hide_element = false);
+ void setPathName(const QString& path_name, bool set_data = true, bool hide_element = false);
void populate(bool set_data = true, bool hide_element = false);
private:
Modified: trunk/sources/ElementsCollection/ui/renamedialog.cpp
===================================================================
--- trunk/sources/ElementsCollection/ui/renamedialog.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/ui/renamedialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -16,12 +16,14 @@
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "renamedialog.h"
+
+#include <utility>
#include "ui_renamedialog.h"
RenameDialog::RenameDialog(QString path, QWidget *parent) :
QDialog(parent),
ui(new Ui::RenameDialog),
- m_path(path)
+ m_path(std::move(path))
{
ui->setupUi(this);
m_name = m_path.split("/").last();
Modified: trunk/sources/ElementsCollection/xmlelementcollection.cpp
===================================================================
--- trunk/sources/ElementsCollection/xmlelementcollection.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/xmlelementcollection.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -462,7 +462,7 @@
* @return True if element is removed and emit the signal elementRemoved.
* else false.
*/
-bool XmlElementCollection::removeElement(QString path)
+bool XmlElementCollection::removeElement(const QString& path)
{
QDomElement elmt = element(path);
@@ -486,7 +486,7 @@
* @param deep_copy : if true copy all childs of source (only if source is directory)
* @return the ElementLocation that represent the copy, if copy failed return a null ElementLocation
*/
-ElementsLocation XmlElementCollection::copy(ElementsLocation &source, ElementsLocation &destination, QString rename, bool deep_copy)
+ElementsLocation XmlElementCollection::copy(ElementsLocation &source, ElementsLocation &destination, const QString& rename, bool deep_copy)
{
if (!(source.exist() && destination.isDirectory() && destination.isProject() && destination.projectCollection() == this))
return ElementsLocation();
@@ -520,7 +520,7 @@
* @param name_list : translation of the directorie name.
* @return true if creation success, if directorie already exist return true.
*/
-bool XmlElementCollection::createDir(QString path, QString name, const NamesList &name_list)
+bool XmlElementCollection::createDir(const QString& path, const QString& name, const NamesList &name_list)
{
QString new_dir_path = path + "/" + name;
@@ -552,7 +552,7 @@
* @return true if successfuly removed and emit directoryRemoved(QString),
* else false.
*/
-bool XmlElementCollection::removeDir(QString path)
+bool XmlElementCollection::removeDir(const QString& path)
{
QDomElement dir = directory(path);
if (!dir.isNull()) {
@@ -670,7 +670,7 @@
* @param deep_copy :if true copy all childs of source
* @return the ElementLocation that represent the copy, if copy failed return a null ElementLocation
*/
-ElementsLocation XmlElementCollection::copyDirectory(ElementsLocation &source, ElementsLocation &destination, QString rename, bool deep_copy)
+ElementsLocation XmlElementCollection::copyDirectory(ElementsLocation &source, ElementsLocation &destination, const QString& rename, bool deep_copy)
{
QString new_dir_name = rename.isEmpty() ? source.fileName() : rename;
@@ -757,7 +757,7 @@
* @param rename : rename the copy with @rename else use the name of source
* @return The ElementsLocation of the copy
*/
-ElementsLocation XmlElementCollection::copyElement(ElementsLocation &source, ElementsLocation &destination, QString rename)
+ElementsLocation XmlElementCollection::copyElement(ElementsLocation &source, ElementsLocation &destination, const QString& rename)
{
QString new_elmt_name = rename.isEmpty() ? source.fileName() : rename;
Modified: trunk/sources/ElementsCollection/xmlelementcollection.h
===================================================================
--- trunk/sources/ElementsCollection/xmlelementcollection.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/xmlelementcollection.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -50,11 +50,11 @@
QDomElement directory(const QString &path) const;
QString addElement (ElementsLocation &location);
bool addElementDefinition (const QString &dir_path, const QString &elmt_name, const QDomElement &xml_definition);
- bool removeElement(QString path);
- ElementsLocation copy (ElementsLocation &source, ElementsLocation &destination, QString rename = QString(), bool deep_copy = true);
+ bool removeElement(const QString& path);
+ ElementsLocation copy (ElementsLocation &source, ElementsLocation &destination, const QString& rename = QString(), bool deep_copy = true);
bool exist (const QString &path) const;
- bool createDir (QString path, QString name, const NamesList &name_list);
- bool removeDir (QString path);
+ bool createDir (const QString& path, const QString& name, const NamesList &name_list);
+ bool removeDir (const QString& path);
QList <ElementsLocation> elementsLocation (QDomElement dom_element = QDomElement(), bool childs = true) const;
ElementsLocation domToLocation(QDomElement dom_element) const;
@@ -63,8 +63,8 @@
void cleanUnusedDirectory();
private:
- ElementsLocation copyDirectory(ElementsLocation &source, ElementsLocation &destination, QString rename = QString(), bool deep_copy = true);
- ElementsLocation copyElement(ElementsLocation &source, ElementsLocation &destination, QString rename = QString());
+ ElementsLocation copyDirectory(ElementsLocation &source, ElementsLocation &destination, const QString& rename = QString(), bool deep_copy = true);
+ ElementsLocation copyElement(ElementsLocation &source, ElementsLocation &destination, const QString& rename = QString());
signals:
/**
Modified: trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp
===================================================================
--- trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -259,7 +259,7 @@
* @param project : the parent project of managed collection
* @param set_data : if true, call setUpData for every child of this item
*/
-void XmlProjectElementCollectionItem::setXmlElement(QDomElement element, QETProject *project, bool set_data, bool hide_element)
+void XmlProjectElementCollectionItem::setXmlElement(const QDomElement& element, QETProject *project, bool set_data, bool hide_element)
{
m_dom_element = element;
m_project = project;
Modified: trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.h
===================================================================
--- trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ElementsCollection/xmlprojectelementcollectionitem.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -51,7 +51,7 @@
private:
void populate(bool set_data = true, bool hide_element = false);
- void setXmlElement(QDomElement element, QETProject *project, bool set_data = true, bool hide_element = false);
+ void setXmlElement(const QDomElement& element, QETProject *project, bool set_data = true, bool hide_element = false);
private:
QETProject *m_project = nullptr;
Modified: trunk/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp
===================================================================
--- trunk/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -18,6 +18,7 @@
#include "qetgraphicshandleritem.h"
#include <QPainter>
#include <QDebug>
+#include <utility>
/**
* @brief QetGraphicsHandlerItem::QetGraphicsHandlerItem
@@ -46,7 +47,7 @@
*/
void QetGraphicsHandlerItem::setColor(QColor color)
{
- m_color = color;
+ m_color = std::move(color);
update();
}
Modified: trunk/sources/autoNum/assignvariables.cpp
===================================================================
--- trunk/sources/autoNum/assignvariables.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/autoNum/assignvariables.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -24,6 +24,7 @@
#include <QVariant>
#include <QStringList>
+#include <utility>
namespace autonum
{
@@ -88,7 +89,7 @@
* @param tag_name : the tag name used for the QDomElement.
* @return A QDomElement, if this sequential have no value, the returned QDomELement is empty
*/
- QDomElement sequentialNumbers::toXml(QDomDocument &document, QString tag_name) const
+ QDomElement sequentialNumbers::toXml(QDomDocument &document, const QString& tag_name) const
{
QDomElement element = document.createElement(tag_name);
@@ -161,7 +162,7 @@
*/
QString AssignVariables::formulaToLabel(QString formula, sequentialNumbers &seqStruct, Diagram *diagram, const Element *elmt)
{
- AssignVariables av(formula, seqStruct, diagram, elmt);
+ AssignVariables av(std::move(formula), seqStruct, diagram, elmt);
seqStruct = av.m_seq_struct;
return av.m_assigned_label;
}
@@ -193,7 +194,7 @@
return str;
}
- AssignVariables::AssignVariables(QString formula, sequentialNumbers seqStruct , Diagram *diagram, const Element *elmt):
+ AssignVariables::AssignVariables(const QString& formula, const sequentialNumbers& seqStruct , Diagram *diagram, const Element *elmt):
m_diagram(diagram),
m_arg_formula(formula),
m_assigned_label(formula),
@@ -293,7 +294,7 @@
* @param context : numerotation context to retrieve value
* @param type : type of sequential (unit, unitfolio, ten, tenfolio, hundred, hundredfolio)
*/
- void setSequentialToList(QStringList &list, NumerotationContext &context, QString type)
+ void setSequentialToList(QStringList &list, NumerotationContext &context, const QString& type)
{
for (int i = 0; i < context.size(); i++)
{
@@ -317,7 +318,7 @@
* @param hash : hash to have values inserted
* @param autoNumName : name to use as key of hash
*/
- void setFolioSequentialToHash(QStringList &list, QHash<QString, QStringList> &hash, QString autoNumName)
+ void setFolioSequentialToHash(QStringList &list, QHash<QString, QStringList> &hash, const QString& autoNumName)
{
if (hash.isEmpty() || !hash.contains(autoNumName))
{
@@ -354,7 +355,7 @@
* to keep up to date the current sequential of folio.
* @param hashKey : the hash key used to store the sequential for folio type.
*/
- void setSequential(QString label, sequentialNumbers &seqStruct, NumerotationContext &context, Diagram *diagram, QString hashKey)
+ void setSequential(const QString& label, sequentialNumbers &seqStruct, NumerotationContext &context, Diagram *diagram, const QString& hashKey)
{
if (!context.isEmpty())
{
Modified: trunk/sources/autoNum/assignvariables.h
===================================================================
--- trunk/sources/autoNum/assignvariables.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/autoNum/assignvariables.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -42,7 +42,7 @@
bool operator== (const sequentialNumbers &other) const;
bool operator!= (const sequentialNumbers &other) const;
- QDomElement toXml(QDomDocument &document, QString tag_name = QString("sequentialNumbers")) const;
+ QDomElement toXml(QDomDocument &document, const QString& tag_name = QString("sequentialNumbers")) const;
void fromXml(const QDomElement &element);
void clear();
@@ -66,7 +66,7 @@
static QString replaceVariable (const QString &formula, const DiagramContext &dc);
private:
- AssignVariables(QString formula, sequentialNumbers seqStruct , Diagram *diagram, const Element *elmt = nullptr);
+ AssignVariables(const QString& formula, const sequentialNumbers& seqStruct , Diagram *diagram, const Element *elmt = nullptr);
void assignTitleBlockVar();
void assignProjectVar();
void assignSequence();
@@ -78,9 +78,9 @@
const Element *m_element = nullptr;
};
- void setSequentialToList(QStringList &list, NumerotationContext &nc, QString type);
- void setFolioSequentialToHash(QStringList &list, QHash<QString, QStringList> &hash, QString autoNumName);
- void setSequential(QString label, autonum::sequentialNumbers &seqStruct, NumerotationContext &context, Diagram *diagram, QString hashKey);
+ void setSequentialToList(QStringList &list, NumerotationContext &nc, const QString& type);
+ void setFolioSequentialToHash(QStringList &list, QHash<QString, QStringList> &hash, const QString& autoNumName);
+ void setSequential(const QString& label, autonum::sequentialNumbers &seqStruct, NumerotationContext &context, Diagram *diagram, const QString& hashKey);
QString numerotationContextToFormula(const NumerotationContext &nc);
QString elementPrefixForLocation(const ElementsLocation &location);
}
Modified: trunk/sources/autoNum/numerotationcontext.cpp
===================================================================
--- trunk/sources/autoNum/numerotationcontext.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/autoNum/numerotationcontext.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -16,6 +16,8 @@
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "numerotationcontext.h"
+
+#include <utility>
#include "qet.h"
/**
@@ -130,7 +132,7 @@
* @brief NumerotationContext::toXml
* Save the numerotation context in a QDomElement under the element name @str
*/
-QDomElement NumerotationContext::toXml(QDomDocument &d, QString str) {
+QDomElement NumerotationContext::toXml(QDomDocument &d, const QString& str) {
QDomElement num_auto = d.createElement(str);
for (int i=0; i<content_.size(); ++i) {
QStringList strl = itemAt(i);
@@ -166,7 +168,7 @@
void NumerotationContext::replaceValue(int index, QString content) {
QString sep = "|";
QString type = content_[index].split("|").at(0);
- QString value = content;
+ const QString& value = std::move(content);
QString increase = content_[index].split("|").at(2);
QString initvalue = content_[index].split("|").at(3);
content_[index].replace(content_[index], type + "|" + value + "|" + increase + "|" + initvalue);
Modified: trunk/sources/autoNum/numerotationcontext.h
===================================================================
--- trunk/sources/autoNum/numerotationcontext.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/autoNum/numerotationcontext.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -43,7 +43,7 @@
QString validRegExpNumber() const;
bool keyIsAcceptable (const QString &) const;
bool keyIsNumber(const QString &) const;
- QDomElement toXml(QDomDocument &, QString);
+ QDomElement toXml(QDomDocument &, const QString&);
void fromXml(QDomElement &);
void replaceValue(int, QString);
Modified: trunk/sources/autoNum/ui/formulaautonumberingw.cpp
===================================================================
--- trunk/sources/autoNum/ui/formulaautonumberingw.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/autoNum/ui/formulaautonumberingw.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -20,6 +20,7 @@
#include <QMessageBox>
#include <QPushButton>
#include <QtWidgets>
+#include <utility>
/**
* Constructor
@@ -45,7 +46,7 @@
* @brief FormulaAutonumberingW::setContext
* @param formula to be inserted into context
*/
-void FormulaAutonumberingW::setContext(QString formula) {
+void FormulaAutonumberingW::setContext(const QString& formula) {
ui->m_formula_le->insert(formula);
}
@@ -70,5 +71,5 @@
* Update Apply Button
*/
void FormulaAutonumberingW::on_m_formula_le_textChanged(QString text) {
- emit (textChanged(text));
+ emit (textChanged(std::move(text)));
}
Modified: trunk/sources/autoNum/ui/formulaautonumberingw.h
===================================================================
--- trunk/sources/autoNum/ui/formulaautonumberingw.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/autoNum/ui/formulaautonumberingw.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -41,7 +41,7 @@
explicit FormulaAutonumberingW(QWidget *parent = nullptr);
~FormulaAutonumberingW() override;
QString formula();
- void setContext(QString);
+ void setContext(const QString&);
void clearContext();
Ui::FormulaAutonumberingW *ui;
Modified: trunk/sources/bordertitleblock.cpp
===================================================================
--- trunk/sources/bordertitleblock.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/bordertitleblock.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -16,6 +16,7 @@
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QPainter>
+#include <utility>
#include "titleblocktemplate.h"
#include "titleblocktemplaterenderer.h"
#include "bordertitleblock.h"
@@ -408,7 +409,7 @@
* Set Page (Folio) Auto Num
*/
void BorderTitleBlock::slot_setAutoPageNum(QString pageAutoNum) {
- btb_auto_page_num_=pageAutoNum;
+ btb_auto_page_num_=std::move(pageAutoNum);
}
/**
@@ -735,7 +736,7 @@
@param total nombre total de schemas dans le projet
@param project_properties Project-wide properties, to be merged with diagram-wide ones.
*/
-void BorderTitleBlock::setFolioData(int index, int total, QString autonum, const DiagramContext &project_properties) {
+void BorderTitleBlock::setFolioData(int index, int total, const QString& autonum, const DiagramContext &project_properties) {
if (index < 1 || total < 1 || index > total) return;
// memorise les informations
Modified: trunk/sources/bordertitleblock.h
===================================================================
--- trunk/sources/bordertitleblock.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/bordertitleblock.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -153,7 +153,7 @@
btb_folio_ = folio;
emit (titleBlockFolioChanged(folio));
}
- void setFolioData(int, int, QString = nullptr, const DiagramContext & = DiagramContext());
+ void setFolioData(int, int, const QString& = nullptr, const DiagramContext & = DiagramContext());
/// @param author the new value of the "File" field
void setMachine(const QString &machine) { btb_machine_ = machine; }
void setLocMach(const QString &locmach) { btb_locmach_ = locmach; }
Modified: trunk/sources/conductorautonumerotation.cpp
===================================================================
--- trunk/sources/conductorautonumerotation.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/conductorautonumerotation.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -56,7 +56,7 @@
* @brief ConductorAutoNumerotation::applyText
* apply the text @t to @conductor_ and all conductors at the same potential
*/
-void ConductorAutoNumerotation::applyText(QString t)
+void ConductorAutoNumerotation::applyText(const QString& t)
{
if (!m_conductor) return;
Modified: trunk/sources/conductorautonumerotation.h
===================================================================
--- trunk/sources/conductorautonumerotation.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/conductorautonumerotation.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -32,7 +32,7 @@
//methods
void numerate ();
- void applyText (QString);
+ void applyText (const QString&);
private:
//methods
Modified: trunk/sources/conductorproperties.cpp
===================================================================
--- trunk/sources/conductorproperties.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/conductorproperties.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -17,6 +17,7 @@
*/
#include "conductorproperties.h"
#include <QPainter>
+#include <utility>
/**
Constructeur par defaut
@@ -426,7 +427,7 @@
*/
void ConductorProperties::applyForEqualAttributes(QList<ConductorProperties> list)
{
- const QList<ConductorProperties> clist = list;
+ const QList<ConductorProperties> clist = std::move(list);
if (clist.isEmpty())
return;
Modified: trunk/sources/configpages.cpp
===================================================================
--- trunk/sources/configpages.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/configpages.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -30,6 +30,7 @@
#include <QFontDialog>
#include <QFont>
#include <QSizePolicy>
+#include <utility>
/**
* @brief NewDiagramPage::NewDiagramPage
@@ -203,7 +204,7 @@
* Set temporary TBP to use in auto folio num
*/
void NewDiagramPage::setFolioAutonum(QString autoNum){
- TitleBlockProperties tbptemp = ipw->propertiesAutoNum(autoNum);
+ TitleBlockProperties tbptemp = ipw->propertiesAutoNum(std::move(autoNum));
ipw->setProperties(tbptemp);
applyConf();
}
Modified: trunk/sources/createdxf.cpp
===================================================================
--- trunk/sources/createdxf.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/createdxf.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -39,7 +39,7 @@
}
/* Header section of every DXF file.*/
-void Createdxf::dxfBegin (QString fileName)
+void Createdxf::dxfBegin (const QString& fileName)
{
// Creation of an output stream object in text mode.
@@ -229,7 +229,7 @@
}
/* End Section of every DXF File*/
-void Createdxf::dxfEnd (QString fileName)
+void Createdxf::dxfEnd (const QString& fileName)
{
// Creation of an output stream object in text mode.
if (!fileName.isEmpty()) {
@@ -253,7 +253,7 @@
/* draw circle in dxf format*/
-void Createdxf::drawCircle (QString fileName, double radius, double x, double y, int colour)
+void Createdxf::drawCircle (const QString& fileName, double radius, double x, double y, int colour)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
@@ -668,7 +668,7 @@
}
/* draw arc in dx format */
-void Createdxf::drawArc(QString fileName,double x,double y,double rad,double startAngle,double endAngle,int color)
+void Createdxf::drawArc(const QString& fileName,double x,double y,double rad,double startAngle,double endAngle,int color)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
@@ -705,7 +705,7 @@
}
/* draw simple text in dxf format without any alignment specified */
-void Createdxf::drawText(QString fileName, QString text,double x, double y, double height, double rotation, int colour)
+void Createdxf::drawText(const QString& fileName, const QString& text,double x, double y, double height, double rotation, int colour)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
@@ -744,7 +744,7 @@
/* draw aligned text in DXF Format */
// leftAlign flag added. If the alignment requested is 'fit to width' and the text length is very small,
// then the text is either centered or left-aligned, depnding on the value of leftAlign.
-void Createdxf::drawTextAligned(QString fileName, QString text,double x, double y, double height, double rotation, double oblique,int hAlign, int vAlign, double xAlign,int colour,
+void Createdxf::drawTextAligned(const QString& fileName, const QString& text,double x, double y, double height, double rotation, double oblique,int hAlign, int vAlign, double xAlign,int colour,
bool leftAlign, float scale)
{
Q_UNUSED(scale);
Modified: trunk/sources/createdxf.h
===================================================================
--- trunk/sources/createdxf.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/createdxf.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -28,11 +28,11 @@
public:
Createdxf();
~Createdxf();
- static void dxfBegin (QString);
- static void dxfEnd(QString);
+ static void dxfBegin (const QString&);
+ static void dxfEnd(const QString&);
// you can add more functions to create more drawings.
- static void drawCircle(QString,double,double,double,int);
- static void drawArc(QString,double x,double y,double rad,double startAngle,double endAngle,int color);
+ static void drawCircle(const QString&,double,double,double,int);
+ static void drawArc(const QString&,double x,double y,double rad,double startAngle,double endAngle,int color);
static void drawDonut(QString,double,double,double,int);
static void drawArcEllipse (const QString &file_path, qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal spanAngle, qreal hotspot_x, qreal hotspot_y, qreal rotation_angle, const int &colorcode);
@@ -45,8 +45,8 @@
static void drawLine(const QString &filapath,double,double,double,double, const int &clorcode);
static void drawLine(const QString &filepath, const QLineF &line,const int &colorcode);
- static void drawText(QString,QString,double,double,double,double,int);
- static void drawTextAligned(QString fileName, QString text,double x, double y, double height, double rotation, double oblique,int hAlign, int vAlign, double xAlign, int colour, bool leftAlign = false, float scale = 0);
+ static void drawText(const QString&,const QString&,double,double,double,double,int);
+ static void drawTextAligned(const QString& fileName, const QString& text,double x, double y, double height, double rotation, double oblique,int hAlign, int vAlign, double xAlign, int colour, bool leftAlign = false, float scale = 0);
static int getcolorCode (const long red, const long green, const long blue);
Modified: trunk/sources/diagram.cpp
===================================================================
--- trunk/sources/diagram.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/diagram.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -1,4 +1,4 @@
-/*
+/*
Copyright 2006-2017 The QElectroTech Team
This file is part of QElectroTech.
@@ -729,7 +729,7 @@
+ * @param hash to retrieve content with content
+ * @param sequential type
+ */
-void Diagram::folioSequentialsToXml(QHash<QString, QStringList> *hash, QDomElement *domElement, QString seq_type, QString type, QDomDocument *doc) {
+void Diagram::folioSequentialsToXml(QHash<QString, QStringList> *hash, QDomElement *domElement, const QString& seq_type, const QString& type, QDomDocument *doc) {
QHash<QString, QStringList>::iterator i;
for (i = hash->begin(); i != hash->end(); i++) {
QDomElement folioseq = doc->createElement(type);
@@ -795,7 +795,7 @@
@return true si l'import a reussi, false sinon
*/
bool Diagram::fromXml(QDomElement &document, QPointF position, bool consider_informations, DiagramContent *content_ptr) {
- QDomElement root = document;
+ const QDomElement& root = document;
// The first element must be a diagram
if (root.tagName() != "diagram") return(false);
@@ -1019,7 +1019,7 @@
* @param seq type
* @param type of sequential
*/
-void Diagram::folioSequentialsFromXml(const QDomElement &root, QHash<QString, QStringList>* hash, QString folioSeq, QString seq, QString type, QString autonumFolioSeqType) {
+void Diagram::folioSequentialsFromXml(const QDomElement &root, QHash<QString, QStringList>* hash, const QString& folioSeq, const QString& seq, const QString& type, const QString& autonumFolioSeqType) {
foreach (QDomElement folioSeqAutoNum, QET::findInDomElement(root, autonumFolioSeqType, folioSeq)) {
for(QDomElement folioseq = folioSeqAutoNum.firstChildElement(type); !folioseq.isNull(); folioseq = folioseq.nextSiblingElement(type)) {
QString title = folioseq.attribute("title");
@@ -1236,7 +1236,7 @@
* @param type to be treated
* @param Numerotation Context to be manipulated
*/
-void Diagram::insertFolioSeqHash(QHash<QString, QStringList> *hash, QString title, QString type, NumerotationContext *nc) {
+void Diagram::insertFolioSeqHash(QHash<QString, QStringList> *hash, const QString& title, const QString& type, NumerotationContext *nc) {
QStringList max;
for (int i = 0; i < nc->size(); i++) {
if (nc->itemAt(i).at(0) == type) {
@@ -1257,7 +1257,7 @@
* @param type to be treated
* @param Numerotation Context to be manipulated
*/
-void Diagram::loadFolioSeqHash(QHash<QString, QStringList> *hash, QString title, QString type, NumerotationContext *nc) {
+void Diagram::loadFolioSeqHash(QHash<QString, QStringList> *hash, const QString& title, const QString& type, NumerotationContext *nc) {
int j = 0;
for (int i = 0; i < nc->size(); i++) {
if (nc->itemAt(i).at(0) == type) {
Modified: trunk/sources/diagram.h
===================================================================
--- trunk/sources/diagram.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/diagram.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -153,8 +153,8 @@
bool initFromXml(QDomElement &, QPointF = QPointF(), bool = true, DiagramContent * = nullptr);
bool fromXml(QDomDocument &, QPointF = QPointF(), bool = true, DiagramContent * = nullptr);
bool fromXml(QDomElement &, QPointF = QPointF(), bool = true, DiagramContent * = nullptr);
- void folioSequentialsToXml(QHash<QString, QStringList>*, QDomElement *, QString, QString, QDomDocument *);
- void folioSequentialsFromXml(const QDomElement&, QHash<QString, QStringList>*, QString, QString, QString, QString);
+ void folioSequentialsToXml(QHash<QString, QStringList>*, QDomElement *, const QString&, const QString&, QDomDocument *);
+ void folioSequentialsFromXml(const QDomElement&, QHash<QString, QStringList>*, const QString&, const QString&, const QString&, const QString&);
void refreshContents();
@@ -210,8 +210,8 @@
bool freezeNewConductors();
//methods related to insertion and loading of folio sequential
- void insertFolioSeqHash (QHash<QString, QStringList> *hash, QString title, QString seq, NumerotationContext *nc);
- void loadFolioSeqHash (QHash<QString, QStringList> *hash, QString title, QString seq, NumerotationContext *nc);
+ void insertFolioSeqHash (QHash<QString, QStringList> *hash, const QString& title, const QString& seq, NumerotationContext *nc);
+ void loadFolioSeqHash (QHash<QString, QStringList> *hash, const QString& title, const QString& seq, NumerotationContext *nc);
void changeZValue(QET::DepthOption option);
public slots:
Modified: trunk/sources/diagramcommands.cpp
===================================================================
--- trunk/sources/diagramcommands.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/diagramcommands.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -283,7 +283,7 @@
* @param start value at start
* @param end value at end
*/
-void MoveElementsCommand::setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant start, const QVariant end) {
+void MoveElementsCommand::setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant& start, const QVariant& end) {
//create animation group if not yet.
if (m_anim_group == nullptr) m_anim_group = new QParallelAnimationGroup();
QPropertyAnimation *animation = new QPropertyAnimation(target, propertyName);
Modified: trunk/sources/diagramcommands.h
===================================================================
--- trunk/sources/diagramcommands.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/diagramcommands.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -138,7 +138,7 @@
virtual void move(const QPointF &);
private:
- void setupAnimation (QObject * target, const QByteArray &propertyName, const QVariant start, const QVariant end);
+ void setupAnimation (QObject * target, const QByteArray &propertyName, const QVariant& start, const QVariant& end);
// attributes
private:
Modified: trunk/sources/diagramfoliolist.cpp
===================================================================
--- trunk/sources/diagramfoliolist.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/diagramfoliolist.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -119,8 +119,8 @@
* @param qp Qpainter to use
* @param row_rect rectangle where we must draw the new row
*/
-void DiagramFolioList::fillRow(QPainter *qp, const QRectF &row_rect, QString author, QString title,
- QString folio, QString machine, QString loc, QString indexrev, QString date)
+void DiagramFolioList::fillRow(QPainter *qp, const QRectF &row_rect, const QString& author, const QString& title,
+ const QString& folio, const QString& machine, const QString& loc, const QString& indexrev, const QString& date)
{
qreal x = row_rect.topLeft().x();
qreal y = row_rect.topLeft().y();
Modified: trunk/sources/diagramfoliolist.h
===================================================================
--- trunk/sources/diagramfoliolist.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/diagramfoliolist.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -37,7 +37,7 @@
void drawBackground(QPainter *, const QRectF &) override;
private:
- void fillRow(QPainter *, const QRectF &, QString, QString, QString, QString, QString, QString, QString);
+ void fillRow(QPainter *, const QRectF &, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&, const QString&);
void buildGrid(QPainter *, const QRectF &, int, int, qreal[]);
void fillHeader(QPainter *, const QRectF &);
Modified: trunk/sources/diagramprintdialog.cpp
===================================================================
--- trunk/sources/diagramprintdialog.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/diagramprintdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -352,7 +352,7 @@
ou non
@param options Options de rendu
*/
-void DiagramPrintDialog::print(const QList<Diagram *> &diagrams, bool fit_page, const ExportProperties options) {
+void DiagramPrintDialog::print(const QList<Diagram *> &diagrams, bool fit_page, const ExportProperties& options) {
//qDebug() << "Demande d'impression de " << diagrams.count() << "schemas.";
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
#ifdef Q_OS_WIN
@@ -516,7 +516,7 @@
@param save true pour memoriser les parametres du schema et appliquer ceux
definis dans options, false pour restaurer les parametres
*/
-void DiagramPrintDialog::saveReloadDiagramParameters(Diagram *diagram, const ExportProperties options, bool save) {
+void DiagramPrintDialog::saveReloadDiagramParameters(Diagram *diagram, const ExportProperties& options, bool save) {
static ExportProperties state_exportProperties;
if (save) {
Modified: trunk/sources/diagramprintdialog.h
===================================================================
--- trunk/sources/diagramprintdialog.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/diagramprintdialog.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -56,13 +56,13 @@
private:
void buildPrintTypeDialog();
void buildDialog();
- void saveReloadDiagramParameters(Diagram *, const ExportProperties, bool);
+ void saveReloadDiagramParameters(Diagram *, const ExportProperties&, bool);
void savePageSetupForCurrentPrinter();
void loadPageSetupForCurrentPrinter();
QString settingsSectionName(const QPrinter *);
private slots:
- void print(const QList<Diagram *> &, bool, const ExportProperties);
+ void print(const QList<Diagram *> &, bool, const ExportProperties&);
void printDiagram(Diagram *, bool, const ExportProperties &, QPainter *, QPrinter * = nullptr);
void updatePrintTypeDialog();
void acceptPrintTypeDialog();
Modified: trunk/sources/editor/editorcommands.cpp
===================================================================
--- trunk/sources/editor/editorcommands.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/editor/editorcommands.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -83,7 +83,7 @@
*/
DeletePartsCommand::DeletePartsCommand(
ElementScene *scene,
- const QList<QGraphicsItem *> parts,
+ const QList<QGraphicsItem *>& parts,
QUndoCommand *parent
) :
ElementEditionCommand(QObject::tr("suppression", "undo caption"), scene, nullptr, parent),
@@ -201,7 +201,7 @@
*/
CutPartsCommand::CutPartsCommand(
ElementScene *scene,
- const QList<QGraphicsItem *> parts,
+ const QList<QGraphicsItem *>& parts,
QUndoCommand *parent
) :
DeletePartsCommand(scene, parts, parent)
@@ -224,7 +224,7 @@
MovePartsCommand::MovePartsCommand(
const QPointF &m,
ElementScene *scene,
- const QList<QGraphicsItem *> parts,
+ const QList<QGraphicsItem *>& parts,
QUndoCommand *parent
) :
ElementEditionCommand(QObject::tr("déplacement", "undo caption"), scene, nullptr, parent),
@@ -593,7 +593,7 @@
* @param context: new info about type.
* @param parent: parent undo
*/
-ChangePropertiesCommand::ChangePropertiesCommand(ElementScene *scene, QString type, DiagramContext info, DiagramContext elmt_info, QUndoCommand *parent) :
+ChangePropertiesCommand::ChangePropertiesCommand(ElementScene *scene, const QString& type, const DiagramContext& info, const DiagramContext& elmt_info, QUndoCommand *parent) :
ElementEditionCommand(scene, nullptr, parent)
{
m_type << scene->m_elmt_type << type;
Modified: trunk/sources/editor/editorcommands.h
===================================================================
--- trunk/sources/editor/editorcommands.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/editor/editorcommands.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -60,7 +60,7 @@
class DeletePartsCommand : public ElementEditionCommand {
// constructors, destructor
public:
- DeletePartsCommand(ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = nullptr);
+ DeletePartsCommand(ElementScene *, const QList<QGraphicsItem *>&, QUndoCommand * = nullptr);
~DeletePartsCommand() override;
private:
DeletePartsCommand(const DeletePartsCommand &);
@@ -113,7 +113,7 @@
class CutPartsCommand : public DeletePartsCommand {
// constructors, destructor
public:
- CutPartsCommand(ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = nullptr);
+ CutPartsCommand(ElementScene *, const QList<QGraphicsItem *>&, QUndoCommand * = nullptr);
~CutPartsCommand() override;
private:
CutPartsCommand(const CutPartsCommand &);
@@ -125,7 +125,7 @@
class MovePartsCommand : public ElementEditionCommand {
// constructors, destructor
public:
- MovePartsCommand(const QPointF &, ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = nullptr);
+ MovePartsCommand(const QPointF &, ElementScene *, const QList<QGraphicsItem *>&, QUndoCommand * = nullptr);
~MovePartsCommand() override;
private:
MovePartsCommand(const MovePartsCommand &);
@@ -290,7 +290,7 @@
class ChangePropertiesCommand : public ElementEditionCommand {
public:
- ChangePropertiesCommand (ElementScene *scene, QString type, DiagramContext info, DiagramContext elmt_info, QUndoCommand *parent=nullptr);
+ ChangePropertiesCommand (ElementScene *scene, const QString& type, const DiagramContext& info, const DiagramContext& elmt_info, QUndoCommand *parent=nullptr);
~ChangePropertiesCommand () override;
void undo() override;
Modified: trunk/sources/editor/elementscene.cpp
===================================================================
--- trunk/sources/editor/elementscene.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/editor/elementscene.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -580,7 +580,7 @@
return m_element_editor;
}
-void ElementScene::setElementInfo(DiagramContext dc)
+void ElementScene::setElementInfo(const DiagramContext& dc)
{
if(m_elmt_information != dc)
{
Modified: trunk/sources/editor/elementscene.h
===================================================================
--- trunk/sources/editor/elementscene.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/editor/elementscene.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -120,7 +120,7 @@
void cut();
void copy();
QETElementEditor* editor() const;
- void setElementInfo(DiagramContext dc);
+ void setElementInfo(const DiagramContext& dc);
protected:
void mouseMoveEvent (QGraphicsSceneMouseEvent *) override;
Modified: trunk/sources/editor/graphicspart/partdynamictextfield.cpp
===================================================================
--- trunk/sources/editor/graphicspart/partdynamictextfield.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/editor/graphicspart/partdynamictextfield.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -333,7 +333,7 @@
* @brief PartDynamicTextField::setColor
* @param color set text color to color
*/
-void PartDynamicTextField::setColor(QColor color)
+void PartDynamicTextField::setColor(const QColor& color)
{
setDefaultTextColor(color);
emit colorChanged(color);
Modified: trunk/sources/editor/graphicspart/partdynamictextfield.h
===================================================================
--- trunk/sources/editor/graphicspart/partdynamictextfield.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/editor/graphicspart/partdynamictextfield.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -86,7 +86,7 @@
QString infoName() const;
void setCompositeText(const QString &text);
QString compositeText() const;
- void setColor(QColor color);
+ void setColor(const QColor& color);
QColor color() const;
void setFontSize(int s);
int fontSize()const;
Modified: trunk/sources/editor/qetelementeditor.cpp
===================================================================
--- trunk/sources/editor/qetelementeditor.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/editor/qetelementeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -55,6 +55,7 @@
#include <QFileDialog>
#include <QFile>
#include <QModelIndex>
+#include <utility>
/*
Nombre maximum de primitives affichees par la "liste des parties"
@@ -408,7 +409,7 @@
void QETElementEditor::contextMenu(QPoint p, QList<QAction *> actions)
{
QMenu menu(this);
- menu.addActions(actions);
+ menu.addActions(std::move(actions));
menu.addSeparator();
menu.addAction(undo);
menu.addAction(redo);
Modified: trunk/sources/editor/ui/dynamictextfieldeditor.cpp
===================================================================
--- trunk/sources/editor/ui/dynamictextfieldeditor.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/editor/ui/dynamictextfieldeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -45,7 +45,7 @@
{
delete ui;
if(!m_connection_list.isEmpty())
- for(QMetaObject::Connection con : m_connection_list)
+ for(const QMetaObject::Connection& con : m_connection_list)
disconnect(con);
}
@@ -59,7 +59,7 @@
{
//Remove previous connection
if(!m_connection_list.isEmpty())
- for(QMetaObject::Connection con : m_connection_list)
+ for(const QMetaObject::Connection& con : m_connection_list)
disconnect(con);
QGraphicsItem *qgi = part->toItem();
@@ -129,7 +129,7 @@
}
}
-void DynamicTextFieldEditor::setColorPushButton(QColor color)
+void DynamicTextFieldEditor::setColorPushButton(const QColor& color)
{
QPalette palette;
palette.setColor(QPalette::Button, color);
@@ -155,10 +155,10 @@
//We use a QMap because the keys of the map are sorted, then no matter the curent local,
//the value of the combo box are always alphabetically sorted
QMap <QString, QString> info_map;
- for(QString str : strl)
+ for(const QString& str : strl)
info_map.insert(QETApp::elementTranslatedInfoKey(str), str);
- for (QString key : info_map.keys())
+ for (const QString& key : info_map.keys())
ui->m_elmt_info_cb->addItem(key, info_map.value(key));
}
Modified: trunk/sources/editor/ui/dynamictextfieldeditor.h
===================================================================
--- trunk/sources/editor/ui/dynamictextfieldeditor.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/editor/ui/dynamictextfieldeditor.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -42,7 +42,7 @@
void updateForm() override;
private:
- void setColorPushButton(QColor color);
+ void setColorPushButton(const QColor& color);
void fillInfoComboBox();
private slots:
Modified: trunk/sources/editor/ui/elementpropertieseditorwidget.cpp
===================================================================
--- trunk/sources/editor/ui/elementpropertieseditorwidget.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/editor/ui/elementpropertieseditorwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -154,7 +154,7 @@
{
QStringList keys{"label", "comment", "description", "designation", "manufacturer", "manufacturer-reference", "provider", "machine-manufacturer-reference"};
- for(QString key : keys)
+ for(const QString& key : keys)
{
QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_tree);
qtwi->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable);
Modified: trunk/sources/elementspanel.cpp
===================================================================
--- trunk/sources/elementspanel.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/elementspanel.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -174,7 +174,7 @@
/**
@return true if \a item matches the filter, false otherwise
*/
-bool ElementsPanel::matchesFilter(const QTreeWidgetItem *item, QString filter) const {
+bool ElementsPanel::matchesFilter(const QTreeWidgetItem *item, const QString& filter) const {
if (!item) return(false);
// no filter => we consider the item matches
Modified: trunk/sources/elementspanel.h
===================================================================
--- trunk/sources/elementspanel.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/elementspanel.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -68,7 +68,7 @@
protected:
void startDrag(Qt::DropActions) override;
void startTitleBlockTemplateDrag(const TitleBlockTemplateLocation &);
- bool matchesFilter(const QTreeWidgetItem *, QString) const;
+ bool matchesFilter(const QTreeWidgetItem *, const QString&) const;
protected slots:
void panelContentChange();
Modified: trunk/sources/elementtextpattern.cpp
===================================================================
--- trunk/sources/elementtextpattern.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/elementtextpattern.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -162,7 +162,7 @@
* @param ok
* @return
*/
-QString ImportElementTextPattern::getName(QStringList list, bool &ok) const
+QString ImportElementTextPattern::getName(const QStringList& list, bool &ok) const
{
return QInputDialog::getItem(parentWidget(),
QObject::tr("Séléctionner une configuration de textes"),
@@ -221,7 +221,7 @@
//In each group of the xml description, replace the original uuids, by the news created upper.
QList <QDomElement> groups = QET::findInDomElement(root, "texts_groups", "texts_group");
- for(QDomElement group : groups)
+ for(const QDomElement& group : groups)
{
for(QDomElement text : QET::findInDomElement(group, "texts", "text"))
{
@@ -236,7 +236,7 @@
undo_stack.beginMacro(QObject::tr("Importer la configuration de texte : %1").arg(name.remove(".xml")));
//Add the texts to element
- for(QDomElement text : texts)
+ for(const QDomElement& text : texts)
{
DynamicElementTextItem *deti = new DynamicElementTextItem(m_element);
undo_stack.push(new AddElementTextCommand(m_element, deti));
@@ -243,7 +243,7 @@
deti->fromXml(text);
}
//Add the groups to element
- for(QDomElement xml_group : groups)
+ for(const QDomElement& xml_group : groups)
undo_stack.push(new AddTextsGroupCommand(m_element, xml_group));
undo_stack.endMacro();
Modified: trunk/sources/elementtextpattern.h
===================================================================
--- trunk/sources/elementtextpattern.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/elementtextpattern.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -45,7 +45,7 @@
ImportElementTextPattern(Element *elmt);
private:
- QString getName(QStringList list, bool &ok) const;
+ QString getName(const QStringList& list, bool &ok) const;
QWidget *parentWidget() const;
void apply(QString name) const;
Modified: trunk/sources/exportdialog.cpp
===================================================================
--- trunk/sources/exportdialog.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/exportdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -19,6 +19,7 @@
#include <QSvgGenerator>
#include <cmath>
#include <QtXml>
+#include <utility>
#include "qeticons.h"
#include "qetmessagebox.h"
#include "exportpropertieswidget.h"
@@ -649,7 +650,7 @@
saveReloadDiagramParameters(diagram, false);
}
-void ExportDialog::fillRow(QString file_path, const QRectF &row_rect, QString author, QString title,
+void ExportDialog::fillRow(const QString& file_path, const QRectF &row_rect, QString author, const QString& title,
QString folio, QString date)
{
qreal x = row_rect.bottomLeft().x();
@@ -660,7 +661,7 @@
qreal height = row_rect.height() * Createdxf::yScale *0.7;
y += height*0.2;
- Createdxf::drawTextAligned(file_path, folio,
+ Createdxf::drawTextAligned(file_path, std::move(folio),
x + 0.02*DiagramFolioList::colWidths[0]*row_rect.width()*Createdxf::xScale, y, height, 0, 0, 5, 0,
x + 0.95*DiagramFolioList::colWidths[0]*row_rect.width()*Createdxf::xScale, 0);
@@ -676,12 +677,12 @@
x + 0.02*DiagramFolioList::colWidths[1]*row_rect.width()*Createdxf::xScale, 0, true);
x += DiagramFolioList::colWidths[1]*row_rect.width()*Createdxf::xScale;
- Createdxf::drawTextAligned(file_path, author,
+ Createdxf::drawTextAligned(file_path, std::move(author),
x + 0.02*DiagramFolioList::colWidths[2]*row_rect.width()*Createdxf::xScale, y, height, 0, 0, 5, 0,
x + 3.02*DiagramFolioList::colWidths[2]*row_rect.width()*Createdxf::xScale, 0);
x += DiagramFolioList::colWidths[2]*row_rect.width()*Createdxf::xScale;
- Createdxf::drawTextAligned(file_path, date,
+ Createdxf::drawTextAligned(file_path, std::move(date),
x + 0.02*DiagramFolioList::colWidths[3]*row_rect.width()*Createdxf::xScale, y, height, 0, 0, 5, 0,
x + 5.02*DiagramFolioList::colWidths[3]*row_rect.width()*Createdxf::xScale, 0);
}
Modified: trunk/sources/exportdialog.h
===================================================================
--- trunk/sources/exportdialog.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/exportdialog.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -90,7 +90,7 @@
void saveReloadDiagramParameters(Diagram *, bool = true);
void generateSvg(Diagram *, int, int, bool, QIODevice &);
void generateDxf(Diagram *, int, int, bool, QString &);
- void fillRow(QString, const QRectF &, QString, QString, QString, QString);
+ void fillRow(const QString&, const QRectF &, QString, const QString&, QString, QString);
QImage generateImage(Diagram *, int, int, bool);
void exportDiagram(ExportDiagramLine *);
qreal diagramRatio(Diagram *);
Modified: trunk/sources/projectconfigpages.cpp
===================================================================
--- trunk/sources/projectconfigpages.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/projectconfigpages.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -344,7 +344,7 @@
* Display the current selected context for conductor
* @param str, key of context stored in project
*/
-void ProjectAutoNumConfigPage::updateContextConductor(QString str) {
+void ProjectAutoNumConfigPage::updateContextConductor(const QString& str) {
if (str == tr("Nom de la nouvelle numérotation")) m_saw_conductor -> setContext(NumerotationContext());
else m_saw_conductor ->setContext(m_project->conductorAutoNum(str));
}
@@ -354,7 +354,7 @@
* Display the current selected context for folio
* @param str, key of context stored in project
*/
-void ProjectAutoNumConfigPage::updateContextFolio(QString str) {
+void ProjectAutoNumConfigPage::updateContextFolio(const QString& str) {
if (str == tr("Nom de la nouvelle numérotation")) m_saw_folio -> setContext(NumerotationContext());
else m_saw_folio ->setContext(m_project->folioAutoNum(str));
}
@@ -364,7 +364,7 @@
* Display the current selected context for element
* @param str, key of context stored in project
*/
-void ProjectAutoNumConfigPage::updateContextElement(QString str)
+void ProjectAutoNumConfigPage::updateContextElement(const QString& str)
{
if (str == tr("Nom de la nouvelle numérotation"))
{
Modified: trunk/sources/projectconfigpages.h
===================================================================
--- trunk/sources/projectconfigpages.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/projectconfigpages.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -136,13 +136,13 @@
private:
void buildConnections();
private slots:
- void updateContextConductor(QString);//conductor
+ void updateContextConductor(const QString&);//conductor
void saveContextConductor();
void removeContextConductor();
- void updateContextFolio(QString);//folio
+ void updateContextFolio(const QString&);//folio
void saveContextFolio();
void removeContextFolio();
- void updateContextElement(QString);//element
+ void updateContextElement(const QString&);//element
void saveContextElement();
void removeContextElement();
Modified: trunk/sources/qet.cpp
===================================================================
--- trunk/sources/qet.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qet.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -195,7 +195,7 @@
@param entier Pointeur facultatif vers un entier
@return true si l'attribut est bien un entier, false sinon
*/
-bool QET::attributeIsAnInteger(const QDomElement &e, QString nom_attribut, int *entier) {
+bool QET::attributeIsAnInteger(const QDomElement &e, const QString& nom_attribut, int *entier) {
// verifie la presence de l'attribut
if (!e.hasAttribute(nom_attribut)) return(false);
// verifie la validite de l'attribut
@@ -214,7 +214,7 @@
@param reel Pointeur facultatif vers un double
@return true si l'attribut est bien un reel, false sinon
*/
-bool QET::attributeIsAReal(const QDomElement &e, QString nom_attribut, qreal *reel) {
+bool QET::attributeIsAReal(const QDomElement &e, const QString& nom_attribut, qreal *reel) {
// verifie la presence de l'attribut
if (!e.hasAttribute(nom_attribut)) return(false);
// verifie la validite de l'attribut
Modified: trunk/sources/qet.h
===================================================================
--- trunk/sources/qet.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qet.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -158,8 +158,8 @@
bool lineContainsPoint(const QLineF &, const QPointF &);
bool orthogonalProjection(const QPointF &, const QLineF &, QPointF * = nullptr);
- bool attributeIsAnInteger(const QDomElement &, QString , int * = nullptr);
- bool attributeIsAReal(const QDomElement &, QString , qreal * = nullptr);
+ bool attributeIsAnInteger(const QDomElement &, const QString& , int * = nullptr);
+ bool attributeIsAReal(const QDomElement &, const QString& , qreal * = nullptr);
QString ElementsAndConductorsSentence(int, int, int = 0, int = 0, int = 0, int = 0);
QList<QDomElement> findInDomElement(const QDomElement &, const QString &);
QList<QDomElement> findInDomElement(const QDomElement &, const QString &, const QString &);
Modified: trunk/sources/qetapp.cpp
===================================================================
--- trunk/sources/qetapp.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetapp.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -149,7 +149,7 @@
{
QStringList extension_filter("*.qet");
QStringList list = dir.entryList(extension_filter);
- for(QString str : list)
+ for(const QString& str : list)
dir.remove(str);
}
}
@@ -1660,13 +1660,13 @@
else
text.append(tr("<b>Les fichiers de restauration suivant on été trouvé,<br>"
"Voulez-vous les ouvrir ?</b><br>"));
- for(QString name : list)
+ for(const QString& name : list)
text.append("<br>" + name);
if (QET::QetMessageBox::question(nullptr, tr("Fichier de restauration"), text, QMessageBox::Ok|QMessageBox::Cancel) == QMessageBox::Ok)
{
QStringList files_list;
- for(QString str : list)
+ for(const QString& str : list)
files_list << dir.path() + "/" + str;
QList<QETDiagramEditor *> diagrams_editors = diagramEditors();
@@ -1691,7 +1691,7 @@
de_open -> setVisible(true);
}
- for(QString file : files_list) {
+ for(const QString& file : files_list) {
de_open -> openAndAddProject(file);
}
}
Modified: trunk/sources/qetgraphicsitem/conductor.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/conductor.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/conductor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -41,7 +41,7 @@
{
friend class Conductor;
- static void loadSequential(const QDomElement &dom_element, QString seq, QStringList* list)
+ static void loadSequential(const QDomElement &dom_element, const QString& seq, QStringList* list)
{
int i = 0;
while (!dom_element.attribute(seq + QString::number(i+1)).isEmpty())
@@ -939,7 +939,7 @@
Regenere les segments de ce conducteur a partir de la liste de points passee en parametre
@param points_list Liste de points a utiliser pour generer les segments
*/
-void Conductor::pointsToSegments(QList<QPointF> points_list) {
+void Conductor::pointsToSegments(const QList<QPointF>& points_list) {
// supprime les segments actuels
deleteSegments();
@@ -1667,7 +1667,7 @@
ConductorPropertiesDialog::PropertiesDialog(this, diagramEditor());
}
-void Conductor::setSequenceNum(autonum::sequentialNumbers sn)
+void Conductor::setSequenceNum(const autonum::sequentialNumbers& sn)
{
m_autoNum_seq = sn;
refreshText();
Modified: trunk/sources/qetgraphicsitem/conductor.h
===================================================================
--- trunk/sources/qetgraphicsitem/conductor.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/conductor.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -121,7 +121,7 @@
autonum::sequentialNumbers sequenceNum () const {return m_autoNum_seq;}
autonum::sequentialNumbers& rSequenceNum() {return m_autoNum_seq;}
- void setSequenceNum(autonum::sequentialNumbers sn);
+ void setSequenceNum(const autonum::sequentialNumbers& sn);
private:
void setUpConnectionForFormula(QString old_formula, QString new_formula);
@@ -194,7 +194,7 @@
QList<QPointF> segmentsToPoints() const;
QList<ConductorBend> bends() const;
QList<QPointF> junctions() const;
- void pointsToSegments(QList<QPointF>);
+ void pointsToSegments(const QList<QPointF>&);
Qt::Corner currentPathType() const;
void deleteSegments();
static int getCoeff(const qreal &, const qreal &);
Modified: trunk/sources/qetgraphicsitem/crossrefitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/crossrefitem.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/crossrefitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -96,7 +96,7 @@
*/
void CrossRefItem::setUpConnection()
{
- for(QMetaObject::Connection c : m_update_connection)
+ for(const QMetaObject::Connection& c : m_update_connection)
disconnect(c);
m_update_connection.clear();
@@ -369,7 +369,7 @@
void CrossRefItem::linkedChanged()
{
- for(QMetaObject::Connection c : m_slave_connection)
+ for(const QMetaObject::Connection& c : m_slave_connection)
disconnect(c);
m_slave_connection.clear();
@@ -781,7 +781,7 @@
* @param painter painter to use for draw the text
* @param type type of Info do be draw e.g. comment, location.
*/
-void CrossRefItem::AddExtraInfo(QPainter &painter, QString type)
+void CrossRefItem::AddExtraInfo(QPainter &painter, const QString& type)
{
QString text = autonum::AssignVariables::formulaToLabel(m_element -> elementInformations()[type].toString(), m_element->rSequenceStruct(), m_element->diagram(), m_element);
bool must_show = m_element -> elementInformations().keyMustShow(type);
Modified: trunk/sources/qetgraphicsitem/crossrefitem.h
===================================================================
--- trunk/sources/qetgraphicsitem/crossrefitem.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/crossrefitem.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -91,7 +91,7 @@
void drawAsContacts (QPainter &painter);
QRectF drawContact (QPainter &painter, int flags, Element *elmt);
void fillCrossRef (QPainter &painter);
- void AddExtraInfo (QPainter &painter, QString);
+ void AddExtraInfo (QPainter &painter, const QString&);
QList<Element *> NOElements() const;
QList<Element *> NCElements() const;
Modified: trunk/sources/qetgraphicsitem/diagramtextitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/diagramtextitem.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/diagramtextitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -163,7 +163,7 @@
return font().pointSize();
}
-void DiagramTextItem::setColor(QColor color)
+void DiagramTextItem::setColor(const QColor& color)
{
setDefaultTextColor(color);
emit colorChanged(color);
Modified: trunk/sources/qetgraphicsitem/diagramtextitem.h
===================================================================
--- trunk/sources/qetgraphicsitem/diagramtextitem.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/diagramtextitem.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -68,7 +68,7 @@
void setFontSize(int s);
int fontSize()const;
- void setColor(QColor color);
+ void setColor(const QColor& color);
QColor color() const;
void setNoEditable(bool e = true) {m_no_editable = e;}
Modified: trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -969,7 +969,7 @@
void DynamicElementTextItem::clearFormulaConnection()
{
- for (QMetaObject::Connection con : m_formula_connection)
+ for (const QMetaObject::Connection& con : m_formula_connection)
disconnect(con);
m_formula_connection.clear();
}
Modified: trunk/sources/qetgraphicsitem/element.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/element.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/element.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -20,6 +20,7 @@
#include "conductor.h"
#include "diagramcommands.h"
#include <QtDebug>
+#include <utility>
#include "elementprovider.h"
#include "diagramposition.h"
#include "terminal.h"
@@ -35,7 +36,7 @@
{
friend class Element;
- static void loadSequential(const QDomElement &dom_element, QString seq, QStringList* list)
+ static void loadSequential(const QDomElement &dom_element, const QString& seq, QStringList* list)
{
int i = 0;
while (!dom_element.attribute(seq + QString::number(i+1)).isEmpty())
@@ -451,7 +452,7 @@
//************************//
//***Dynamic texts item***//
//************************//
- for (QDomElement qde : QET::findInDomElement(e, "dynamic_texts", DynamicElementTextItem::xmlTaggName()))
+ for (const QDomElement& qde : QET::findInDomElement(e, "dynamic_texts", DynamicElementTextItem::xmlTaggName()))
{
DynamicElementTextItem *deti = new DynamicElementTextItem(this);
addDynamicTextItem(deti);
@@ -471,7 +472,7 @@
for (DynamicElementTextItem *deti : conv_deti_list)
{
- for(QDomElement dom_input : dom_inputs)
+ for(const QDomElement& dom_input : dom_inputs)
{
//we use the same method used in ElementTextItem::fromXml to compar and know if the input dom element is for one of the text stored.
//The comparaison is made from the text position : if the position of the text is the same as the position stored in 'input' dom element
@@ -1235,7 +1236,7 @@
* set Element Prefix
*/
void Element::setPrefix(QString prefix) {
- m_prefix = prefix;
+ m_prefix = std::move(prefix);
}
/**
Modified: trunk/sources/qetgraphicsitem/elementtextitemgroup.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/elementtextitemgroup.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/elementtextitemgroup.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -28,6 +28,7 @@
#include <QPainter>
#include <QGraphicsSceneMouseEvent>
+#include <utility>
bool sorting(QGraphicsItem *qgia, QGraphicsItem *qgib)
{
@@ -253,7 +254,7 @@
*/
void ElementTextItemGroup::setName(QString name)
{
- m_name = name;
+ m_name = std::move(name);
emit nameChanged(m_name);
}
@@ -412,7 +413,7 @@
if(parentElement())
{
m_block_alignment_update = true;
- for(QDomElement text : QET::findInDomElement(dom_element, "texts", "text"))
+ for(const QDomElement& text : QET::findInDomElement(dom_element, "texts", "text"))
{
DynamicElementTextItem *deti = nullptr;
QUuid uuid(text.attribute("uuid"));
Modified: trunk/sources/qetgraphicsitem/qetshapeitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/qetshapeitem.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/qetshapeitem.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -880,7 +880,7 @@
}
}
else {
- for(QDomElement de : QET::findInDomElement(e, "points", "point")) {
+ for(const QDomElement& de : QET::findInDomElement(e, "points", "point")) {
m_polygon << QPointF(de.attribute("x", nullptr).toDouble(), de.attribute("y", nullptr).toDouble());
}
}
Modified: trunk/sources/qetgraphicsitem/reportelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/reportelement.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/reportelement.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -23,7 +23,7 @@
#include "conductor.h"
#include "dynamicelementtextitem.h"
-ReportElement::ReportElement(const ElementsLocation &location, QString link_type,QGraphicsItem *qgi, int *state) :
+ReportElement::ReportElement(const ElementsLocation &location, const QString& link_type,QGraphicsItem *qgi, int *state) :
CustomElement(location, qgi, state)
{
link_type == "next_report"? m_link_type=NextReport : m_link_type=PreviousReport;
Modified: trunk/sources/qetgraphicsitem/reportelement.h
===================================================================
--- trunk/sources/qetgraphicsitem/reportelement.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/reportelement.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -30,7 +30,7 @@
Q_OBJECT
public :
- explicit ReportElement(const ElementsLocation &,QString link_type, QGraphicsItem * = nullptr, int * = nullptr);
+ explicit ReportElement(const ElementsLocation &,const QString& link_type, QGraphicsItem * = nullptr, int * = nullptr);
~ReportElement() override;
void linkToElement(Element *) override;
void unlinkAllElements() override;
Modified: trunk/sources/qetgraphicsitem/terminal.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/terminal.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetgraphicsitem/terminal.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -16,6 +16,8 @@
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "terminal.h"
+
+#include <utility>
#include "diagram.h"
#include "qetgraphicsitem/element.h"
#include "qetgraphicsitem/conductor.h"
@@ -55,9 +57,9 @@
default : dock_elmt_ += QPointF(0, -Terminal::terminalSize);
}
// Number of terminal
- number_terminal_ = number;
+ number_terminal_ = std::move(number);
// Name of terminal
- name_terminal_ = name;
+ name_terminal_ = std::move(name);
name_terminal_hidden = hiddenName;
// par defaut : pas de conducteur
@@ -127,7 +129,7 @@
parent_element_ (e),
hovered_color_ (Terminal::neutralColor)
{
- init(pf, o, num, name, hiddenName);
+ init(pf, o, std::move(num), std::move(name), hiddenName);
}
/**
@@ -168,7 +170,7 @@
* @param number
*/
void Terminal::setNumber(QString number) {
- number_terminal_ = number;
+ number_terminal_ = std::move(number);
}
/**
@@ -176,7 +178,7 @@
* @param name
*/
void Terminal::setName(QString name, bool hiddenName) {
- name_terminal_ = name;
+ name_terminal_ = std::move(name);
name_terminal_hidden = hiddenName;
}
Modified: trunk/sources/qetproject.cpp
===================================================================
--- trunk/sources/qetproject.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetproject.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -34,6 +34,7 @@
#include <QTimer>
#include <QStandardPaths>
+#include <utility>
static int BACKUP_INTERVAL = 300000; //interval in ms of backup
@@ -445,7 +446,7 @@
emit reportPropertiesChanged(old, properties);
}
-void QETProject::setDefaultXRefProperties(const QString type, const XRefProperties &properties) {
+void QETProject::setDefaultXRefProperties(const QString& type, const XRefProperties &properties) {
m_default_xref_properties.insert(type, properties);
emit XRefPropertiesChanged();
}
@@ -477,7 +478,7 @@
* @param element autonum title
* @return Formula of element autonum stored in element autonum
*/
-QString QETProject::elementAutoNumFormula (QString key) const
+QString QETProject::elementAutoNumFormula (const QString& key) const
{
if (m_element_autonum.contains(key)) {
return autonum::numerotationContextToFormula(m_element_autonum[key]);
@@ -507,7 +508,7 @@
* @param autoNum : set the current element autonum to @autonum
*/
void QETProject::setCurrrentElementAutonum(QString autoNum) {
- m_current_element_autonum = autoNum;
+ m_current_element_autonum = std::move(autoNum);
}
/**
@@ -515,7 +516,7 @@
* @param conductor autonum title
* @return Formula of element autonum stored in conductor autonum
*/
-QString QETProject::conductorAutoNumFormula (QString key) const
+QString QETProject::conductorAutoNumFormula (const QString& key) const
{
if (m_conductor_autonum.contains(key))
return autonum::numerotationContextToFormula(m_conductor_autonum.value(key));
@@ -536,7 +537,7 @@
* @param autoNum set the current conductor autonum to @autonum
*/
void QETProject::setCurrentConductorAutoNum(QString autoNum) {
- m_current_conductor_autonum = autoNum;
+ m_current_conductor_autonum = std::move(autoNum);
}
/**
@@ -554,7 +555,7 @@
* @param key
* @param context
*/
-void QETProject::addConductorAutoNum(QString key, NumerotationContext context) {
+void QETProject::addConductorAutoNum(const QString& key, const NumerotationContext& context) {
m_conductor_autonum.insert(key, context);
}
@@ -565,7 +566,7 @@
* @param key
* @param context
*/
-void QETProject::addElementAutoNum(QString key, NumerotationContext context)
+void QETProject::addElementAutoNum(const QString& key, const NumerotationContext& context)
{
m_element_autonum.insert(key, context);
emit elementAutoNumAdded(key);
@@ -578,7 +579,7 @@
* @param key
* @param context
*/
-void QETProject::addFolioAutoNum(QString key, NumerotationContext context) {
+void QETProject::addFolioAutoNum(const QString& key, const NumerotationContext& context) {
m_folio_autonum.insert(key, context);
}
@@ -587,7 +588,7 @@
* Remove Conductor Numerotation Context stored with key
* @param key
*/
-void QETProject::removeConductorAutoNum(QString key) {
+void QETProject::removeConductorAutoNum(const QString& key) {
m_conductor_autonum.remove(key);
}
@@ -596,7 +597,7 @@
* Remove Element Numerotation Context stored with key
* @param key
*/
-void QETProject::removeElementAutoNum(QString key)
+void QETProject::removeElementAutoNum(const QString& key)
{
m_element_autonum.remove(key);
emit elementAutoNumRemoved(key);
@@ -607,7 +608,7 @@
* Remove Folio Numerotation Context stored with key
* @param key
*/
-void QETProject::removeFolioAutoNum(QString key) {
+void QETProject::removeFolioAutoNum(const QString& key) {
m_folio_autonum.remove(key);
}
@@ -760,7 +761,7 @@
* @param autonum used, index from selected tabs "from" and "to"
* rename folios with selected autonum
*/
-void QETProject::autoFolioNumberingSelectedFolios(int from, int to, QString autonum){
+void QETProject::autoFolioNumberingSelectedFolios(int from, int to, const QString& autonum){
int total_folio = m_diagrams_list.count();
DiagramContext project_wide_properties = project_properties_;
for (int i=from; i<=to; i++) {
Modified: trunk/sources/qetproject.h
===================================================================
--- trunk/sources/qetproject.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetproject.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -103,27 +103,27 @@
XRefProperties defaultXRefProperties (const QString &type) const {return m_default_xref_properties[type];}
QHash <QString, XRefProperties> defaultXRefProperties() const {return m_default_xref_properties;}
- void setDefaultXRefProperties(const QString type, const XRefProperties &properties);
+ void setDefaultXRefProperties(const QString& type, const XRefProperties &properties);
void setDefaultXRefProperties(QHash <QString, XRefProperties> hash);
QHash <QString, NumerotationContext> conductorAutoNum() const;
QHash <QString, NumerotationContext> elementAutoNum() const;
QHash <QString, NumerotationContext> folioAutoNum() const;
- void addConductorAutoNum (QString key, NumerotationContext context);
- void addElementAutoNum (QString key, NumerotationContext context);
- void addFolioAutoNum (QString key, NumerotationContext context);
- void removeConductorAutoNum (QString key);
- void removeElementAutoNum (QString key);
- void removeFolioAutoNum (QString key);
+ void addConductorAutoNum (const QString& key, const NumerotationContext& context);
+ void addElementAutoNum (const QString& key, const NumerotationContext& context);
+ void addFolioAutoNum (const QString& key, const NumerotationContext& context);
+ void removeConductorAutoNum (const QString& key);
+ void removeElementAutoNum (const QString& key);
+ void removeFolioAutoNum (const QString& key);
NumerotationContext conductorAutoNum(const QString &key) const;
NumerotationContext folioAutoNum(const QString &key) const;
NumerotationContext elementAutoNum(const QString &key);
- QString conductorAutoNumFormula(const QString key) const; //returns Formula
+ QString conductorAutoNumFormula(const QString& key) const; //returns Formula
QString conductorCurrentAutoNum() const;
void setCurrentConductorAutoNum(QString autoNum);
- QString elementAutoNumFormula(const QString key) const;
+ QString elementAutoNumFormula(const QString& key) const;
QString elementAutoNumCurrentFormula() const;
QString elementCurrentAutoNum() const;
void setCurrrentElementAutonum(QString autoNum);
@@ -146,7 +146,7 @@
void setAutoConductor (bool ac);
void setAutoElement (bool ae);
void autoFolioNumberingNewFolios ();
- void autoFolioNumberingSelectedFolios(int, int, QString);
+ void autoFolioNumberingSelectedFolios(int, int, const QString&);
QDomDocument toXml();
bool close();
Modified: trunk/sources/qetsingleapplication.cpp
===================================================================
--- trunk/sources/qetsingleapplication.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetsingleapplication.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -26,7 +26,7 @@
@param argv Tableau des arguments passes au programme par le systeme
@param unique_key Cle unique
*/
-QETSingleApplication::QETSingleApplication(int &argc, char **argv, const QString unique_key) :
+QETSingleApplication::QETSingleApplication(int &argc, char **argv, const QString& unique_key) :
QApplication(argc, argv),
unique_key_(unique_key)
{
Modified: trunk/sources/qetsingleapplication.h
===================================================================
--- trunk/sources/qetsingleapplication.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetsingleapplication.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -28,7 +28,7 @@
Q_OBJECT
// constructors, destructor
public:
- QETSingleApplication(int &, char **, const QString);
+ QETSingleApplication(int &, char **, const QString&);
~QETSingleApplication() override;
private:
Modified: trunk/sources/qetxml.cpp
===================================================================
--- trunk/sources/qetxml.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetxml.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -27,7 +27,7 @@
* @param pen : the pen to store
* @return : A QDomElement with the attribute stored. The tagName of QDomeElement is "pen".
*/
-QDomElement QETXML::penToXml(QDomDocument &parent_document,QPen pen)
+QDomElement QETXML::penToXml(QDomDocument &parent_document,const QPen& pen)
{
QDomElement element = parent_document.createElement("pen");
@@ -88,7 +88,7 @@
* @param brush : the brush to store
* @return A QDomElement with the attribute stored. The tagName of QDomeElement is "brush".
*/
-QDomElement QETXML::brushToXml(QDomDocument &parent_document, QBrush brush)
+QDomElement QETXML::brushToXml(QDomDocument &parent_document, const QBrush& brush)
{
QDomElement element = parent_document.createElement("brush");
@@ -162,7 +162,7 @@
* @return A file system directory converted to a QDomElement directory ready to be inserted into a XmlElementCollection.
* If the QDomElement can't be created, return a null QDomElement.
*/
-QDomElement QETXML::fileSystemDirToXmlCollectionDir(QDomDocument &document, const QDir &dir, QString rename)
+QDomElement QETXML::fileSystemDirToXmlCollectionDir(QDomDocument &document, const QDir &dir, const QString& rename)
{
if (!dir.exists()) return QDomElement();
@@ -200,7 +200,7 @@
* @return A file system element converted to a QDomElement ready to be inserted into a XmlElementCollection
* If the QDomElement can't be created, return a null QDomElement
*/
-QDomElement QETXML::fileSystemElementToXmlCollectionElement(QDomDocument &document, QFile &file, QString rename)
+QDomElement QETXML::fileSystemElementToXmlCollectionElement(QDomDocument &document, QFile &file, const QString& rename)
{
if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text))
{
@@ -266,7 +266,7 @@
* @param value
* @return
*/
-QDomElement QETXML::textToDomElement(QDomDocument &document, QString tag_name, QString value)
+QDomElement QETXML::textToDomElement(QDomDocument &document, const QString& tag_name, const QString& value)
{
QDomElement element = document.createElement(tag_name);
QDomText text = document.createTextNode(value);
Modified: trunk/sources/qetxml.h
===================================================================
--- trunk/sources/qetxml.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/qetxml.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -30,18 +30,18 @@
*/
namespace QETXML
{
- QDomElement penToXml(QDomDocument &parent_document, QPen pen);
+ QDomElement penToXml(QDomDocument &parent_document, const QPen& pen);
QPen penFromXml (const QDomElement &element);
- QDomElement brushToXml (QDomDocument &parent_document, QBrush brush);
+ QDomElement brushToXml (QDomDocument &parent_document, const QBrush& brush);
QBrush brushFromXml (const QDomElement &element);
- QDomElement fileSystemDirToXmlCollectionDir (QDomDocument &document, const QDir &dir, QString rename = QString());
- QDomElement fileSystemElementToXmlCollectionElement (QDomDocument &document, QFile &file, QString rename = QString());
+ QDomElement fileSystemDirToXmlCollectionDir (QDomDocument &document, const QDir &dir, const QString& rename = QString());
+ QDomElement fileSystemElementToXmlCollectionElement (QDomDocument &document, QFile &file, const QString& rename = QString());
bool writeXmlFile(const QDomDocument &xml_document, const QString &file_path, QString *error_message = nullptr);
- QDomElement textToDomElement (QDomDocument &document, QString tag_name, QString value);
+ QDomElement textToDomElement (QDomDocument &document, const QString& tag_name, const QString& value);
}
#endif // QETXML_H
Modified: trunk/sources/titleblock/qettemplateeditor.cpp
===================================================================
--- trunk/sources/titleblock/qettemplateeditor.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/titleblock/qettemplateeditor.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -615,7 +615,7 @@
Update various things when user changes the selected cells.
@param selected_cells List of selected cells.
*/
-void QETTitleBlockTemplateEditor::selectedCellsChanged(QList<TitleBlockCell *> selected_cells) {
+void QETTitleBlockTemplateEditor::selectedCellsChanged(const QList<TitleBlockCell *>& selected_cells) {
if (selected_cells.count() == 1) {
template_cell_editor_widget_ -> edit(selected_cells.at(0));
template_cell_editor_widget_ -> setVisible(true);
Modified: trunk/sources/titleblock/qettemplateeditor.h
===================================================================
--- trunk/sources/titleblock/qettemplateeditor.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/titleblock/qettemplateeditor.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -104,7 +104,7 @@
public slots:
void readSettings();
void writeSettings();
- void selectedCellsChanged(QList<TitleBlockCell *>);
+ void selectedCellsChanged(const QList<TitleBlockCell *>&);
void duplicateCurrentLocation();
bool edit(const TitleBlockTemplateLocation &);
bool edit(QETProject *, const QString &);
Modified: trunk/sources/ui/compositetexteditdialog.cpp
===================================================================
--- trunk/sources/ui/compositetexteditdialog.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ui/compositetexteditdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -1,4 +1,6 @@
#include "compositetexteditdialog.h"
+
+#include <utility>
#include "ui_compositetexteditdialog.h"
#include "dynamicelementtextitem.h"
#include "element.h"
@@ -24,7 +26,7 @@
ui(new Ui::CompositeTextEditDialog)
{
ui->setupUi(this);
- m_default_text = text;
+ m_default_text = std::move(text);
ui->m_plain_text_edit->setPlainText(m_default_text);
#if QT_VERSION >= 0x050300
ui->m_plain_text_edit->setPlaceholderText(tr("Entrée votre texte composé ici, en vous aidant des variables disponible"));
@@ -65,10 +67,10 @@
//We use a QMap because the keys of the map are sorted, then no matter the curent local,
//the value of the combo box are always alphabetically sorted
QMap <QString, QString> info_map;
- for(QString str : qstrl) {
+ for(const QString& str : qstrl) {
info_map.insert(QETApp::elementTranslatedInfoKey(str), QETApp::elementInfoToVar(str));
}
- for(QString key : info_map.keys()) {
+ for(const QString& key : info_map.keys()) {
ui->m_info_cb->addItem(key, info_map.value(key));
}
}
Modified: trunk/sources/ui/dynamicelementtextmodel.cpp
===================================================================
--- trunk/sources/ui/dynamicelementtextmodel.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ui/dynamicelementtextmodel.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -1226,7 +1226,7 @@
if(!m_hash_text_connect.keys().contains(deti))
return;
- for (QMetaObject::Connection con : m_hash_text_connect.value(deti))
+ for (const QMetaObject::Connection& con : m_hash_text_connect.value(deti))
disconnect(con);
m_hash_text_connect.remove(deti);
@@ -1264,7 +1264,7 @@
if(!m_hash_group_connect.keys().contains(group))
return;
- for (QMetaObject::Connection con : m_hash_group_connect.value(group))
+ for (const QMetaObject::Connection& con : m_hash_group_connect.value(group))
disconnect(con);
m_hash_group_connect.remove(group);
@@ -1443,13 +1443,13 @@
//We use a QMap because the keys of the map are sorted, then no matter the curent local,
//the value of the combo box are always alphabetically sorted
QMap <QString, QString> info_map;
- for(QString str : availableInfo(deti)) {
+ for(const QString& str : availableInfo(deti)) {
info_map.insert(QETApp::elementTranslatedInfoKey(str), str);
}
QComboBox *qcb = new QComboBox(parent);
qcb->setObjectName("info_text");
- for (QString key : info_map.keys()) {
+ for (const QString& key : info_map.keys()) {
qcb->addItem(key, info_map.value(key));
}
return qcb;
@@ -1733,7 +1733,7 @@
info_list.removeAll("formula"); //No need to have formula
DiagramContext dc = elmt->elementInformations();
- for(QString info : info_list)
+ for(const QString& info : info_list)
{
if(dc.contains(info))
qstrl << info;
Modified: trunk/sources/ui/elementinfopartwidget.cpp
===================================================================
--- trunk/sources/ui/elementinfopartwidget.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ui/elementinfopartwidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -16,6 +16,8 @@
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "elementinfopartwidget.h"
+
+#include <utility>
#include "ui_elementinfopartwidget.h"
@@ -26,10 +28,10 @@
* @param translated_key the string key translated
* @param parent parent widget
*/
-ElementInfoPartWidget::ElementInfoPartWidget(QString key, QString translated_key, QWidget *parent):
+ElementInfoPartWidget::ElementInfoPartWidget(QString key, const QString& translated_key, QWidget *parent):
QWidget(parent),
ui(new Ui::ElementInfoPartWidget),
- key_(key)
+ key_(std::move(key))
{
ui->setupUi(this);
ui->label_->setText(translated_key);
Modified: trunk/sources/ui/elementinfopartwidget.h
===================================================================
--- trunk/sources/ui/elementinfopartwidget.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ui/elementinfopartwidget.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -30,7 +30,7 @@
//METHODS
public:
- explicit ElementInfoPartWidget(QString key, QString translated_key, QWidget *parent = nullptr);
+ explicit ElementInfoPartWidget(QString key, const QString& translated_key, QWidget *parent = nullptr);
~ElementInfoPartWidget() override;
QString key () const {return key_;}
Modified: trunk/sources/ui/formulaassistantdialog.cpp
===================================================================
--- trunk/sources/ui/formulaassistantdialog.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ui/formulaassistantdialog.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -32,17 +32,17 @@
delete ui;
}
-void FormulaAssistantDialog::setForbiddenVariables(QStringList list)
+void FormulaAssistantDialog::setForbiddenVariables(const QStringList& list)
{
m_rx.setPattern(list.join("|"));
}
-void FormulaAssistantDialog::setText(QString text)
+void FormulaAssistantDialog::setText(const QString& text)
{
ui->m_label->setText(text);
}
-void FormulaAssistantDialog::setFormula(QString text)
+void FormulaAssistantDialog::setFormula(const QString& text)
{
ui->m_line_edit->setText(text);
}
Modified: trunk/sources/ui/formulaassistantdialog.h
===================================================================
--- trunk/sources/ui/formulaassistantdialog.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ui/formulaassistantdialog.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -33,9 +33,9 @@
FormulaAssistantDialog(QWidget *parent = nullptr);
~FormulaAssistantDialog() override;
- void setForbiddenVariables(QStringList list);
- void setText(QString text);
- void setFormula(QString text);
+ void setForbiddenVariables(const QStringList& list);
+ void setText(const QString& text);
+ void setFormula(const QString& text);
QString formula() const;
private slots:
Modified: trunk/sources/ui/reportpropertiewidget.cpp
===================================================================
--- trunk/sources/ui/reportpropertiewidget.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ui/reportpropertiewidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -18,7 +18,7 @@
#include "reportpropertiewidget.h"
#include "ui_reportpropertiewidget.h"
-ReportPropertieWidget::ReportPropertieWidget(QString value, QWidget *parent) :
+ReportPropertieWidget::ReportPropertieWidget(const QString& value, QWidget *parent) :
QWidget(parent),
ui(new Ui::ReportPropertieWidget)
{
@@ -35,7 +35,7 @@
settings.setValue(prefix + "label", ui->line_edit->text());
}
-void ReportPropertieWidget::setReportProperties(QString label) {
+void ReportPropertieWidget::setReportProperties(const QString& label) {
ui->line_edit->setText(label);
}
Modified: trunk/sources/ui/reportpropertiewidget.h
===================================================================
--- trunk/sources/ui/reportpropertiewidget.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ui/reportpropertiewidget.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -31,10 +31,10 @@
Q_OBJECT
public:
- explicit ReportPropertieWidget(QString value, QWidget *parent = nullptr);
+ explicit ReportPropertieWidget(const QString& value, QWidget *parent = nullptr);
~ReportPropertieWidget() override;
void toSettings (QSettings &settings, const QString &prefix);
- void setReportProperties (QString label);
+ void setReportProperties (const QString& label);
QString ReportProperties () const;
private:
Modified: trunk/sources/ui/titleblockpropertieswidget.cpp
===================================================================
--- trunk/sources/ui/titleblockpropertieswidget.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ui/titleblockpropertieswidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -22,6 +22,7 @@
#include "titleblocktemplate.h"
#include "qetapp.h"
#include <QMenu>
+#include <utility>
/**
* @brief TitleBlockPropertiesWidget::TitleBlockPropertiesWidget
@@ -221,7 +222,7 @@
prop.context = m_dcw -> context();
- prop.auto_page_num = autoNum;
+ prop.auto_page_num = std::move(autoNum);
return prop;
}
Modified: trunk/sources/ui/xrefpropertieswidget.cpp
===================================================================
--- trunk/sources/ui/xrefpropertieswidget.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/ui/xrefpropertieswidget.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -16,6 +16,8 @@
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "xrefpropertieswidget.h"
+
+#include <utility>
#include "ui_xrefpropertieswidget.h"
#include "qdebug.h"
@@ -28,7 +30,7 @@
XRefPropertiesWidget::XRefPropertiesWidget(QHash <QString, XRefProperties> properties, QWidget *parent) :
QWidget(parent),
ui(new Ui::XRefPropertiesWidget),
- m_properties(properties)
+ m_properties(std::move(properties))
{
ui->setupUi(this);
buildUi();
Modified: trunk/sources/undocommand/addelementtextcommand.cpp
===================================================================
--- trunk/sources/undocommand/addelementtextcommand.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/undocommand/addelementtextcommand.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -21,6 +21,7 @@
#include "elementtextitemgroup.h"
#include <QGraphicsScene>
+#include <utility>
/************************
@@ -70,7 +71,7 @@
AddTextsGroupCommand::AddTextsGroupCommand(Element *element, QString groupe_name, QUndoCommand *parent) :
QUndoCommand(parent),
m_element(element),
- m_name(groupe_name)
+ m_name(std::move(groupe_name))
{
setText(QObject::tr("Ajouter un groupe de textes d'élément"));
}
@@ -81,7 +82,7 @@
* @param dom_element : the first time the group is created, we call the function fromXml of the group, and give @dom_element has argument.
* @param parent : parent undo
*/
-AddTextsGroupCommand::AddTextsGroupCommand(Element *element, QDomElement dom_element, QUndoCommand *parent) :
+AddTextsGroupCommand::AddTextsGroupCommand(Element *element, const QDomElement& dom_element, QUndoCommand *parent) :
QUndoCommand(parent),
m_element(element),
m_dom_element(dom_element)
@@ -98,7 +99,7 @@
AddTextsGroupCommand::AddTextsGroupCommand(Element *element, QString groupe_name, QList<DynamicElementTextItem *> texts_list, QUndoCommand *parent) :
QUndoCommand(parent),
m_element(element),
- m_name(groupe_name)
+ m_name(std::move(groupe_name))
{
for(DynamicElementTextItem *deti : texts_list)
{
@@ -188,7 +189,7 @@
{
m_element.data()->addTextGroup(m_group.data());
- for(QPointer<DynamicElementTextItem> p : m_text_list)
+ for(const QPointer<DynamicElementTextItem>& p : m_text_list)
if(p)
m_element.data()->addTextToGroup(p.data(), m_group.data());
}
@@ -198,7 +199,7 @@
{
if(m_element && m_group)
{
- for(QPointer<DynamicElementTextItem> p : m_text_list)
+ for(const QPointer<DynamicElementTextItem>& p : m_text_list)
if(p)
m_element.data()->removeTextFromGroup(p.data(), m_group.data());
Modified: trunk/sources/undocommand/addelementtextcommand.h
===================================================================
--- trunk/sources/undocommand/addelementtextcommand.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/undocommand/addelementtextcommand.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -52,7 +52,7 @@
{
public:
AddTextsGroupCommand(Element *element, QString groupe_name, QUndoCommand *parent = nullptr);
- AddTextsGroupCommand(Element *element, QDomElement dom_element, QUndoCommand *parent = nullptr);
+ AddTextsGroupCommand(Element *element, const QDomElement& dom_element, QUndoCommand *parent = nullptr);
AddTextsGroupCommand(Element *element, QString groupe_name, QList<DynamicElementTextItem *> texts_list, QUndoCommand *parent = nullptr);
~AddTextsGroupCommand() override;
Modified: trunk/sources/undocommand/linkelementcommand.cpp
===================================================================
--- trunk/sources/undocommand/linkelementcommand.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/undocommand/linkelementcommand.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -129,7 +129,7 @@
* This method do several check to know if element can be linked or not.
* @param element_list
*/
-void LinkElementCommand::setLink(QList<Element *> element_list)
+void LinkElementCommand::setLink(const QList<Element *>& element_list)
{
m_linked_after.clear();
setUpNewLink(element_list, true);
Modified: trunk/sources/undocommand/linkelementcommand.h
===================================================================
--- trunk/sources/undocommand/linkelementcommand.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/undocommand/linkelementcommand.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -38,7 +38,7 @@
static bool isLinkable (Element *element_a, Element *element_b, bool already_linked = false);
- void setLink (QList<Element *> element_list);
+ void setLink (const QList<Element *>& element_list);
void setLink (Element *element_);
void unlink (QList<Element *> element_list);
void unlinkAll ();
Modified: trunk/sources/undocommand/rotateselectioncommand.cpp
===================================================================
--- trunk/sources/undocommand/rotateselectioncommand.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/undocommand/rotateselectioncommand.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -87,7 +87,7 @@
m_diagram->showMe();
QUndoCommand::undo();
- for(QPointer<ConductorTextItem> cti : m_cond_text)
+ for(const QPointer<ConductorTextItem>& cti : m_cond_text)
{
cti->forceRotateByUser(m_rotate_by_user.value(cti.data()));
if(!cti->wasRotateByUser())
@@ -103,7 +103,7 @@
m_diagram->showMe();
QUndoCommand::redo();
- for(QPointer<ConductorTextItem> cti : m_cond_text)
+ for(const QPointer<ConductorTextItem>& cti : m_cond_text)
{
m_rotate_by_user.insert(cti, cti->wasRotateByUser());
cti->forceRotateByUser(true);
Modified: trunk/sources/undocommand/rotatetextscommand.cpp
===================================================================
--- trunk/sources/undocommand/rotatetextscommand.cpp 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/undocommand/rotatetextscommand.cpp 2018-07-19 14:14:31 UTC (rev 5448)
@@ -138,7 +138,7 @@
#endif
}
-void RotateTextsCommand::setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant start, const QVariant end)
+void RotateTextsCommand::setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant& start, const QVariant& end)
{
if(m_anim_group == nullptr)
m_anim_group = new QParallelAnimationGroup();
Modified: trunk/sources/undocommand/rotatetextscommand.h
===================================================================
--- trunk/sources/undocommand/rotatetextscommand.h 2018-07-18 11:50:14 UTC (rev 5447)
+++ trunk/sources/undocommand/rotatetextscommand.h 2018-07-19 14:14:31 UTC (rev 5448)
@@ -40,7 +40,7 @@
private:
void openDialog();
- void setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant start, const QVariant end);
+ void setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant& start, const QVariant& end);
private:
QPointer<Diagram> m_diagram;