diff --git a/sources/ElementsCollection/elementcollectionhandler.cpp b/sources/ElementsCollection/elementcollectionhandler.cpp index d295ea39d..378ed0757 100644 --- a/sources/ElementsCollection/elementcollectionhandler.cpp +++ b/sources/ElementsCollection/elementcollectionhandler.cpp @@ -44,7 +44,7 @@ ECHSFileToFile::ECHSFileToFile(ElementsLocation &source, ElementsLocation &desti ElementsLocation ECHSFileToFile::copy() { //Check if the destination already have an item with the same name of the item to copy - ElementsLocation location(m_destination.fileSystemPath() + "/" + m_source.fileName()); + ElementsLocation location(m_destination.fileSystemPath() % "/" % m_source.fileName()); QString rename; if (location.exist()) { @@ -92,10 +92,10 @@ ElementsLocation ECHSFileToFile::copyDirectory(ElementsLocation &source, Element if (destination_dir.mkdir(new_dir_name)) { //The new created directory - QDir created_dir(destination_dir.canonicalPath() + "/" + new_dir_name); + QDir created_dir(destination_dir.canonicalPath() % "/" % new_dir_name); //Copy the qet_directory file - QFile::copy(source_dir.canonicalPath() + "/qet_directory", created_dir.canonicalPath() + "/qet_directory"); + QFile::copy(source_dir.canonicalPath() % "/qet_directory", created_dir.canonicalPath() % "/qet_directory"); //Copy all dirs found in source_dir to destination_dir ElementsLocation created_location(created_dir.canonicalPath()); @@ -115,7 +115,7 @@ ElementsLocation ECHSFileToFile::copyDirectory(ElementsLocation &source, Element } } - ElementsLocation sub_source(source.fileSystemPath() + "/" + str); + ElementsLocation sub_source(source.fileSystemPath() % "/" % str); copyDirectory(sub_source, created_location); } @@ -123,7 +123,7 @@ ElementsLocation ECHSFileToFile::copyDirectory(ElementsLocation &source, Element source_dir.setNameFilters(QStringList() << "*.elmt"); foreach(QString str, source_dir.entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name)) { - ElementsLocation sub_source(source.fileSystemPath() + "/" + str); + ElementsLocation sub_source(source.fileSystemPath() % "/" % str); copyElement(sub_source, created_location); } @@ -136,7 +136,7 @@ ElementsLocation ECHSFileToFile::copyDirectory(ElementsLocation &source, Element 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); + bool rb = QFile::copy(source.fileSystemPath(), destination.fileSystemPath() % "/" % new_elmt_name); if (rb) { #ifdef Q_OS_WIN @@ -145,7 +145,7 @@ ElementsLocation ECHSFileToFile::copyElement(ElementsLocation &source, ElementsL //user can't save the element extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; qt_ntfs_permission_lookup++; - QFile file(destination.fileSystemPath() + "/" + new_elmt_name); + QFile file(destination.fileSystemPath() % "/" % new_elmt_name); if (!file.isWritable()) { if (!file.setPermissions(file.permissions() | QFileDevice::WriteUser)) { qDebug() << "Failed to change file permission of : " << QFileInfo(file).canonicalFilePath() \ @@ -154,7 +154,7 @@ ElementsLocation ECHSFileToFile::copyElement(ElementsLocation &source, ElementsL } qt_ntfs_permission_lookup--; #endif - return ElementsLocation (destination.fileSystemPath() + "/" + new_elmt_name); + return ElementsLocation (destination.fileSystemPath() % "/" % new_elmt_name); } else return ElementsLocation(); @@ -169,7 +169,7 @@ ECHSXmlToFile::ECHSXmlToFile(ElementsLocation &source, ElementsLocation &destina ElementsLocation ECHSXmlToFile::copy() { //Check if the destination already have an item with the same name of the item to copy - ElementsLocation location(m_destination.fileSystemPath() + "/" + m_source.fileName()); + ElementsLocation location(m_destination.fileSystemPath() % "/" % m_source.fileName()); QString rename; if (location.exist()) { @@ -215,7 +215,7 @@ ElementsLocation ECHSXmlToFile::copyDirectory(ElementsLocation &source, Elements //Create new dir if (destination_dir.mkdir(new_dir_name)) { - QDir created_dir(destination_dir.canonicalPath() + "/" + new_dir_name); + QDir created_dir(destination_dir.canonicalPath() % "/" % new_dir_name); ElementsLocation created_location(created_dir.canonicalPath()); //Create the qet-directory file @@ -224,7 +224,7 @@ ElementsLocation ECHSXmlToFile::copyDirectory(ElementsLocation &source, Elements document.appendChild(root); root.appendChild(source.nameList().toXml(document)); - QString filepath = created_dir.canonicalPath() + "/qet_directory"; + QString filepath = created_dir.canonicalPath() % "/qet_directory"; QET::writeXmlFile(document, filepath); //Create all directory found in source to created_dir @@ -233,7 +233,7 @@ ElementsLocation ECHSXmlToFile::copyDirectory(ElementsLocation &source, Elements QStringList directories_names = project_collection->directoriesNames( project_collection->directory(source.collectionPath(false)) ); foreach(QString name, directories_names) { - ElementsLocation sub_source_dir(source.projectCollectionPath() + "/" + name); + ElementsLocation sub_source_dir(source.projectCollectionPath() % "/" % name); copyDirectory(sub_source_dir, created_location); } @@ -241,7 +241,7 @@ ElementsLocation ECHSXmlToFile::copyDirectory(ElementsLocation &source, Elements QStringList elements_names = project_collection->elementsNames( project_collection->directory(source.collectionPath(false))) ; foreach (QString name, elements_names) { - ElementsLocation source_element(source.projectCollectionPath() + "/" + name); + ElementsLocation source_element(source.projectCollectionPath() % "/" % name); copyElement(source_element, created_location); } @@ -262,7 +262,7 @@ ElementsLocation ECHSXmlToFile::copyElement(ElementsLocation &source, ElementsLo document.appendChild(document.importNode(source.xml(), true)); //Create the .elmt file - QString filepath = destination.fileSystemPath() + "/" + new_element_name; + QString filepath = destination.fileSystemPath() % "/" % new_element_name; if (QET::writeXmlFile(document, filepath)) return ElementsLocation(filepath); else @@ -280,7 +280,7 @@ ElementsLocation ECHSToXml::copy() if (!(m_source.exist() && m_destination.isDirectory() && m_destination.isProject())) return ElementsLocation(); //Check if the destination already have an item with the same name of the item to copy - ElementsLocation location(m_destination.projectCollectionPath() + "/" + m_source.fileName()); + ElementsLocation location(m_destination.projectCollectionPath() % "/" % m_source.fileName()); QString rename; if (location.exist()) @@ -370,7 +370,7 @@ ElementsLocation ElementCollectionHandler::createDir(ElementsLocation &parent, c document.appendChild(root); root.appendChild(name_list.toXml(document)); - QString filepath = created_dir.fileSystemPath() + "/qet_directory"; + QString filepath = created_dir.fileSystemPath() % "/qet_directory"; if (!QET::writeXmlFile(document, filepath)) { qDebug() << "ElementCollectionHandler::createDir : write qet-directory file failed"; } diff --git a/sources/ElementsCollection/elementscollectionwidget.cpp b/sources/ElementsCollection/elementscollectionwidget.cpp index 2ab4e9ab3..d86a35266 100644 --- a/sources/ElementsCollection/elementscollectionwidget.cpp +++ b/sources/ElementsCollection/elementscollectionwidget.cpp @@ -620,7 +620,7 @@ void ElementsCollectionWidget::dirProperties() QMessageBox::information( this, tr("Propriété du dossier %1").arg(eci->localName()), - txt1 + " " + txt2 + " " + txt3 + "\n\n" + txt4 + "\n" + txt5); + txt1 % " " % txt2 % " " % txt3 % "\n\n" % txt4 % "\n" % txt5); } } diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp index f9c66c369..d214fbda2 100644 --- a/sources/ElementsCollection/elementslocation.cpp +++ b/sources/ElementsCollection/elementslocation.cpp @@ -196,9 +196,9 @@ QString ElementsLocation::projectCollectionPath() const return QString(); else return QString("project" - + QString::number(QETApp::projectId(m_project)) - + "+" - + collectionPath()); + % QString::number(QETApp::projectId(m_project)) + % "+" + % collectionPath()); } /** @@ -296,17 +296,17 @@ void ElementsLocation::setPath(const QString &path) if (path.startsWith("common://")) { tmp_path.remove("common://"); - p = QETApp::commonElementsDirN() + "/" + tmp_path; + p = QETApp::commonElementsDirN() % "/" % tmp_path; } else if (path.startsWith("company://")) { tmp_path.remove("company://"); - p = QETApp::companyElementsDirN() + "/" + tmp_path; + p = QETApp::companyElementsDirN() % "/" % tmp_path; } else { tmp_path.remove("custom://"); - p = QETApp::customElementsDirN() + "/" + tmp_path; + p = QETApp::customElementsDirN() % "/" % tmp_path; } m_file_system_path = p; @@ -464,7 +464,7 @@ QString ElementsLocation::toString() const if (m_project) { int project_id = QETApp::projectId(m_project); if (project_id != -1) { - result += "project" + QString().setNum(project_id) + "+"; + result += "project" % QString().setNum(project_id) % "+"; } } result += m_collection_path; @@ -624,7 +624,7 @@ NamesList ElementsLocation::nameList() { //Open the qet_directory file, // to get the traductions name of this dir - QFile dir_conf(fileSystemPath() + "/qet_directory"); + QFile dir_conf(fileSystemPath() % "/qet_directory"); if (dir_conf.exists() && dir_conf.open( QIODevice::ReadOnly | QIODevice::Text)) diff --git a/sources/ElementsCollection/fileelementcollectionitem.cpp b/sources/ElementsCollection/fileelementcollectionitem.cpp index 5b1031553..f00820467 100644 --- a/sources/ElementsCollection/fileelementcollectionitem.cpp +++ b/sources/ElementsCollection/fileelementcollectionitem.cpp @@ -67,7 +67,7 @@ QString FileElementCollectionItem::fileSystemPath() const FileElementCollectionItem *feci = static_cast (parent()); if (feci) - return feci->fileSystemPath() + "/" + m_path; + return feci->fileSystemPath() % "/" % m_path; else return QString();//Null string } @@ -131,7 +131,7 @@ QString FileElementCollectionItem::localName() } else { - QString str(fileSystemPath() + "/qet_directory"); + QString str(fileSystemPath() % "/qet_directory"); pugi::xml_document docu; if(docu.load_file(str.toStdString().c_str())) { @@ -208,7 +208,7 @@ QString FileElementCollectionItem::collectionPath() const if (eci->isCollectionRoot()) return eci->collectionPath() + m_path; else - return eci->collectionPath() + "/" + m_path; + return eci->collectionPath() % "/" % m_path; } else return QString(); diff --git a/sources/ElementsCollection/xmlelementcollection.cpp b/sources/ElementsCollection/xmlelementcollection.cpp index a360bed0e..c142385df 100644 --- a/sources/ElementsCollection/xmlelementcollection.cpp +++ b/sources/ElementsCollection/xmlelementcollection.cpp @@ -446,7 +446,7 @@ QString XmlElementCollection::addElement(ElementsLocation &location) if (path.isEmpty()) path = str; else - path = path + "/" + str; + path = path % "/" % str; QDomElement child_element = child(parent_element, str); @@ -530,7 +530,7 @@ bool XmlElementCollection::addElementDefinition( dom_elmt.appendChild(xml_definition.cloneNode(true)); dom_dir.appendChild(dom_elmt); - emit elementAdded(dir_path + "/" + name); + emit elementAdded(dir_path % "/" % name); return true; } @@ -617,7 +617,7 @@ bool XmlElementCollection::createDir(const QString& path, const QString& name, const NamesList &name_list) { - QString new_dir_path = path + "/" + name; + QString new_dir_path = path % "/" % name; if (!directory(new_dir_path).isNull()) { return true; @@ -724,7 +724,7 @@ ElementsLocation XmlElementCollection::domToLocation( dom_element = dom_element.parentNode().toElement(); if (dom_element.tagName() == "category") - path.prepend(dom_element.attribute("name") + "/"); + path.prepend(dom_element.attribute("name") % "/"); } return ElementsLocation(path, m_project); @@ -789,11 +789,11 @@ ElementsLocation XmlElementCollection::copyDirectory( //Remove the previous directory with the same path QDomElement element = child(destination.collectionPath(false) - + "/" + new_dir_name); + % "/" % new_dir_name); if (!element.isNull()) { element.parentNode().removeChild(element); emit directoryRemoved(destination.collectionPath(false) - + "/" + new_dir_name); + % "/" % new_dir_name); } ElementsLocation created_location; @@ -813,7 +813,7 @@ ElementsLocation XmlElementCollection::copyDirectory( parent_dir_dom.appendChild(elmt_dom); created_location.setPath(destination.projectCollectionPath() - + "/" + new_dir_name); + % "/" % new_dir_name); if (deep_copy) { @@ -823,7 +823,7 @@ ElementsLocation XmlElementCollection::copyDirectory( QDir::Name)) { ElementsLocation sub_source(source.fileSystemPath() - + "/" + str); + % "/" % str); copyDirectory(sub_source, created_location); } @@ -834,7 +834,7 @@ ElementsLocation XmlElementCollection::copyDirectory( QDir::Name)) { ElementsLocation sub_source(source.fileSystemPath() - + "/" + str); + % "/" % str); copyElement(sub_source, created_location); } } @@ -861,7 +861,7 @@ ElementsLocation XmlElementCollection::copyDirectory( other_collection_dom_dir.setAttribute("name", new_dir_name); parent_dir_dom.appendChild(other_collection_dom_dir); - created_location.setPath(destination.projectCollectionPath() + "/" + new_dir_name); + created_location.setPath(destination.projectCollectionPath() % "/" % new_dir_name); } emit directorieAdded(created_location.collectionPath(false)); @@ -906,7 +906,7 @@ ElementsLocation XmlElementCollection::copyElement( //Remove the previous element with the same path QDomElement element = child(destination.collectionPath(false) - + "/" + new_elmt_name); + % "/" % new_elmt_name); bool removed = false; if (!element.isNull()) { element.parentNode().removeChild(element); @@ -919,7 +919,7 @@ ElementsLocation XmlElementCollection::copyElement( dir_dom.appendChild(elmt_dom); ElementsLocation copy_loc(destination.projectCollectionPath() - + "/" + new_elmt_name); + % "/" % new_elmt_name); if (removed) { emit elementChanged(copy_loc.collectionPath(false)); diff --git a/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp b/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp index 7015b9ec3..eebc32eab 100644 --- a/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp +++ b/sources/ElementsCollection/xmlprojectelementcollectionitem.cpp @@ -108,7 +108,7 @@ QString XmlProjectElementCollectionItem::embeddedPath() const if (xpeci->isCollectionRoot()) return xpeci->embeddedPath() + name(); else - return xpeci->embeddedPath() + "/" + name(); + return xpeci->embeddedPath() % "/" % name(); } else return QString(); diff --git a/sources/SearchAndReplace/ui/searchandreplacewidget.cpp b/sources/SearchAndReplace/ui/searchandreplacewidget.cpp index 75ae79c1b..e32f10fca 100644 --- a/sources/SearchAndReplace/ui/searchandreplacewidget.cpp +++ b/sources/SearchAndReplace/ui/searchandreplacewidget.cpp @@ -419,7 +419,7 @@ void SearchAndReplaceWidget::search() else { //entire word - QRegularExpression rx("\\b" + str + "\\b"); + QRegularExpression rx("\\b" % str % "\\b"); if (!rx.isValid()) { qWarning() <> terminals, TerminalStrip *strip, QUndoCommand *parent) : @@ -57,7 +57,7 @@ AddTerminalToStripCommand::AddTerminalToStripCommand(QVector termin auto str_3 = new_strip_name.isEmpty() ? QObject::tr("vers un groupe de bornes") : QObject::tr("vers le groupe de bornes %1").arg(new_strip_name); - setText(str_1 + " " + str_2 + " " + str_3); + setText(str_1 % " " % str_2 % " " % str_3); } MoveTerminalCommand::MoveTerminalCommand(QVector> terminals, TerminalStrip *old_strip, @@ -201,7 +201,7 @@ MoveTerminalCommand::MoveTerminalCommand(QVectorm_from_folios_cb->currentText(); QString to = ui->m_to_folios_cb->currentText(); ui->m_selected_folios_le->clear(); - ui->m_selected_folios_le->insert(from + " - " + to); + ui->m_selected_folios_le->insert(from % " - " % to); ui->m_selected_folios_le->setDisabled(true); } applyEnable(true); diff --git a/sources/borderproperties.cpp b/sources/borderproperties.cpp index c1ced7e9f..77162b730 100644 --- a/sources/borderproperties.cpp +++ b/sources/borderproperties.cpp @@ -138,12 +138,12 @@ void BorderProperties::fromXml(QDomElement &e) { */ void BorderProperties::toSettings(QSettings &settings, const QString &prefix) const { - settings.setValue(prefix + "cols", columns_count); - settings.setValue(prefix + "colsize", columns_width); - settings.setValue(prefix + "displaycols", display_columns); - settings.setValue(prefix + "rows", rows_count); - settings.setValue(prefix + "rowsize", rows_height); - settings.setValue(prefix + "displayrows", display_rows); + settings.setValue(prefix % "cols", columns_count); + settings.setValue(prefix % "colsize", columns_width); + settings.setValue(prefix % "displaycols", display_columns); + settings.setValue(prefix % "rows", rows_count); + settings.setValue(prefix % "rowsize", rows_height); + settings.setValue(prefix % "displayrows", display_rows); } /** @@ -156,13 +156,13 @@ void BorderProperties::toSettings(QSettings &settings, const QString &prefix) co \~French prefixe a ajouter devant les noms des parametres */ void BorderProperties::fromSettings(QSettings &settings, const QString &prefix) { - columns_count = settings.value(prefix + "cols", columns_count).toInt(); - columns_width = qRound(settings.value(prefix + "colsize", columns_width).toDouble()); - display_columns = settings.value(prefix + "displaycols", display_columns).toBool(); + columns_count = settings.value(prefix % "cols", columns_count).toInt(); + columns_width = qRound(settings.value(prefix % "colsize", columns_width).toDouble()); + display_columns = settings.value(prefix % "displaycols", display_columns).toBool(); - rows_count = settings.value(prefix + "rows", rows_count).toInt(); - rows_height = qRound(settings.value(prefix + "rowsize", rows_height).toDouble()); - display_rows = settings.value(prefix + "displayrows", display_rows).toBool(); + rows_count = settings.value(prefix % "rows", rows_count).toInt(); + rows_height = qRound(settings.value(prefix % "rowsize", rows_height).toDouble()); + display_rows = settings.value(prefix % "displayrows", display_rows).toBool(); } /** diff --git a/sources/bordertitleblock.cpp b/sources/bordertitleblock.cpp index 7c744c810..8d86e7a7d 100644 --- a/sources/bordertitleblock.cpp +++ b/sources/bordertitleblock.cpp @@ -949,7 +949,7 @@ QString BorderTitleBlock::incrementLetters(const QString &string) { last_digit = (char)(string[string.length()-1].unicode()) + 1; return(first_digits + QString(last_digit)); } else { - return(incrementLetters(first_digits) + "A"); + return(incrementLetters(first_digits) % "A"); } } } diff --git a/sources/conductornumexport.cpp b/sources/conductornumexport.cpp index a18bf527b..a67fda30b 100644 --- a/sources/conductornumexport.cpp +++ b/sources/conductornumexport.cpp @@ -49,7 +49,7 @@ bool ConductorNumExport::toCsv() //save in csv file in same directory as project by default QString dir = m_project->currentDir(); if (dir.isEmpty()) dir = QETApp::documentDir(); - QString name = dir + "/" + QObject::tr("numero_de_fileries_") + m_project->title() + ".csv"; + QString name = dir % "/" % QObject::tr("numero_de_fileries_") % m_project->title() % ".csv"; // if(!name.endsWith(".csv")) { // name += ".csv"; // } @@ -105,7 +105,7 @@ QString ConductorNumExport::wiresNum() const for (QString key : list) { for (int i=0; iproject()->filePath(); if (dir_.isEmpty()) { - dir_ = QETApp::documentDir() + "/" + tr("sans_nom") + ".sqlite"; + dir_ = QETApp::documentDir() % "/" % tr("sans_nom") % ".sqlite"; } else { dir_.remove(".qet"); dir_.append(".sqlite"); @@ -690,7 +690,7 @@ void projectDataBase::exportDb(projectDataBase *db, return; } - QString connection_name("export_project_db_" + db->project()->uuid().toString()); + QString connection_name("export_project_db_" % db->project()->uuid().toString()); if (true) //Enter in a scope only to nicely use QSqlDatabase::removeDatabase just after the end of the scope { diff --git a/sources/dataBase/ui/elementquerywidget.cpp b/sources/dataBase/ui/elementquerywidget.cpp index 84956fb28..6b78fbfe7 100644 --- a/sources/dataBase/ui/elementquerywidget.cpp +++ b/sources/dataBase/ui/elementquerywidget.cpp @@ -416,7 +416,7 @@ void ElementQueryWidget::setGroupBy(QString text, bool set) void ElementQueryWidget::setCount(QString text, bool set) { if (set) { - m_count = QString(", " + text + " "); + m_count = QString(", " % text % " "); } else { m_count.clear(); } @@ -489,7 +489,7 @@ QPair ElementQueryWidget::FilterFor(const QString &key) const */ void ElementQueryWidget::fillSavedQuery() { - QFile file(QETApp::configDir() + "/nomenclature.json"); + QFile file(QETApp::configDir() % "/nomenclature.json"); if (file.open(QFile::ReadOnly)) { QJsonDocument jsd(QJsonDocument::fromJson(file.readAll())); @@ -625,7 +625,7 @@ void ElementQueryWidget::on_m_load_pb_clicked() return; } - QFile file_(QETApp::configDir() + "/nomenclature.json"); + QFile file_(QETApp::configDir() % "/nomenclature.json"); if (!file_.open(QFile::ReadOnly)) { return; } @@ -650,7 +650,7 @@ void ElementQueryWidget::on_m_load_pb_clicked() */ void ElementQueryWidget::on_m_save_current_conf_pb_clicked() { - QFile file_(QETApp::configDir() + "/nomenclature.json"); + QFile file_(QETApp::configDir() % "/nomenclature.json"); if (file_.open(QFile::ReadWrite)) { diff --git a/sources/dataBase/ui/summaryquerywidget.cpp b/sources/dataBase/ui/summaryquerywidget.cpp index efc2c1d5a..1ca3d52ed 100644 --- a/sources/dataBase/ui/summaryquerywidget.cpp +++ b/sources/dataBase/ui/summaryquerywidget.cpp @@ -143,7 +143,7 @@ void SummaryQueryWidget::setUpItems() */ void SummaryQueryWidget::fillSavedQuery() { - QFile file(QETApp::configDir() + "/summary.json"); + QFile file(QETApp::configDir() % "/summary.json"); if (file.open(QFile::ReadOnly)) { QJsonDocument jsd(QJsonDocument::fromJson(file.readAll())); @@ -296,7 +296,7 @@ void SummaryQueryWidget::reset() */ void SummaryQueryWidget::saveConfig() { - QFile file_(QETApp::configDir() + "/summary.json"); + QFile file_(QETApp::configDir() % "/summary.json"); if (file_.open(QFile::ReadWrite)) { @@ -331,7 +331,7 @@ void SummaryQueryWidget::loadConfig() return; } - QFile file_(QETApp::configDir() + "/summary.json"); + QFile file_(QETApp::configDir() % "/summary.json"); if (!file_.open(QFile::ReadOnly)) { return; } diff --git a/sources/dxf/dxftoelmt.cpp b/sources/dxf/dxftoelmt.cpp index bd21f2c54..916e228d0 100644 --- a/sources/dxf/dxftoelmt.cpp +++ b/sources/dxf/dxftoelmt.cpp @@ -71,7 +71,7 @@ QByteArray dxfToElmt(const QString &file_path) QString dxf2ElmtDirPath() { - return QETApp::dataDir() + "/binary"; + return QETApp::dataDir() % "/binary"; } /** @@ -81,11 +81,11 @@ QString dxf2ElmtDirPath() QString dxf2ElmtBinaryPath() { #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) - return dxf2ElmtDirPath() + QStringLiteral("/dxf2elmt.exe"); + return dxf2ElmtDirPath() % QStringLiteral("/dxf2elmt.exe"); #elif defined(Q_OS_MACOS) - return dxf2ElmtDirPath() + QStringLiteral("/./dxf2elmt"); + return dxf2ElmtDirPath() % QStringLiteral("/./dxf2elmt"); #else - return dxf2ElmtDirPath() + QStringLiteral("/dxf2elmt"); + return dxf2ElmtDirPath() % QStringLiteral("/dxf2elmt"); #endif } diff --git a/sources/elementtextpattern.cpp b/sources/elementtextpattern.cpp index f76fae68b..71a2f9586 100644 --- a/sources/elementtextpattern.cpp +++ b/sources/elementtextpattern.cpp @@ -59,7 +59,7 @@ ExportElementTextPattern::ExportElementTextPattern(Element *elmt) : return; //Check if a conf with the same name already exist - if (QFileInfo::exists(dir.absoluteFilePath(m_name + ".xml"))) + if (QFileInfo::exists(dir.absoluteFilePath(m_name % ".xml"))) { bool r = QMessageBox::question(parentWidget(), QObject::tr("Configuration de textes"), @@ -71,7 +71,7 @@ ExportElementTextPattern::ExportElementTextPattern(Element *elmt) : } QDomDocument doc = xmlConf(); - QET::writeXmlFile(doc, dir.absoluteFilePath(m_name + ".xml")); + QET::writeXmlFile(doc, dir.absoluteFilePath(m_name % ".xml")); } /** @@ -202,7 +202,7 @@ void ImportElementTextPattern::apply(QString name, bool erase) const if(!name.endsWith(".xml")) name.append(".xml"); - QFile conf_file(QETApp::configDir() + "/element_texts_pattern/" + name); + QFile conf_file(QETApp::configDir() % "/element_texts_pattern/" % name); if(!conf_file.open(QIODevice::ReadOnly | QIODevice::Text)) return; diff --git a/sources/exportdialog.cpp b/sources/exportdialog.cpp index 2e593ed75..29d14f958 100644 --- a/sources/exportdialog.cpp +++ b/sources/exportdialog.cpp @@ -1014,7 +1014,7 @@ ExportDialog::ExportDiagramLine::ExportDiagramLine(Diagram *dia, QSize diagram_s if (diagram_title.isEmpty()) diagram_title = QObject::tr("Folio sans titre"); QString diagram_filename = diagram -> title(); if (diagram_filename.isEmpty()) diagram_filename = QObject::tr("schema"); - diagram_filename = QET::stringToFileName(diagram_index + "_" + diagram_filename); + diagram_filename = QET::stringToFileName(diagram_index % "_" % diagram_filename); title_label = new QLabel(diagram_title); diff --git a/sources/exportproperties.cpp b/sources/exportproperties.cpp index 250632624..191ac0c12 100644 --- a/sources/exportproperties.cpp +++ b/sources/exportproperties.cpp @@ -54,24 +54,24 @@ ExportProperties::~ExportProperties() void ExportProperties::toSettings(QSettings &settings, const QString &prefix) const { - settings.setValue(prefix + "path", + settings.setValue(prefix % "path", QDir::toNativeSeparators( destination_directory.absolutePath())); - settings.setValue(prefix + "format", + settings.setValue(prefix % "format", format); - settings.setValue(prefix + "drawgrid", + settings.setValue(prefix % "drawgrid", draw_grid); - settings.setValue(prefix + "drawborder", + settings.setValue(prefix % "drawborder", draw_border); - settings.setValue(prefix + "drawtitleblock", + settings.setValue(prefix % "drawtitleblock", draw_titleblock); - settings.setValue(prefix + "drawterminals", + settings.setValue(prefix % "drawterminals", draw_terminals); - settings.setValue(prefix + "drawbgtransparent", + settings.setValue(prefix % "drawbgtransparent", draw_bg_transparent); - settings.setValue(prefix + "drawcoloredconductors", + settings.setValue(prefix % "drawcoloredconductors", draw_colored_conductors); - settings.setValue(prefix + "area", + settings.setValue(prefix % "area", QET::diagramAreaToString(exported_area)); } @@ -85,30 +85,30 @@ void ExportProperties::fromSettings(QSettings &settings, QString export_path = QETApp::documentDir(); destination_directory.setPath( settings.value( - prefix + "path", + prefix % "path", export_path).toString()); if (!destination_directory.exists()) destination_directory.setPath(export_path); - format = settings.value(prefix + "format").toString(); + format = settings.value(prefix % "format").toString(); - draw_grid = settings.value(prefix + "drawgrid", + draw_grid = settings.value(prefix % "drawgrid", false).toBool(); - draw_border = settings.value(prefix + "drawborder", + draw_border = settings.value(prefix % "drawborder", true ).toBool(); - draw_titleblock = settings.value(prefix + "drawtitleblock", + draw_titleblock = settings.value(prefix % "drawtitleblock", true ).toBool(); - draw_terminals = settings.value(prefix + "drawterminals", + draw_terminals = settings.value(prefix % "drawterminals", false).toBool(); - draw_bg_transparent = settings.value(prefix + "drawbgtransparent", + draw_bg_transparent = settings.value(prefix % "drawbgtransparent", false).toBool(); draw_colored_conductors = settings.value( - prefix + "drawcoloredconductors", + prefix % "drawcoloredconductors", true ).toBool(); exported_area = QET::diagramAreaFromString( settings.value( - prefix + "area", + prefix % "area", "border").toString()); } diff --git a/sources/factory/ui/addtabledialog.cpp b/sources/factory/ui/addtabledialog.cpp index 374199165..9b87ac6e5 100644 --- a/sources/factory/ui/addtabledialog.cpp +++ b/sources/factory/ui/addtabledialog.cpp @@ -202,7 +202,7 @@ void AddTableDialog::on_m_table_margins_pb_clicked() void AddTableDialog::saveConfig() { - QFile file_(QETApp::configDir() + "/graphics_table.json"); + QFile file_(QETApp::configDir() % "/graphics_table.json"); if (file_.open(QFile::ReadWrite)) { @@ -247,7 +247,7 @@ void AddTableDialog::loadConfig() return; } - QFile file_(QETApp::configDir() + "/graphics_table.json"); + QFile file_(QETApp::configDir() % "/graphics_table.json"); if (!file_.open(QFile::ReadOnly)) { return; } @@ -297,7 +297,7 @@ void AddTableDialog::loadConfig() void AddTableDialog::fillSavedQuery() { - QFile file(QETApp::configDir() + "/graphics_table.json"); + QFile file(QETApp::configDir() % "/graphics_table.json"); if (file.open(QFile::ReadOnly)) { QJsonDocument jsd(QJsonDocument::fromJson(file.readAll())); diff --git a/sources/main.cpp b/sources/main.cpp index cf965fd4c..8e3a05d36 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -132,7 +132,7 @@ void myMessageOutput(QtMsgType type, void delete_old_log_files(int days) { const QDate today = QDate::currentDate(); - const QString path = QETApp::dataDir() + "/"; + const QString path = QETApp::dataDir() % "/"; QString filter("%1%1%1%1%1%1%1%1.log"); // pattern filter = filter.arg("[0123456789]"); // valid characters @@ -148,7 +148,7 @@ void delete_old_log_files(int days) QDir deletefile; deletefile.setPath(filepath); deletefile.remove(filepath); - qDebug() << "File " + filepath + " is deleted!"; + qDebug() << "File " % filepath % " is deleted!"; } } } diff --git a/sources/properties/xrefproperties.cpp b/sources/properties/xrefproperties.cpp index 2ce72747e..848a04144 100644 --- a/sources/properties/xrefproperties.cpp +++ b/sources/properties/xrefproperties.cpp @@ -47,24 +47,24 @@ XRefProperties::XRefProperties() void XRefProperties::toSettings(QSettings &settings, const QString prefix) const { - settings.setValue(prefix + "showpowerctc", m_show_power_ctc); + settings.setValue(prefix % "showpowerctc", m_show_power_ctc); QString display = m_display == Cross? "cross" : "contacts"; - settings.setValue(prefix + "displayhas", display); + settings.setValue(prefix % "displayhas", display); QString snap = m_snap_to == Bottom? "bottom" : "label"; - settings.setValue(prefix + "snapto", snap); + settings.setValue(prefix % "snapto", snap); int offset = m_offset; - settings.setValue(prefix + "offset", offset); + settings.setValue(prefix % "offset", offset); QString master_label = m_master_label; - settings.setValue(prefix + "master_label", master_label); + settings.setValue(prefix % "master_label", master_label); QString slave_label = m_slave_label; - settings.setValue(prefix + "slave_label", slave_label); + settings.setValue(prefix % "slave_label", slave_label); QMetaEnum var = QMetaEnum::fromType(); - settings.setValue(prefix + "xrefpos", var.valueToKey(m_xref_pos)); + settings.setValue(prefix % "xrefpos", var.valueToKey(m_xref_pos)); foreach (QString key, m_prefix.keys()) { - settings.setValue(prefix + key + "prefix", m_prefix.value(key)); + settings.setValue(prefix % key % "prefix", m_prefix.value(key)); } } @@ -77,20 +77,20 @@ void XRefProperties::toSettings(QSettings &settings, void XRefProperties::fromSettings(const QSettings &settings, const QString prefix) { - m_show_power_ctc = settings.value(prefix + "showpowerctc", true).toBool(); - QString display = settings.value(prefix + "displayhas", "cross").toString(); + m_show_power_ctc = settings.value(prefix % "showpowerctc", true).toBool(); + QString display = settings.value(prefix % "displayhas", "cross").toString(); display == "cross"? m_display = Cross : m_display = Contacts; - QString snap = settings.value(prefix + "snapto", "label").toString(); + QString snap = settings.value(prefix % "snapto", "label").toString(); snap == "bottom"? m_snap_to = Bottom : m_snap_to = Label; - m_offset = settings.value(prefix + "offset", "0").toInt(); - m_master_label = settings.value(prefix + "master_label", "%f-%l%c").toString(); - m_slave_label = settings.value(prefix + "slave_label", "(%f-%l%c)").toString(); + m_offset = settings.value(prefix % "offset", "0").toInt(); + m_master_label = settings.value(prefix % "master_label", "%f-%l%c").toString(); + m_slave_label = settings.value(prefix % "slave_label", "(%f-%l%c)").toString(); QMetaEnum var = QMetaEnum::fromType(); - m_xref_pos = Qt::AlignmentFlag(var.keyToValue((settings.value(prefix + "xrefpos").toString()).toStdString().data())); + m_xref_pos = Qt::AlignmentFlag(var.keyToValue((settings.value(prefix % "xrefpos").toString()).toStdString().data())); for (QString key : m_prefix_keys) { - m_prefix.insert(key, settings.value(prefix + key + "prefix").toString()); + m_prefix.insert(key, settings.value(prefix + key % "prefix").toString()); } } @@ -124,7 +124,7 @@ QDomElement XRefProperties::toXml(QDomDocument &xml_document) const QString slave_label = m_slave_label; xml_element.setAttribute("slave_label", slave_label); foreach (QString key, m_prefix.keys()) { - xml_element.setAttribute(key + "prefix", m_prefix.value(key)); + xml_element.setAttribute(key % "prefix", m_prefix.value(key)); } return xml_element; @@ -155,7 +155,7 @@ bool XRefProperties::fromXml(const QDomElement &xml_element) { m_master_label = xml_element.attribute("master_label", "%f-%l%c"); m_slave_label = xml_element.attribute("slave_label","(%f-%l%c)"); foreach (QString key, m_prefix_keys) { - m_prefix.insert(key, xml_element.attribute(key + "prefix")); + m_prefix.insert(key, xml_element.attribute(key % "prefix")); } return true; } diff --git a/sources/qet_elementscaler/qet_elementscaler.cpp b/sources/qet_elementscaler/qet_elementscaler.cpp index b4ad83150..6d486dacf 100644 --- a/sources/qet_elementscaler/qet_elementscaler.cpp +++ b/sources/qet_elementscaler/qet_elementscaler.cpp @@ -113,7 +113,7 @@ QByteArray ElementScaler(const QString &file_path, QWidget *parent) QString ElementScalerDirPath() { - return QETApp::dataDir() + "/binary"; + return QETApp::dataDir() % "/binary"; } /** @@ -123,11 +123,11 @@ QString ElementScalerDirPath() QString ElementScalerBinaryPath() { #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) - return ElementScalerDirPath() + QStringLiteral("/QET_ElementScaler.exe"); + return ElementScalerDirPath() % QStringLiteral("/QET_ElementScaler.exe"); #elif defined(Q_OS_MACOS) - return ElementScalerDirPath() + QStringLiteral("/./QET_ElementScaler"); + return ElementScalerDirPath() % QStringLiteral("/./QET_ElementScaler"); #else - return ElementScalerDirPath() + QStringLiteral("/QET_ElementScaler"); + return ElementScalerDirPath() % QStringLiteral("/QET_ElementScaler"); #endif } diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp index 495a14e2e..3ecb8bdf6 100644 --- a/sources/qetproject.cpp +++ b/sources/qetproject.cpp @@ -1141,7 +1141,7 @@ ElementsLocation QETProject::importElement(ElementsLocation &location) do { a++; - QString new_path = parent_path + "/" + name_ + QString::number(a) + ".elmt"; + QString new_path = parent_path % "/" % name_ % QString::number(a) % ".elmt"; loc = ElementsLocation (new_path); } while (loc.exist()); diff --git a/sources/recentfiles.cpp b/sources/recentfiles.cpp index 7819f4f51..5c1b789e0 100644 --- a/sources/recentfiles.cpp +++ b/sources/recentfiles.cpp @@ -132,7 +132,7 @@ void RecentFiles::extractFilesFromSettings() QSettings settings; for (int i = size_ ; i >= 1 ; -- i) { - QString key(identifier_ + "-recentfiles/file" + QString::number(i)); + QString key(identifier_ % "-recentfiles/file" % QString::number(i)); QString value(settings.value(key, QString()).toString()); insertFile(value); } @@ -165,7 +165,7 @@ void RecentFiles::saveFilesToSettings() QSettings settings; for (int i = 0 ; i < size_ && i < list_.count() ; ++ i) { - QString key(identifier_ + "-recentfiles/file" + QString::number(i + 1)); + QString key(identifier_ % "-recentfiles/file" % QString::number(i + 1)); settings.setValue(key, list_[i]); } } diff --git a/sources/titleblock/templatelogomanager.cpp b/sources/titleblock/templatelogomanager.cpp index 54493e481..56c11501f 100644 --- a/sources/titleblock/templatelogomanager.cpp +++ b/sources/titleblock/templatelogomanager.cpp @@ -312,7 +312,7 @@ void TitleBlockTemplateLogoManager::exportLogo() QString filepath = QFileDialog::getSaveFileName( this, tr("Choisir un fichier pour exporter ce logo"), - open_dialog_dir_.absolutePath() + "/" + current_logo, + open_dialog_dir_.absolutePath() % "/" % current_logo, tr("Tous les fichiers (*);;Images vectorielles (*.svg);;Images bitmap (*.png *.jpg *.jpeg *.gif *.bmp *.xpm)") ); if (filepath.isEmpty()) return; diff --git a/sources/titleblockproperties.cpp b/sources/titleblockproperties.cpp index c053b43c0..28e924a43 100644 --- a/sources/titleblockproperties.cpp +++ b/sources/titleblockproperties.cpp @@ -140,20 +140,20 @@ void TitleBlockProperties::fromXml(const QDomElement &e) { */ void TitleBlockProperties::toSettings(QSettings &settings, const QString &prefix) const { - settings.setValue(prefix + "title", title); - settings.setValue(prefix + "author", author); - settings.setValue(prefix + "filename", filename); - settings.setValue(prefix + "plant", plant); - settings.setValue(prefix + "locmach", locmach); - settings.setValue(prefix + "indexrev", indexrev); - settings.setValue(prefix + "version", version); - settings.setValue(prefix + "folio", folio); - settings.setValue(prefix + "auto_page_num", auto_page_num); - settings.setValue(prefix + "date", exportDate()); - settings.setValue(prefix + "displayAt", (display_at == Qt::BottomEdge? "bottom" : "right")); - settings.setValue(prefix + "titleblocktemplate", template_name.isEmpty()? QString() : template_name); - settings.setValue(prefix + "titleblocktemplateCollection", QET::qetCollectionToString(collection)); - context.toSettings(settings, prefix + "properties"); + settings.setValue(prefix % "title", title); + settings.setValue(prefix % "author", author); + settings.setValue(prefix % "filename", filename); + settings.setValue(prefix % "plant", plant); + settings.setValue(prefix % "locmach", locmach); + settings.setValue(prefix % "indexrev", indexrev); + settings.setValue(prefix % "version", version); + settings.setValue(prefix % "folio", folio); + settings.setValue(prefix % "auto_page_num", auto_page_num); + settings.setValue(prefix % "date", exportDate()); + settings.setValue(prefix % "displayAt", (display_at == Qt::BottomEdge? "bottom" : "right")); + settings.setValue(prefix % "titleblocktemplate", template_name.isEmpty()? QString() : template_name); + settings.setValue(prefix % "titleblocktemplateCollection", QET::qetCollectionToString(collection)); + context.toSettings(settings, prefix % "properties"); } /** @@ -162,20 +162,20 @@ void TitleBlockProperties::toSettings(QSettings &settings, const QString &prefix @param prefix prefixe a ajouter devant les noms des parametres */ void TitleBlockProperties::fromSettings(QSettings &settings, const QString &prefix) { - title = settings.value(prefix + "title").toString(); - author = settings.value(prefix + "author").toString(); - filename = settings.value(prefix + "filename").toString(); - plant = settings.value(prefix + "plant").toString(); - locmach = settings.value(prefix + "locmach").toString(); - indexrev = settings.value(prefix + "indexrev").toString(); - version = settings.value(prefix + "version").toString(); - folio = settings.value(prefix + "folio", "%id/%total").toString(); - auto_page_num = settings.value(prefix + "auto_page_num").toString(); - setDateFromString(settings.value(prefix + "date").toString()); - display_at = (settings.value(prefix + "displayAt", QVariant("bottom")).toString() == "bottom" ? Qt::BottomEdge : Qt::RightEdge); - template_name = settings.value(prefix + "titleblocktemplate").toString(); - collection = QET::qetCollectionFromString(settings.value(prefix + "titleblocktemplateCollection").toString()); - context.fromSettings(settings, prefix + "properties"); + title = settings.value(prefix % "title").toString(); + author = settings.value(prefix % "author").toString(); + filename = settings.value(prefix % "filename").toString(); + plant = settings.value(prefix % "plant").toString(); + locmach = settings.value(prefix % "locmach").toString(); + indexrev = settings.value(prefix % "indexrev").toString(); + version = settings.value(prefix % "version").toString(); + folio = settings.value(prefix % "folio", "%id/%total").toString(); + auto_page_num = settings.value(prefix % "auto_page_num").toString(); + setDateFromString(settings.value(prefix % "date").toString()); + display_at = (settings.value(prefix % "displayAt", QVariant("bottom")).toString() == "bottom" ? Qt::BottomEdge : Qt::RightEdge); + template_name = settings.value(prefix % "titleblocktemplate").toString(); + collection = QET::qetCollectionFromString(settings.value(prefix % "titleblocktemplateCollection").toString()); + context.fromSettings(settings, prefix % "properties"); } /** diff --git a/sources/titleblocktemplate.cpp b/sources/titleblocktemplate.cpp index b889e1e49..2fccc5481 100644 --- a/sources/titleblocktemplate.cpp +++ b/sources/titleblocktemplate.cpp @@ -1740,9 +1740,9 @@ QString TitleBlockTemplate::interpreteVariables( QString interpreted_string = string; foreach (QString key, diagram_context.keys(DiagramContext::DecreasingLength)) { - interpreted_string.replace("%{" + key + "}", + interpreted_string.replace("%{" % key % "}", diagram_context[key].toString()); - interpreted_string.replace("%" + key, + interpreted_string.replace("%" % key, diagram_context[key].toString()); } return(interpreted_string); diff --git a/sources/ui/bomexportdialog.cpp b/sources/ui/bomexportdialog.cpp index 0f7b4b74d..9935aed3d 100644 --- a/sources/ui/bomexportdialog.cpp +++ b/sources/ui/bomexportdialog.cpp @@ -65,7 +65,7 @@ int BOMExportDialog::exec() //save in csv file in same directory as project by default QString dir = m_project->currentDir(); if (dir.isEmpty()) dir = QETApp::documentDir(); - QString file_name = dir + "/" + tr("nomenclature_") + QString(m_project ->title() + ".csv"); + QString file_name = dir % "/" % tr("nomenclature_") % QString(m_project ->title() % ".csv"); QString file_path = QFileDialog::getSaveFileName(this, tr("Enregister sous... "), file_name, tr("Fichiers csv (*.csv)")); QFile file(file_path); if (!file_path.isEmpty()) @@ -132,7 +132,7 @@ QString BOMExportDialog::getBom() } } - return_string = header_name.join(";") + "\n"; + return_string = header_name.join(";") % "\n"; } //ROWS @@ -151,7 +151,7 @@ QString BOMExportDialog::getBom() ++i; } - return_string += values.join(";") + "\n"; + return_string += values.join(";") % "\n"; values.clear(); } } diff --git a/sources/ui/configpage/configpages.cpp b/sources/ui/configpage/configpages.cpp index 62f711209..09b48035f 100644 --- a/sources/ui/configpage/configpages.cpp +++ b/sources/ui/configpage/configpages.cpp @@ -339,9 +339,9 @@ void PrintConfigPage::applyConf() epw -> exportProperties().toSettings(settings, prefix); // annule l'enregistrement de certaines proprietes non pertinentes - settings.remove(prefix + "path"); - settings.remove(prefix + "format"); - settings.remove(prefix + "area"); + settings.remove(prefix % "path"); + settings.remove(prefix % "format"); + settings.remove(prefix % "area"); } /// @return l'icone de cette page