diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2022-12-04 20:52:45 +0100 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2022-12-05 10:06:33 +0000 |
commit | ab22c8582c9edec450a30edf316b078cfb10b09f (patch) | |
tree | 58ea09ffa8b1b4366be86cea7993b7a86d82bc59 | |
parent | d432bc71926b1a855e54baabf5216b09b266b5fc (diff) |
Fix compile with QStringBuilder
Change-Id: I66c034497e23d9a92d779c9ade85e51d49b71fa9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | app/perfsymboltable.cpp | 4 | ||||
-rw-r--r-- | tests/auto/perfdata/tst_perfdata.cpp | 6 |
3 files changed, 6 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0684030..c7f3ad6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,5 +26,6 @@ include(CheckSymbolExists) set(CMAKE_REQUIRED_LIBRARIES elfutils::dw elfutils::elf) check_symbol_exists(dwfl_get_debuginfod_client "libdwfl.h" HAVE_DWFL_GET_DEBUGINFOD_CLIENT) +add_definitions(-DQT_USE_QSTRINGBUILDER) add_subdirectory(app) add_subdirectory(tests) diff --git a/app/perfsymboltable.cpp b/app/perfsymboltable.cpp index 4fbc6bb..bdadf0c 100644 --- a/app/perfsymboltable.cpp +++ b/app/perfsymboltable.cpp @@ -366,12 +366,12 @@ static QFileInfo findDebugInfoFile(const QString &root, const QString &file, // try again in /usr/lib/debug folder // some distros use for example /usr/lib/debug/lib (ubuntu) and some use /usr/lib/debug/usr/lib (fedora) - const auto usr = QDir::separator() + QLatin1String("usr") + QDir::separator(); + const auto usr = QString(QDir::separator() + QLatin1String("usr") + QDir::separator()); auto folderWithoutUsr = folder; folderWithoutUsr.replace(usr, QDir::separator()); // make sure both (/usr/ and /) are searched - for (const auto& path : {folderWithoutUsr, usr + folderWithoutUsr}) { + for (const auto& path : {folderWithoutUsr, QString(usr + folderWithoutUsr)}) { debugLinkFile.setFile(dir.path() + QDir::separator() + QLatin1String("usr") + QDir::separator() + QLatin1String("lib") + QDir::separator() + QLatin1String("debug") + QDir::separator() + path + QDir::separator() + debugLinkString); diff --git a/tests/auto/perfdata/tst_perfdata.cpp b/tests/auto/perfdata/tst_perfdata.cpp index d0706c9..8d65e7d 100644 --- a/tests/auto/perfdata/tst_perfdata.cpp +++ b/tests/auto/perfdata/tst_perfdata.cpp @@ -282,9 +282,9 @@ void TestPerfData::testFiles() const auto perfDataFile = QFINDTESTDATA(dataFile); QVERIFY(!perfDataFile.isEmpty() && QFile::exists(perfDataFile)); - const auto expectedOutputFileCompressed = perfDataFile + ".expected.txt.zlib"; - const auto expectedOutputFileUncompressed = perfDataFile + ".expected.txt"; - const auto actualOutputFile = perfDataFile + ".actual.txt"; + const auto expectedOutputFileCompressed = QString(perfDataFile + ".expected.txt.zlib"); + const auto expectedOutputFileUncompressed = QString(perfDataFile + ".expected.txt"); + const auto actualOutputFile = QString(perfDataFile + ".actual.txt"); QBuffer output; QVERIFY(output.open(QIODevice::WriteOnly)); |