More cases for string literals.

This commit is contained in:
Roman Telezhynskyi 2023-10-18 15:23:55 +03:00
parent 59b42849cf
commit df51f1a873
6 changed files with 19 additions and 8 deletions

View File

@ -30,7 +30,6 @@
#define VPATTERN_H
#include "../ifc/xml/vabstractpattern.h"
#include "../ifc/xml/vtoolrecord.h"
#include "../vpatterndb/vcontainer.h"
#include "../ifc/xml/vpatternconverter.h"

View File

@ -42,6 +42,8 @@
#include "../vmisc/compatibility.h"
using namespace Qt::Literals::StringLiterals;
//---------------------------------------------------------------------------------------------------------------------
auto IsMimeTypeImage(const QMimeType &mime) -> bool
{
@ -108,10 +110,10 @@ auto PrepareImageFilters() -> QString
if (not sufixes.isEmpty())
{
filters.append(QObject::tr("Images") + QStringLiteral(" (%1)").arg(sufixes.join(' ')));
filters.append(QObject::tr("Images") + " (%1)"_L1.arg(sufixes.join(' '_L1)));
}
filters.append(QObject::tr("All files") + QStringLiteral(" (*.*)"));
filters.append(QObject::tr("All files") + " (*.*)"_L1);
return filters.join(QStringLiteral(";;"));
return filters.join(";;"_L1);
}

View File

@ -2476,7 +2476,7 @@ void VAbstractPattern::SetGroupTags(quint32 id, const QStringList &tags)
QDomElement group = elementById(id, TagGroup);
if (group.isElement())
{
SetAttributeOrRemoveIf<QString>(group, AttrTags, tags.join(','),
SetAttributeOrRemoveIf<QString>(group, AttrTags, tags.join(','_L1),
[](const QString &rawTags) noexcept { return rawTags.isEmpty(); });
modified = true;
emit patternChanged(false);

View File

@ -45,6 +45,8 @@
#include <ciso646> // and, not, or
#endif
using namespace Qt::Literals::StringLiterals;
const QString VBackgroundPatternImage::brokenImage = QStringLiteral("://icon/svg/broken_path.svg");
namespace
@ -100,7 +102,7 @@ auto VBackgroundPatternImage::FromFile(const QString &fileName, bool builtIn) ->
return {};
}
QString base64 = SplitString(QString::fromLatin1(file.readAll().toBase64().data())).join('\n');
QString base64 = SplitString(QString::fromLatin1(file.readAll().toBase64().data())).join('\n'_L1);
image.SetContentData(base64.toLatin1(), mime.name());
}
else

View File

@ -47,6 +47,8 @@
#include "../vmisc/compatibility.h"
#include "utils.h"
using namespace Qt::Literals::StringLiterals;
//---------------------------------------------------------------------------------------------------------------------
auto VPatternImage::FromFile(const QString &fileName) -> VPatternImage
{
@ -66,7 +68,7 @@ auto VPatternImage::FromFile(const QString &fileName) -> VPatternImage
return {};
}
QString base64 = SplitString(QString::fromLatin1(file.readAll().toBase64().data())).join('\n');
QString base64 = SplitString(QString::fromLatin1(file.readAll().toBase64().data())).join('\n'_L1);
image.SetContentData(base64.toLatin1(), mime.name());
return image;

View File

@ -36,6 +36,12 @@
#include "vmeasurement_p.h"
#include "vvariable.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
#include "../vmisc/compatibility.h"
#endif
using namespace Qt::Literals::StringLiterals;
//---------------------------------------------------------------------------------------------------------------------
VMeasurement::VMeasurement(quint32 index, const QString &name)
: VVariable(name),
@ -123,7 +129,7 @@ auto VMeasurement::CorrectionHash(qreal baseA, qreal baseB, qreal baseC) -> QStr
{
hashBlocks.append(QString::number(baseC));
}
return hashBlocks.join(';');
return hashBlocks.join(';'_L1);
}
//---------------------------------------------------------------------------------------------------------------------