diff options
7 files changed, 26 insertions, 23 deletions
diff --git a/sources/shiboken6_generator/ApiExtractor/apiextractor.cpp b/sources/shiboken6_generator/ApiExtractor/apiextractor.cpp index 90f4f5dd9..1c398313b 100644 --- a/sources/shiboken6_generator/ApiExtractor/apiextractor.cpp +++ b/sources/shiboken6_generator/ApiExtractor/apiextractor.cpp @@ -613,8 +613,8 @@ ApiExtractorPrivate::addInstantiatedContainersAndSmartPointers(InstantiationColl if (type.hasTemplateChildren()) { const auto piece = isContainer ? "container"_L1 : "smart pointer"_L1; QString warning = - QString::fromLatin1("Skipping instantiation of %1 '%2' because it has template" - " arguments.").arg(piece, type.originalTypeDescription()); + "Skipping instantiation of %1 '%2' because it has template" + " arguments."_L1.arg(piece, type.originalTypeDescription()); if (!contextName.isEmpty()) warning.append(" Calling context: "_L1 + contextName); diff --git a/sources/shiboken6_generator/ApiExtractor/fileout.cpp b/sources/shiboken6_generator/ApiExtractor/fileout.cpp index 9bf33f94f..575f9bd7e 100644 --- a/sources/shiboken6_generator/ApiExtractor/fileout.cpp +++ b/sources/shiboken6_generator/ApiExtractor/fileout.cpp @@ -12,6 +12,8 @@ #include <cstdio> +using namespace Qt::StringLiterals; + bool FileOut::m_dryRun = false; bool FileOut::m_diff = false; @@ -175,8 +177,8 @@ FileOut::State FileOut::done() if (!FileOut::m_dryRun) { QDir dir(info.absolutePath()); if (!dir.mkpath(dir.absolutePath())) { - const QString message = QString::fromLatin1("Unable to create directory '%1'") - .arg(QDir::toNativeSeparators(dir.absolutePath())); + const QString message = "Unable to create directory '%1'"_L1 + .arg(QDir::toNativeSeparators(dir.absolutePath())); throw Exception(message); } diff --git a/sources/shiboken6_generator/ApiExtractor/messages.cpp b/sources/shiboken6_generator/ApiExtractor/messages.cpp index 54b0f1ee8..aee58c950 100644 --- a/sources/shiboken6_generator/ApiExtractor/messages.cpp +++ b/sources/shiboken6_generator/ApiExtractor/messages.cpp @@ -716,13 +716,13 @@ QString msgXpathDocModificationError(const DocModificationList& mods, QString msgCannotOpenForReading(const QFile &f) { - return QString::fromLatin1("Failed to open file '%1' for reading: %2") + return "Failed to open file '%1' for reading: %2"_L1 .arg(QDir::toNativeSeparators(f.fileName()), f.errorString()); } QString msgCannotOpenForWriting(const QFile &f) { - return QString::fromLatin1("Failed to open file '%1' for writing: %2") + return "Failed to open file '%1' for writing: %2"_L1 .arg(QDir::toNativeSeparators(f.fileName()), f.errorString()); } @@ -1022,7 +1022,7 @@ QString msgUnknownArrayPointerConversion(const QString &s) QString msgMissingProjectFileMarker(const QString &name, const QByteArray &startMarker) { return u"First line of project file \""_s + QDir::toNativeSeparators(name) - + u"\" must be the string \""_s + QString::fromLatin1(startMarker) + u"\"."_s; + + u"\" must be the string \""_s + QLatin1StringView(startMarker) + u"\"."_s; } QString msgInvalidLanguageLevel(const QString &l) diff --git a/sources/shiboken6_generator/ApiExtractor/typesystemparser.cpp b/sources/shiboken6_generator/ApiExtractor/typesystemparser.cpp index 9a8611589..a4dfe5e6c 100644 --- a/sources/shiboken6_generator/ApiExtractor/typesystemparser.cpp +++ b/sources/shiboken6_generator/ApiExtractor/typesystemparser.cpp @@ -1179,10 +1179,10 @@ bool TypeSystemParser::importFileElement(const QXmlStreamAttributes &atts) } } if (!foundFromOk || !foundToOk) { - QString fromError = QString::fromLatin1("Could not find quote-after-line='%1' in file '%2'.") - .arg(quoteFrom.toString(), fileName); - QString toError = QString::fromLatin1("Could not find quote-before-line='%1' in file '%2'.") - .arg(quoteTo.toString(), fileName); + QString fromError = "Could not find quote-after-line='%1' in file '%2'."_L1 + .arg(quoteFrom.toString(), fileName); + QString toError = "Could not find quote-before-line='%1' in file '%2'."_L1 + .arg(quoteTo.toString(), fileName); if (!foundToOk) m_error = toError; @@ -2487,7 +2487,7 @@ static bool parseIndex(const QString &index, int *result, QString *errorMessage) bool ok = false; *result = index.toInt(&ok); if (!ok) - *errorMessage = QString::fromLatin1("Cannot convert '%1' to integer").arg(index); + *errorMessage = "Cannot convert '%1' to integer"_L1.arg(index); return ok; } @@ -2699,8 +2699,8 @@ bool TypeSystemParser::parseAddFunction(const ConditionalStreamReader &, || topElement == StackElement::Root || topElement == StackElement::ContainerTypeEntry; if (!validParent) { - m_error = QString::fromLatin1("Add/Declare function requires a complex/container type or a root tag as parent" - ", was=%1").arg(tagFromElement(topElement)); + m_error = "Add/Declare function requires a complex/container type or a root tag as parent, was=%1"_L1 + + tagFromElement(topElement); return false; } @@ -2831,8 +2831,8 @@ bool TypeSystemParser::parseProperty(const ConditionalStreamReader &, StackEleme QXmlStreamAttributes *attributes) { if (!isComplexTypeEntry(topElement)) { - m_error = QString::fromLatin1("Add property requires a complex type as parent" - ", was=%1").arg(tagFromElement(topElement)); + m_error = "Add property requires a complex type as parent, was=%1"_L1 + + tagFromElement(topElement); return false; } @@ -2930,8 +2930,8 @@ bool TypeSystemParser::parseModifyFunction(const ConditionalStreamReader &reader || topElement == StackElement::TypedefTypeEntry || topElement == StackElement::FunctionTypeEntry; if (!validParent) { - m_error = QString::fromLatin1("Modify function requires complex type as parent" - ", was=%1").arg(tagFromElement(topElement)); + m_error = "Modify function requires complex type as parent, was=%1"_L1 + + tagFromElement(topElement); return false; } diff --git a/sources/shiboken6_generator/generator/generator.cpp b/sources/shiboken6_generator/generator/generator.cpp index 7e37a1924..314cee227 100644 --- a/sources/shiboken6_generator/generator/generator.cpp +++ b/sources/shiboken6_generator/generator/generator.cpp @@ -366,7 +366,7 @@ QString Generator::getFullTypeName(const AbstractMetaType &type) typeName = getFullTypeNameWithoutModifiers(type); else typeName = getFullTypeName(type.typeEntry()); - return typeName + QString::fromLatin1("*").repeated(type.indirections()); + return typeName + QString(type.indirections(), u'*'); } QString Generator::getFullTypeName(const AbstractMetaClassCPtr &metaClass) diff --git a/sources/shiboken6_generator/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken6_generator/generator/qtdoc/qtdocgenerator.cpp index 9a1a28ef2..574f8de6f 100644 --- a/sources/shiboken6_generator/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken6_generator/generator/qtdoc/qtdocgenerator.cpp @@ -964,8 +964,8 @@ QString QtDocGenerator::translateToPythonType(const AbstractMetaType &type, strType.remove(u"QHash"_s); strType.remove(u"QMap"_s); QStringList types = strType.split(u','); - strType = QString::fromLatin1("Dictionary with keys of type %1 and values of type %2.") - .arg(types[0], types[1]); + strType = "Dictionary with keys of type %1 and values of type %2."_L1 + .arg(types[0], types[1]); } return strType; } diff --git a/sources/shiboken6_generator/generator/shiboken/shibokengenerator.cpp b/sources/shiboken6_generator/generator/shiboken/shibokengenerator.cpp index 8e45d000b..f6ea09b0d 100644 --- a/sources/shiboken6_generator/generator/shiboken/shibokengenerator.cpp +++ b/sources/shiboken6_generator/generator/shiboken/shibokengenerator.cpp @@ -988,8 +988,9 @@ QString ShibokenGenerator::cpythonIsConvertibleFunction(const TypeEntryCPtr &typ result += u"("_s + cpythonTypeNameExt(type) + u", "_s; return result; } - return QString::fromLatin1("Shiboken::Conversions::isPythonToCppConvertible(%1, ") - .arg(converterObject(type)); + + return "Shiboken::Conversions::isPythonToCppConvertible("_L1 + + converterObject(type) + ", "_L1; } QString ShibokenGenerator::cpythonIsConvertibleFunction(const AbstractMetaType &metaType) |
