diff options
author | Lucie Gérard <lucie.gerard@qt.io> | 2019-10-18 11:00:37 +0200 |
---|---|---|
committer | Lucie Gérard <lucie.gerard@qt.io> | 2019-10-18 11:49:58 +0200 |
commit | ffc6fc294a07c6f88e9803381abfb1a9f91577ee (patch) | |
tree | cbaae5d51213daf2c3e2e66d77394071ed55ed53 | |
parent | 8048a5c2190d103c7c657f4054ad99a25ff11ab2 (diff) |
Correct file comparison during AST visit
Change-Id: I93f6b800975fd068feb2f0be4668df2123a088d4
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
-rw-r--r-- | src/linguist/lupdate/clangtoolastreader.cpp | 2 | ||||
-rw-r--r-- | src/linguist/lupdate/clangtoolastreader.h | 3 |
2 files changed, 1 insertions, 4 deletions
diff --git a/src/linguist/lupdate/clangtoolastreader.cpp b/src/linguist/lupdate/clangtoolastreader.cpp index e79ed2646..8b0e57378 100644 --- a/src/linguist/lupdate/clangtoolastreader.cpp +++ b/src/linguist/lupdate/clangtoolastreader.cpp @@ -129,8 +129,6 @@ bool LupdateVisitor::VisitCallExpr(clang::CallExpr *callExpression) if (funcName != "tr" && funcName != "qtTrId" && funcName != "translate" && funcName != "trUtf8") return true; llvm::StringRef fileName = fullLocation.getFileEntry()->getName(); - if (fileName.contains(llvm::StringRef("/"))) - fileName = fileName.rsplit(llvm::StringRef("/")).second; // Checking that the CallExpression is from the input file we're interested in if (fileName != m_inputFile) return true; diff --git a/src/linguist/lupdate/clangtoolastreader.h b/src/linguist/lupdate/clangtoolastreader.h index 53ccb9de2..4170c3254 100644 --- a/src/linguist/lupdate/clangtoolastreader.h +++ b/src/linguist/lupdate/clangtoolastreader.h @@ -131,8 +131,7 @@ public: m_tor(tor) { m_inputFile = m_context->getSourceManager().getFileEntryForID( - m_context->getSourceManager().getMainFileID())->getName().rsplit( - llvm::StringRef("/")).second; + m_context->getSourceManager().getMainFileID())->getName(); } bool VisitCallExpr(clang::CallExpr *callExpression); |