diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,8 +82,7 @@ -DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_NO_URL_CAST_FROM_STRING -DQT_STRICT_ITERATORS - -DQT_USE_FAST_CONCATENATION - -DQT_USE_FAST_OPERATOR_PLUS + -DQT_USE_QSTRINGBUILDER ) function(add_compile_flag_if_supported _flag) diff --git a/kdevplatform/documentation/standarddocumentationview.cpp b/kdevplatform/documentation/standarddocumentationview.cpp --- a/kdevplatform/documentation/standarddocumentationview.cpp +++ b/kdevplatform/documentation/standarddocumentationview.cpp @@ -256,13 +256,13 @@ #ifdef USE_QTWEBKIT d->m_view->settings()->setUserStyleSheetUrl(url); #else - d->m_view->page()->runJavaScript( + d->m_view->page()->runJavaScript(QLatin1String( "var link = document.createElement( 'link' );" - "link.href = '" + url.toString().toUtf8() + "';" + "link.href = '") + url.toString() + QLatin1String("';" "link.type = 'text/css';" "link.rel = 'stylesheet';" "link.media = 'screen,print';" - "document.getElementsByTagName( 'head' )[0].appendChild( link );" + "document.getElementsByTagName( 'head' )[0].appendChild( link );") ); #endif } diff --git a/kdevplatform/plugins/projectfilter/tests/test_projectfilter.cpp b/kdevplatform/plugins/projectfilter/tests/test_projectfilter.cpp --- a/kdevplatform/plugins/projectfilter/tests/test_projectfilter.cpp +++ b/kdevplatform/plugins/projectfilter/tests/test_projectfilter.cpp @@ -384,14 +384,14 @@ { TestFilter filter(new ProjectFilter(&project, Filters())); foreach(const QVector& data, dataSets) { - QTest::newRow(qstrdup(QByteArray("baseline-") + QByteArray::number(data.size()))) << filter << data; + QTest::newRow(QByteArray("baseline-" + QByteArray::number(data.size()))) << filter << data; } } { TestFilter filter(new ProjectFilter(&project, deserialize(defaultFilters()))); foreach(const QVector& data, dataSets) { - QTest::newRow(qstrdup(QByteArray("defaults-") + QByteArray::number(data.size()))) << filter << data; + QTest::newRow(QByteArray("defaults-" + QByteArray::number(data.size()))) << filter << data; } } } diff --git a/languages/clang/duchain/parsesession.cpp b/languages/clang/duchain/parsesession.cpp --- a/languages/clang/duchain/parsesession.cpp +++ b/languages/clang/duchain/parsesession.cpp @@ -246,7 +246,7 @@ if (!wrappedQtHeaders.isEmpty()) { smartArgs << wrappedQtHeaders; clangArguments << "-isystem" << wrappedQtHeaders.constData(); - const auto qtCore = wrappedQtHeaders + "/QtCore"; + const QByteArray qtCore = wrappedQtHeaders + "/QtCore"; smartArgs << qtCore; clangArguments << "-isystem" << qtCore.constData(); } @@ -303,7 +303,7 @@ m_environment = environment; if (options.testFlag(PrecompiledHeader)) { - clang_saveTranslationUnit(m_unit, (tuUrl.byteArray() + ".pch").constData(), CXSaveTranslationUnit_None); + clang_saveTranslationUnit(m_unit, QByteArray(tuUrl.byteArray() + ".pch").constData(), CXSaveTranslationUnit_None); } } else { qCWarning(KDEV_CLANG) << "Failed to parse translation unit:" << tuUrl; diff --git a/languages/clang/tests/test_duchain.cpp b/languages/clang/tests/test_duchain.cpp --- a/languages/clang/tests/test_duchain.cpp +++ b/languages/clang/tests/test_duchain.cpp @@ -234,7 +234,7 @@ TestFile header(QStringLiteral("int foo() { return 42; }\n"), QStringLiteral("h")); // NOTE: header is _not_ explicitly being parsed, instead the impl job does that - TestFile impl("#include \"" + header.url().byteArray() + "\"\n" + TestFile impl("#include \"" + header.url().str() + "\"\n" "int main() { return foo(); }", QStringLiteral("cpp"), &header); impl.parse(TopDUContext::AllDeclarationsContextsAndUses); @@ -283,7 +283,7 @@ // header, or similar. TestFile header(code, QStringLiteral("h")); - TestFile impl("#include \"" + header.url().byteArray() + "\"\n", QStringLiteral("cpp"), &header); + TestFile impl("#include \"" + header.url().str() + "\"\n", QStringLiteral("cpp"), &header); QVERIFY(impl.parseAndWait(TopDUContext::AllDeclarationsContextsAndUses)); DUChainReadLocker lock; @@ -346,19 +346,19 @@ ICore::self()->languageController()->backgroundParser()->setThreadCount(3); - TestFile impl1("#include \"" + header1.url().byteArray() + "\"\n" - "#include \"" + header2.url().byteArray() + "\"\n" - "#include \"" + header3.url().byteArray() + "\"\n" + TestFile impl1("#include \"" + header1.url().str() + "\"\n" + "#include \"" + header2.url().str() + "\"\n" + "#include \"" + header3.url().str() + "\"\n" "int main() { return 0; }", QStringLiteral("cpp")); - TestFile impl2("#include \"" + header2.url().byteArray() + "\"\n" - "#include \"" + header1.url().byteArray() + "\"\n" - "#include \"" + header3.url().byteArray() + "\"\n" + TestFile impl2("#include \"" + header2.url().str() + "\"\n" + "#include \"" + header1.url().str() + "\"\n" + "#include \"" + header3.url().str() + "\"\n" "int main() { return 0; }", QStringLiteral("cpp")); - TestFile impl3("#include \"" + header3.url().byteArray() + "\"\n" - "#include \"" + header1.url().byteArray() + "\"\n" - "#include \"" + header2.url().byteArray() + "\"\n" + TestFile impl3("#include \"" + header3.url().str() + "\"\n" + "#include \"" + header1.url().str() + "\"\n" + "#include \"" + header2.url().str() + "\"\n" "int main() { return 0; }", QStringLiteral("cpp")); impl1.parse(TopDUContext::AllDeclarationsContextsAndUses); @@ -1122,7 +1122,7 @@ void TestDUChain::testReparseInclude() { TestFile header(QStringLiteral("int foo() { return 42; }\n"), QStringLiteral("h")); - TestFile impl("#include \"" + header.url().byteArray() + "\"\n" + TestFile impl("#include \"" + header.url().str() + "\"\n" "int main() { return foo(); }", QStringLiteral("cpp"), &header); // Use TopDUContext::AST to imitate that document is opened in the editor, so that ClangParseJob can store translation unit, that'll be used for reparsing. @@ -1167,7 +1167,7 @@ void TestDUChain::testReparseChangeEnvironment() { TestFile header(QStringLiteral("int foo() { return 42; }\n"), QStringLiteral("h")); - TestFile impl("#include \"" + header.url().byteArray() + "\"\n" + TestFile impl("#include \"" + header.url().str() + "\"\n" "int main() { return foo(); }", QStringLiteral("cpp"), &header); uint hashes[3] = {0, 0, 0}; @@ -1211,10 +1211,10 @@ { TestFile header(QStringLiteral("struct MY_CLASS { class Q{Q(); int m;}; int m; };\n"), QStringLiteral("h")); TestFile impl("#define MY_CLASS A\n" - "#include \"" + header.url().byteArray() + "\"\n" + "#include \"" + header.url().str() + "\"\n" "#undef MY_CLASS\n" "#define MY_CLASS B\n" - "#include \"" + header.url().byteArray() + "\"\n" + "#include \"" + header.url().str() + "\"\n" "#undef MY_CLASS\n" "A a;\n" "const A::Q aq;\n" @@ -1277,7 +1277,7 @@ { TestFile header(QStringLiteral("typedef const A B;\n"), QStringLiteral("h")); TestFile impl("template class A{};\n" - "#include \"" + header.url().byteArray() + "\"\n" + "#include \"" + header.url().str() + "\"\n" "B c;", QStringLiteral("cpp"), &header); impl.parse(TopDUContext::Features(TopDUContext::AllDeclarationsContextsAndUses|TopDUContext::AST|TopDUContext::ForceUpdate)); @@ -1316,8 +1316,8 @@ { TestFile header(QStringLiteral("template class A{};\n"), QStringLiteral("h")); TestFile header2(QStringLiteral("typedef const A B;\n"), QStringLiteral("h")); - TestFile impl("#include \"" + header.url().byteArray() + "\"\n" - "#include \"" + header2.url().byteArray() + "\"\n" + TestFile impl("#include \"" + header.url().str() + "\"\n" + "#include \"" + header2.url().str() + "\"\n" "B c;", QStringLiteral("cpp"), &header); impl.parse(TopDUContext::Features(TopDUContext::AllDeclarationsContextsAndUses|TopDUContext::AST|TopDUContext::ForceUpdate)); @@ -1436,8 +1436,8 @@ void TestDUChain::testNestedImports() { TestFile B(QStringLiteral("#pragma once\nint B();\n"), QStringLiteral("h")); - TestFile C("#pragma once\n#include \"" + B.url().byteArray() + "\"\nint C();\n", QStringLiteral("h")); - TestFile A("#include \"" + B.url().byteArray() + "\"\n" + "#include \"" + C.url().byteArray() + "\"\nint A();\n", QStringLiteral("cpp")); + TestFile C("#pragma once\n#include \"" + B.url().str() + "\"\nint C();\n", QStringLiteral("h")); + TestFile A("#include \"" + B.url().str() + "\"\n" + "#include \"" + C.url().str() + "\"\nint A();\n", QStringLiteral("cpp")); A.parse(); QVERIFY(A.waitForParsed(5000)); @@ -1634,7 +1634,7 @@ void TestDUChain::testReparseIncludeGuard() { TestFile header(QStringLiteral("#ifndef GUARD\n#define GUARD\nint something;\n#endif\n"), QStringLiteral("h")); - TestFile impl("#include \"" + header.url().byteArray() + "\"\n", QStringLiteral("cpp"), &header); + TestFile impl("#include \"" + header.url().str() + "\"\n", QStringLiteral("cpp"), &header); QVERIFY(impl.parseAndWait(TopDUContext::Features(TopDUContext::AllDeclarationsContextsAndUses | TopDUContext::AST ))); { @@ -1747,7 +1747,7 @@ void TestDUChain::testDeclarationsInsideMacroExpansion() { TestFile header(QStringLiteral("#define DECLARE(a) typedef struct a##__ {int var;} *a\nDECLARE(D);\n"), QStringLiteral("h")); - TestFile file("#include \"" + header.url().byteArray() + "\"\nint main(){\nD d; d->var;}\n", QStringLiteral("cpp")); + TestFile file("#include \"" + header.url().str() + "\"\nint main(){\nD d; d->var;}\n", QStringLiteral("cpp")); file.parse(TopDUContext::Features(TopDUContext::AllDeclarationsContextsAndUses|TopDUContext::AST)); QVERIFY(file.waitForParsed(5000)); diff --git a/languages/clang/tests/test_problems.cpp b/languages/clang/tests/test_problems.cpp --- a/languages/clang/tests/test_problems.cpp +++ b/languages/clang/tests/test_problems.cpp @@ -414,7 +414,7 @@ void TestProblems::testProblemsForIncludedFiles() { TestFile header(QStringLiteral("#pragma once\n//TODO: header\n"), QStringLiteral("h")); - TestFile file("#include \"" + header.url().byteArray() + "\"\n//TODO: source\n", QStringLiteral("cpp")); + TestFile file("#include \"" + header.url().str() + "\"\n//TODO: source\n", QStringLiteral("cpp")); file.parse(TopDUContext::Features(TopDUContext::AllDeclarationsContextsAndUses|TopDUContext::AST | TopDUContext::ForceUpdate)); QVERIFY(file.waitForParsed(5000)); diff --git a/providers/ghprovider/ghresource.cpp b/providers/ghprovider/ghresource.cpp --- a/providers/ghprovider/ghresource.cpp +++ b/providers/ghprovider/ghresource.cpp @@ -77,7 +77,7 @@ void Resource::authenticate(const QString &name, const QString &password) { - auto job = createHttpAuthJob(QLatin1String("Authorization: Basic ") + QString::fromUtf8((name.toUtf8() + ':' + password.toUtf8()).toBase64())); + auto job = createHttpAuthJob(QLatin1String("Authorization: Basic ") + QString::fromUtf8(QByteArray(name.toUtf8() + ':' + password.toUtf8()).toBase64())); job->addMetaData("PropagateHttpHeader","true"); connect(job, &KIO::StoredTransferJob::result, this, &Resource::slotAuthenticate); @@ -97,7 +97,7 @@ QUrl url = baseUrl; url.setPath(url.path() + "/authorizations/" + id); KIO::TransferJob *job = KIO::http_delete(url, KIO::HideProgressInfo); - job->addMetaData(QStringLiteral("customHTTPHeader"), "Authorization: Basic " + QString (name + ':' + password).toUtf8().toBase64()); + job->addMetaData(QStringLiteral("customHTTPHeader"), QLatin1String("Authorization: Basic ") + QString (name + ':' + password).toUtf8().toBase64()); /* And we don't care if it's successful ;) */ job->start(); }