mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
use "%" for string-concatenation
Qt-Docs says it's less memory-usage...
This commit is contained in:
parent
3a8e6b16f5
commit
ad29893842
@ -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";
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
|
@ -67,7 +67,7 @@ QString FileElementCollectionItem::fileSystemPath() const
|
||||
FileElementCollectionItem *feci =
|
||||
static_cast<FileElementCollectionItem *> (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();
|
||||
|
@ -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));
|
||||
|
@ -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();
|
||||
|
@ -419,7 +419,7 @@ void SearchAndReplaceWidget::search()
|
||||
else
|
||||
{
|
||||
//entire word
|
||||
QRegularExpression rx("\\b" + str + "\\b");
|
||||
QRegularExpression rx("\\b" % str % "\\b");
|
||||
if (!rx.isValid())
|
||||
{
|
||||
qWarning() <<QObject::tr("this is an error in the code")
|
||||
|
@ -41,7 +41,7 @@ AddTerminalToStripCommand::AddTerminalToStripCommand(QSharedPointer<RealTerminal
|
||||
const auto str_2 = ts_name.isEmpty() ? QObject::tr("à un groupe de bornes") :
|
||||
QObject::tr("au groupe de bornes %1").arg(ts_name);
|
||||
|
||||
setText(str_1 + " " + str_2);
|
||||
setText(str_1 % " " % str_2);
|
||||
}
|
||||
|
||||
AddTerminalToStripCommand::AddTerminalToStripCommand(QVector<QSharedPointer<RealTerminal>> terminals, TerminalStrip *strip, QUndoCommand *parent) :
|
||||
@ -57,7 +57,7 @@ AddTerminalToStripCommand::AddTerminalToStripCommand(QVector<QSharedPointer<Real
|
||||
const auto str_2 = ts_name.isEmpty() ? QObject::tr("à un groupe de bornes") :
|
||||
QObject::tr("au groupe de bornes %1").arg(ts_name);
|
||||
|
||||
setText(str_1 + " " + str_2);
|
||||
setText(str_1 % " " % str_2);
|
||||
}
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ void RemoveTerminalFromStripCommand::setCommandTitle()
|
||||
|
||||
const auto str_2 = strip_name.isEmpty() ? QObject::tr("d'un groupe de bornes") :
|
||||
QObject::tr("du groupe de bornes %1").arg(strip_name);
|
||||
setText(str_1 + " " + str_2);
|
||||
setText(str_1 % " " % str_2);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -178,7 +178,7 @@ MoveTerminalCommand::MoveTerminalCommand(QSharedPointer<PhysicalTerminal> 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<QSharedPointer<PhysicalTerminal>> terminals, TerminalStrip *old_strip,
|
||||
@ -201,7 +201,7 @@ MoveTerminalCommand::MoveTerminalCommand(QVector<QSharedPointer<PhysicalTerminal
|
||||
const 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);
|
||||
}
|
||||
|
||||
void MoveTerminalCommand::undo()
|
||||
|
@ -177,7 +177,7 @@ void AutoNumberingManagementW::on_m_to_folios_cb_currentIndexChanged(int index)
|
||||
QString from = ui->m_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);
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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; i<m_hash.value(key) ; ++i) {
|
||||
csv.append(key + "\n");
|
||||
csv.append(key % "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -549,7 +549,7 @@ void projectDataBase::prepareQuery()
|
||||
//UPDATE DIAGRAM INFO
|
||||
QString update_diagram_str("UPDATE diagram_info SET ");
|
||||
for (auto str : QETInformation::diagramInfoKeys()) {
|
||||
update_diagram_str.append(str + " = :" + str + ", ");
|
||||
update_diagram_str.append(str % " = :" % str % ", ");
|
||||
}
|
||||
update_diagram_str.remove(update_diagram_str.length()-2, 2); //Remove the last ", "
|
||||
update_diagram_str.append(" WHERE diagram_uuid = :uuid");
|
||||
@ -589,7 +589,7 @@ void projectDataBase::prepareQuery()
|
||||
//UPDATE ELEMENT INFO
|
||||
QString update_str("UPDATE element_info SET ");
|
||||
for (auto string : QETInformation::elementInfoKeys()) {
|
||||
update_str.append(string + " = :" + string + ", ");
|
||||
update_str.append(string % " = :" % string % ", ");
|
||||
}
|
||||
update_str.remove(update_str.length()-2, 2); //Remove the last ", "
|
||||
update_str.append(" WHERE element_uuid = :uuid");
|
||||
@ -678,7 +678,7 @@ void projectDataBase::exportDb(projectDataBase *db,
|
||||
if(dir_.isEmpty()) {
|
||||
dir_ = db->project()->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
|
||||
{
|
||||
|
@ -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<int, QString> 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))
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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()));
|
||||
|
@ -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!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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<Qt::Alignment>();
|
||||
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<Qt::Alignment>();
|
||||
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;
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user