diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-02-05 15:34:44 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-02-06 09:35:24 +0000 |
commit | e186166f292fbaf8fa8af3fbffdf4f08e9cb7009 (patch) | |
tree | f187a623794e0849f8ec7aabf5c3a50ac7155674 /sources | |
parent | 81f128c5f09a7cae9e549458bcf23943b0b9a351 (diff) |
Replace QString::null/isNull() by QString()/isEmpty()
Fix warnings appearing in Qt 5.13:
sources/shiboken2/generator/shiboken2/shibokengenerator.cpp:873:25: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations]
sources/shiboken2/generator/shiboken2/shibokengenerator.cpp:873:25: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations]
sources/shiboken2/generator/shiboken2/shibokengenerator.cpp:880:25: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations]
sources/shiboken2/generator/shiboken2/shibokengenerator.cpp:880:25: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations]
sources/shiboken2/generator/shiboken2/cppgenerator.cpp:5060:34: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations]
sources/shiboken2/generator/shiboken2/cppgenerator.cpp:5060:34: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations]
Change-Id: I7c938df64babf824b58bf5c785b281a88d5111db
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources')
6 files changed, 13 insertions, 13 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp index c3063aaa1..73f1bf621 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp @@ -156,7 +156,7 @@ static QString lastNameSegment(QString name) QString AbstractMetaType::name() const { - if (m_name.isNull()) + if (m_name.isEmpty()) m_name = lastNameSegment(m_typeEntry->targetLangName()); return m_name; } diff --git a/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp b/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp index b1b171bae..59b601f3b 100644 --- a/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp +++ b/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp @@ -111,7 +111,7 @@ namespace Namespace { AbstractMetaClass* classB = AbstractMetaClass::findClass(classes, QLatin1String("B")); QVERIFY(classB); QVERIFY(!classB->baseClass()); - QVERIFY(classB->baseClassName().isNull()); + QVERIFY(classB->baseClassName().isEmpty()); const AbstractMetaFunction* func = classB->findFunction(QLatin1String("foo")); AbstractMetaType* argType = func->arguments().first()->type(); QCOMPARE(argType->instantiations().count(), 1); @@ -300,7 +300,7 @@ template<SomeEnum type> struct Future {}; AbstractMetaClass* classB = AbstractMetaClass::findClass(classes, QLatin1String("B")); QVERIFY(classB); QVERIFY(!classB->baseClass()); - QVERIFY(classB->baseClassName().isNull()); + QVERIFY(classB->baseClassName().isEmpty()); // 3 functions: simple constructor, copy constructor and "method()". QCOMPARE(classB->functions().count(), 3); } @@ -338,7 +338,7 @@ template<SomeEnum type> struct Future {}; AbstractMetaClass* classB = AbstractMetaClass::findClass(classes, QLatin1String("Namespace::B")); QVERIFY(classB); QVERIFY(!classB->baseClass()); - QVERIFY(classB->baseClassName().isNull()); + QVERIFY(classB->baseClassName().isEmpty()); // 3 functions: simple constructor, copy constructor and "method()". QCOMPARE(classB->functions().count(), 3); } diff --git a/sources/shiboken2/generator/main.cpp b/sources/shiboken2/generator/main.cpp index c5bcb766d..9cdc77ca7 100644 --- a/sources/shiboken2/generator/main.cpp +++ b/sources/shiboken2/generator/main.cpp @@ -171,7 +171,7 @@ static CommandArgumentMap getInitializedArguments() } } - if (projectFileName.isNull()) + if (projectFileName.isEmpty()) return args; if (!QFile::exists(projectFileName)) { diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp index b8ef2b052..c194c0ea4 100644 --- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp @@ -756,11 +756,11 @@ void QtXmlToSphinx::handleSnippetTag(QXmlStreamReader& reader) // Fall back to C++ snippet when "path" attribute is present. // Also read fallback snippet when comparison is desired. QString fallbackCode; - if ((pythonCode.isNull() || snippetComparison()) + if ((pythonCode.isEmpty() || snippetComparison()) && reader.attributes().hasAttribute(fallbackPathAttribute())) { const QString fallback = reader.attributes().value(fallbackPathAttribute()).toString(); if (QFileInfo::exists(fallback)) { - if (pythonCode.isNull()) + if (pythonCode.isEmpty()) qCWarning(lcShiboken, "%s", qPrintable(msgFallbackWarning(reader, m_context, m_lastTagName, location, identifier, fallback))); fallbackCode = readFromLocation(fallback, identifier, &errorMessage); if (!errorMessage.isEmpty()) @@ -775,7 +775,7 @@ void QtXmlToSphinx::handleSnippetTag(QXmlStreamReader& reader) m_output << INDENT << "::\n\n"; Indentation indentation(INDENT); - const QString code = pythonCode.isNull() ? fallbackCode : pythonCode; + const QString code = pythonCode.isEmpty() ? fallbackCode : pythonCode; if (code.isEmpty()) m_output << INDENT << "<Code snippet \"" << location << ':' << identifier << "\" not found>" << endl; else diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 0ca0b8d04..20030bcdf 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -5067,7 +5067,7 @@ void CppGenerator::writeClassRegister(QTextStream &s, for (AbstractMetaClass *innerClass : innerClasses) lookForEnumsInClassesNotToBeGenerated(classEnums, innerClass); - ErrorCode errorCode(QString::null); + ErrorCode errorCode(QString::fromLatin1("")); writeEnumsInitialization(s, classEnums); if (metaClass->hasSignals()) diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp index a226f2c00..ca5dab54e 100644 --- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp @@ -870,14 +870,14 @@ QString ShibokenGenerator::converterObject(const TypeEntry* type) if (type->isArray()) { qDebug() << "Warning: no idea how to handle the Qt5 type " << type->qualifiedCppName(); - return QString::null; + return QString(); } /* the typedef'd primitive types case */ const PrimitiveTypeEntry* pte = dynamic_cast<const PrimitiveTypeEntry*>(type); if (!pte) { qDebug() << "Warning: the Qt5 primitive type is unknown" << type->qualifiedCppName(); - return QString::null; + return QString(); } if (pte->basicReferencedTypeEntry()) pte = pte->basicReferencedTypeEntry(); @@ -1457,7 +1457,7 @@ void ShibokenGenerator::writeFunctionArguments(QTextStream &s, QString ShibokenGenerator::functionReturnType(const AbstractMetaFunction* func, Options options) const { QString modifiedReturnType = QString(func->typeReplaced(0)); - if (!modifiedReturnType.isNull() && !(options & OriginalTypeDescription)) + if (!modifiedReturnType.isEmpty() && !(options & OriginalTypeDescription)) return modifiedReturnType; return translateType(func->type(), func->implementingClass(), options); } @@ -1821,7 +1821,7 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s, if (func->isVirtual() && !func->isAbstract() && (!avoidProtectedHack() || !func->isProtected())) { QString methodCallArgs = getArgumentsFromMethodCall(code); - if (!methodCallArgs.isNull()) { + if (!methodCallArgs.isEmpty()) { const QString pattern = QStringLiteral("%CPPSELF.%FUNCTION_NAME(%1)").arg(methodCallArgs); if (func->name() == QLatin1String("metaObject")) { QString wrapperClassName = wrapperName(func->ownerClass()); |