aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2019-07-13 14:08:37 +0200
committerAndré Hartmann <aha_1980@gmx.de>2019-07-14 11:36:43 +0000
commitb5badf97b7dcfce08e7b4c0ef70fa36e967713b8 (patch)
tree70b10b3f04ba98b2dbd75629d92c910f3a825f02 /src
parent81d417ce3693305bf14a5490158d94d87129b7d0 (diff)
GenericProposalModel: Modernize and cleanup
Change-Id: Iae0733c9734f63900af32c89f553d6a337b49daf Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/texteditor/codeassist/genericproposalmodel.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/texteditor/codeassist/genericproposalmodel.cpp b/src/plugins/texteditor/codeassist/genericproposalmodel.cpp
index b5d9b00340..29efd1799d 100644
--- a/src/plugins/texteditor/codeassist/genericproposalmodel.cpp
+++ b/src/plugins/texteditor/codeassist/genericproposalmodel.cpp
@@ -116,12 +116,11 @@ struct ContentLessThan
{
bool operator()(const QChar &a, const QChar &b)
{
- if (a == QLatin1Char('_'))
+ if (a == '_')
return false;
- else if (b == QLatin1Char('_'))
+ if (b == '_')
return true;
- else
- return a < b;
+ return a < b;
}
};
@@ -158,7 +157,7 @@ static QString cleanText(const QString &original)
int ignore = 0;
for (int i = clean.length() - 1; i >= 0; --i, ++ignore) {
const QChar &c = clean.at(i);
- if (c.isLetterOrNumber() || c == QLatin1Char('_')
+ if (c.isLetterOrNumber() || c == '_'
|| c.isHighSurrogate() || c.isLowSurrogate()) {
break;
}
@@ -300,7 +299,7 @@ void GenericProposalModel::filter(const QString &prefix)
m_currentItems.clear();
const QString lowerPrefix = prefix.toLower();
- foreach (const auto &item, m_originalItems) {
+ for (const auto &item : qAsConst(m_originalItems)) {
const QString &text = item->text();
if (regExp.match(text).capturedStart() == 0) {
m_currentItems.append(item);