summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2020-06-15 17:39:32 +0200
committerhjk <hjk@qt.io>2020-06-16 11:57:07 +0000
commit328c0cf809a437a9875e485d2da12a2da22cd11b (patch)
tree31ec25b0cf585e4420ca234bb06a9c5b946609a5 /src/plugins/cpptools
parent361b80cb9b3f4d3cb2d10df5d4e8f3a46447b17b (diff)
downloadqt-creator-328c0cf809a437a9875e485d2da12a2da22cd11b.tar.gz
CppTool: Avoid a use of QStringRef
Change-Id: I2a82bad7d91e059915526f0cf7b89f0d8367463a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r--src/plugins/cpptools/builtineditordocumentprocessor.cpp2
-rw-r--r--src/plugins/cpptools/cpptoolsreuse.cpp2
-rw-r--r--src/plugins/cpptools/cpptoolsreuse.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/cpptools/builtineditordocumentprocessor.cpp b/src/plugins/cpptools/builtineditordocumentprocessor.cpp
index 408c6e7b15..ce35d95b77 100644
--- a/src/plugins/cpptools/builtineditordocumentprocessor.cpp
+++ b/src/plugins/cpptools/builtineditordocumentprocessor.cpp
@@ -123,7 +123,7 @@ CppTools::CheckSymbols *createHighlighter(const CPlusPlus::Document::Ptr &doc,
const QString name = macro.macro().nameToQString();
//Filter out QtKeywords
- if (features.qtKeywordsEnabled && isQtKeyword(QStringRef(&name)))
+ if (features.qtKeywordsEnabled && isQtKeyword(name))
continue;
SimpleLexer tokenize;
diff --git a/src/plugins/cpptools/cpptoolsreuse.cpp b/src/plugins/cpptools/cpptoolsreuse.cpp
index d98febf697..e1c4a9e6d0 100644
--- a/src/plugins/cpptools/cpptoolsreuse.cpp
+++ b/src/plugins/cpptools/cpptoolsreuse.cpp
@@ -214,7 +214,7 @@ bool isValidIdentifier(const QString &s)
return true;
}
-bool isQtKeyword(const QStringRef &text)
+bool isQtKeyword(QStringView text)
{
switch (text.length()) {
case 4:
diff --git a/src/plugins/cpptools/cpptoolsreuse.h b/src/plugins/cpptools/cpptoolsreuse.h
index afab4a4684..00472979b0 100644
--- a/src/plugins/cpptools/cpptoolsreuse.h
+++ b/src/plugins/cpptools/cpptoolsreuse.h
@@ -52,7 +52,7 @@ namespace CppTools {
void CPPTOOLS_EXPORT moveCursorToEndOfIdentifier(QTextCursor *tc);
void CPPTOOLS_EXPORT moveCursorToStartOfIdentifier(QTextCursor *tc);
-bool CPPTOOLS_EXPORT isQtKeyword(const QStringRef &text);
+bool CPPTOOLS_EXPORT isQtKeyword(QStringView text);
bool CPPTOOLS_EXPORT isValidAsciiIdentifierChar(const QChar &ch);
bool CPPTOOLS_EXPORT isValidFirstIdentifierChar(const QChar &ch);