diff options
author | Tim Jenssen <tim.jenssen@qt.io> | 2016-09-23 15:46:41 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2016-09-23 14:27:01 +0000 |
commit | d915b22db9a3e66a2faa045251f7df2146dd428e (patch) | |
tree | 726fc40b312c0e86c4a6469f064d7e3b9fcac78c /src/plugins/help/searchwidget.cpp | |
parent | 669d04a686418541f83a1936d4b278721ec986fe (diff) |
improve static initializers
Change-Id: I304fdd6627f01fc216c84930da607127c52409d9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/help/searchwidget.cpp')
-rw-r--r-- | src/plugins/help/searchwidget.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/plugins/help/searchwidget.cpp b/src/plugins/help/searchwidget.cpp index c0df8c9beac..1288673a6ec 100644 --- a/src/plugins/help/searchwidget.cpp +++ b/src/plugins/help/searchwidget.cpp @@ -157,17 +157,12 @@ void SearchWidget::showEvent(QShowEvent *event) void SearchWidget::search() const { - static QStringList charsToEscapeList; - if (charsToEscapeList.isEmpty()) { - charsToEscapeList << "\\" << "+" - << "-" << "!" << "(" - << ")" << ":" << "^" - << "[" << "]" << "{" - << "}" << "~"; - } + static const QStringList charsToEscapeList({ + "\\", "+", "-", "!", "(", ")", ":", "^", "[", "]", "{", "}", "~" + }); - static QString escapeChar("\\"); - static QRegExp regExp("[\\+\\-\\!\\(\\)\\^\\[\\]\\{\\}~:]"); + static const QString escapeChar("\\"); + static const QRegExp regExp("[\\+\\-\\!\\(\\)\\^\\[\\]\\{\\}~:]"); QList<QHelpSearchQuery> escapedQueries; const QList<QHelpSearchQuery> queries = searchEngine->queryWidget()->query(); |