Refactoring.

This commit is contained in:
Roman Telezhynskyi 2023-10-13 15:26:19 +03:00
parent bf58addbe3
commit bc6b9468b7
9 changed files with 23 additions and 11 deletions

View File

@ -87,7 +87,7 @@ DialogSaveManualLayout::DialogSaveManualLayout(vsizetype count, bool consoleExpo
ui->lineEditFileName->setValidator(new QRegularExpressionValidator(QRegularExpression(*baseFilenameRegExp), this)); ui->lineEditFileName->setValidator(new QRegularExpressionValidator(QRegularExpression(*baseFilenameRegExp), this));
const QString mask = m_count > 1 ? fileName + '_' : fileName; const QString mask = m_count > 1 ? fileName + '_'_L1 : fileName;
if (not m_consoleExport) if (not m_consoleExport)
{ {
ui->lineEditFileName->setText(mask); ui->lineEditFileName->setText(mask);

View File

@ -42,6 +42,12 @@
#include <QPainter> #include <QPainter>
#include <QPainterPath> #include <QPainterPath>
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
#include "../vmisc/compatibility.h"
#endif
using namespace Qt::Literals::StringLiterals;
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes")
QT_WARNING_DISABLE_INTEL(1418) QT_WARNING_DISABLE_INTEL(1418)
@ -170,7 +176,7 @@ auto VPPiece::GetUniqueID() const -> QString
if (m_copyNumber > 1) if (m_copyNumber > 1)
{ {
id = id + '_' + QString::number(m_copyNumber); id = id + '_'_L1 + QString::number(m_copyNumber);
} }
return id; return id;

View File

@ -1593,7 +1593,7 @@ void DialogIncrements::SaveIncrName(const QString &text)
QString name = newName; QString name = newName;
do do
{ {
name = name + '_' + QString::number(num); name = name + '_'_L1 + QString::number(num);
num++; num++;
} while (not m_data->IsUnique(name)); } while (not m_data->IsUnique(name));
newName = name; newName = name;

View File

@ -92,7 +92,7 @@ DialogSaveLayout::DialogSaveLayout(int count, Draw mode, const QString &fileName
ui->lineEditFileName->setValidator(new QRegularExpressionValidator(QRegularExpression(*baseFilenameRegExp), this)); ui->lineEditFileName->setValidator(new QRegularExpressionValidator(QRegularExpression(*baseFilenameRegExp), this));
const QString mask = fileName + '_'; const QString mask = fileName + '_'_L1;
if (VApplication::IsGUIMode()) if (VApplication::IsGUIMode())
{ {
ui->lineEditFileName->setText(mask); ui->lineEditFileName->setText(mask);

View File

@ -60,6 +60,12 @@
#include "../vmisc/def.h" #include "../vmisc/def.h"
#include "dxiface.h" #include "dxiface.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
#include "../vmisc/compatibility.h"
#endif
using namespace Qt::Literals::StringLiterals;
namespace namespace
{ {
const qreal AAMATextHeight = 2.5; const qreal AAMATextHeight = 2.5;
@ -726,7 +732,7 @@ auto VDxfEngine::ExportToAAMA(const QVector<VLayoutPiece> &details) -> bool
QString blockName = detail.GetName(); QString blockName = detail.GetName();
if (m_version <= DRW::AC1009) if (m_version <= DRW::AC1009)
{ {
blockName.replace(' ', '_'); blockName.replace(' '_L1, '_'_L1);
} }
detailBlock->name = blockName.toStdString(); detailBlock->name = blockName.toStdString();
@ -958,7 +964,7 @@ auto VDxfEngine::ExportToASTM(const QVector<VLayoutPiece> &details) -> bool
QString blockName = detail.GetName(); QString blockName = detail.GetName();
if (m_version <= DRW::AC1009) if (m_version <= DRW::AC1009)
{ {
blockName.replace(' ', '_'); blockName.replace(' '_L1, '_'_L1);
} }
detailBlock->name = blockName.toStdString(); detailBlock->name = blockName.toStdString();

View File

@ -346,5 +346,5 @@ void VAbstractCubicBezierPath::CreateAlias()
return; return;
} }
SetAlias(splPath + '_' + aliasSuffix); SetAlias(splPath + '_'_L1 + aliasSuffix);
} }

View File

@ -711,7 +711,7 @@ auto VLayoutPiece::GetUniqueID() const -> QString
if (not d->m_gradationId.isEmpty()) if (not d->m_gradationId.isEmpty())
{ {
id = id + '_' + d->m_gradationId; id = id + '_'_L1 + d->m_gradationId;
} }
return id; return id;

View File

@ -103,8 +103,8 @@ void InitLanguageList(QComboBox *combobox)
for (auto locale : fileNames) for (auto locale : fileNames)
{ {
// get locale extracted by filename "valentina_de_De.qm" // get locale extracted by filename "valentina_de_De.qm"
locale.truncate(locale.lastIndexOf('.')); // "valentina_de_De" locale.truncate(locale.lastIndexOf('.'_L1)); // "valentina_de_De"
locale.remove(0, locale.indexOf('_') + 1); // "de_De" locale.remove(0, locale.indexOf('_'_L1) + 1); // "de_De"
if (locale.startsWith("ru"_L1)) if (locale.startsWith("ru"_L1))
{ {

View File

@ -328,7 +328,7 @@ void VAbstractApplication::LoadTranslation(QString locale)
installTranslator(appTranslator); installTranslator(appTranslator);
pmsTranslator = new QTranslator(this); pmsTranslator = new QTranslator(this);
LoadQM(pmsTranslator, QStringLiteral("measurements_") + Settings()->GetPMSystemCode() + '_', locale, appQmDir); LoadQM(pmsTranslator, QStringLiteral("measurements_") + Settings()->GetPMSystemCode() + '_'_L1, locale, appQmDir);
installTranslator(pmsTranslator); installTranslator(pmsTranslator);
InitTrVars(); // Very important do it after load QM files. InitTrVars(); // Very important do it after load QM files.