diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 98b5ddd0e..b65ae28d6 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -1635,11 +1635,11 @@ QDomElement VAbstractPattern::CheckTagExists(const QString &tag) element = createElement(TagGradation); QDomElement heights = createElement(TagHeights); - heights.setAttribute(AttrAll, QLatin1String("true")); + heights.setAttribute(AttrAll, trueStr); element.appendChild(heights); QDomElement sizes = createElement(TagSizes); - sizes.setAttribute(AttrAll, QLatin1String("true")); + sizes.setAttribute(AttrAll, trueStr); element.appendChild(sizes); break; } diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index 58daef214..01c559297 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -376,10 +376,7 @@ bool VDomDocument::GetParametrBool(const QDomElement &domElement, const QString { parametr = GetParametrString(domElement, name, defValue); - const QStringList bools = QStringList() << QLatin1String("true") - << QLatin1String("false") - << QChar('1') - << QChar('0'); + const QStringList bools {trueStr, falseStr, QChar('1'), QChar('0')}; switch (bools.indexOf(parametr)) { case 0: // true diff --git a/src/libs/ifc/xml/vvitconverter.cpp b/src/libs/ifc/xml/vvitconverter.cpp index f1281ff99..86b6de043 100644 --- a/src/libs/ifc/xml/vvitconverter.cpp +++ b/src/libs/ifc/xml/vvitconverter.cpp @@ -167,7 +167,7 @@ void VVITConverter::AddNewTagsForV0_3_0() QDomNode refChild = rootElement.firstChildElement("version"); QDomElement ro = createElement(QStringLiteral("read-only")); - const QDomText roNodeText = createTextNode("false"); + const QDomText roNodeText = createTextNode(falseStr); ro.appendChild(roNodeText); refChild = rootElement.insertAfter(ro, refChild); diff --git a/src/libs/ifc/xml/vvstconverter.cpp b/src/libs/ifc/xml/vvstconverter.cpp index c84978e90..0830d9721 100644 --- a/src/libs/ifc/xml/vvstconverter.cpp +++ b/src/libs/ifc/xml/vvstconverter.cpp @@ -162,7 +162,7 @@ void VVSTConverter::AddNewTagsForV0_4_0() { QDomElement ro = createElement(QStringLiteral("read-only")); - const QDomText roNodeText = createTextNode("false"); + const QDomText roNodeText = createTextNode(falseStr); ro.appendChild(roNodeText); refChild = rootElement.insertAfter(ro, refChild); } diff --git a/src/libs/vformat/vmeasurements.cpp b/src/libs/vformat/vmeasurements.cpp index 67a591530..a9764111d 100644 --- a/src/libs/vformat/vmeasurements.cpp +++ b/src/libs/vformat/vmeasurements.cpp @@ -695,7 +695,7 @@ void VMeasurements::CreateEmptyMultisizeFile(Unit unit, int baseSize, int baseHe mElement.appendChild(version); QDomElement ro = createElement(TagReadOnly); - const QDomText roNodeText = createTextNode("false"); + const QDomText roNodeText = createTextNode(falseStr); ro.appendChild(roNodeText); mElement.appendChild(ro); @@ -738,7 +738,7 @@ void VMeasurements::CreateEmptyIndividualFile(Unit unit) mElement.appendChild(version); QDomElement ro = createElement(TagReadOnly); - const QDomText roNodeText = createTextNode("false"); + const QDomText roNodeText = createTextNode(falseStr); ro.appendChild(roNodeText); mElement.appendChild(ro); diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index fca70e13c..e3f0f906f 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -197,12 +197,6 @@ const QStringList labelTemplatePlaceholders = QStringList() << pl_size const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png"); const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png"); -// From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This -// furthermore blows up the binary sizes. -const QString degreeSymbol = QStringLiteral("°"); -const QString trueStr = QStringLiteral("true"); -const QString falseStr = QStringLiteral("false"); - const QString unitMM = QStringLiteral("mm"); const QString unitCM = QStringLiteral("cm"); const QString unitINCH = QStringLiteral("inch"); diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 3fd67259b..de776aa89 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -397,10 +397,6 @@ extern const QStringList labelTemplatePlaceholders; extern const QString cursorArrowOpenHand; extern const QString cursorArrowCloseHand; -extern const QString degreeSymbol; -extern const QString trueStr; -extern const QString falseStr; - extern const QString strOne; extern const QString strTwo; extern const QString strThree; diff --git a/src/libs/vmisc/literals.cpp b/src/libs/vmisc/literals.cpp index 6f2917abd..1de623558 100644 --- a/src/libs/vmisc/literals.cpp +++ b/src/libs/vmisc/literals.cpp @@ -31,3 +31,6 @@ const QString LONG_OPTION_NO_HDPI_SCALING = QStringLiteral("no-scaling"); const QString editDeleteIcon = QStringLiteral("edit-delete"); const QString preferencesOtherIcon = QStringLiteral("preferences-other"); +const QString degreeSymbol = QStringLiteral("°"); +const QString trueStr = QStringLiteral("true"); +const QString falseStr = QStringLiteral("false"); diff --git a/src/libs/vmisc/literals.h b/src/libs/vmisc/literals.h index b21ad0679..3c3b57dfc 100644 --- a/src/libs/vmisc/literals.h +++ b/src/libs/vmisc/literals.h @@ -30,9 +30,15 @@ #include +// From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This +// furthermore blows up the binary sizes. + extern const QString LONG_OPTION_NO_HDPI_SCALING; extern const QString editDeleteIcon; extern const QString preferencesOtherIcon; +extern const QString degreeSymbol; +extern const QString trueStr; +extern const QString falseStr; #endif // LITERALS_H