summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2017-03-01 12:22:19 +0100
committerMilian Wolff <milian.wolff@kdab.com>2017-03-01 11:56:57 +0000
commitbd6e5bf116b52e95a2e18bffde9ed336d5bfcf66 (patch)
tree9674f2968be1240067e7935a24edeb0f6a7fa825
parent187632b2420bd2a6f0516f94161d5082f36bf395 (diff)
Fix compile against Qt older than Qt 5.8
QLatin1String::at and ::operator[] have only been added in Qt 5.8. We want to support older versions of Qt, so instead use QByteArray's more readable startsWith and endsWith instead. Change-Id: I7e6922060c895754ceae10cffd055d9282df7950 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--app/perfsymboltable.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/perfsymboltable.cpp b/app/perfsymboltable.cpp
index 305e70e..fccf857 100644
--- a/app/perfsymboltable.cpp
+++ b/app/perfsymboltable.cpp
@@ -178,7 +178,7 @@ void PerfSymbolTable::registerElf(const PerfRecordMmap &mmap, const QString &app
{
QLatin1String filePath(mmap.filename());
// special regions, such as [heap], [vdso], [stack], ... as well as //anon
- const bool isSpecialRegion = (filePath.at(0) == '[' && filePath.at(filePath.size() - 1) == ']')
+ const bool isSpecialRegion = (mmap.filename().startsWith('[') && mmap.filename().endsWith(']'))
|| filePath == QLatin1String("//anon");
QFileInfo fileInfo(filePath);
QFileInfo fullPath;