summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-03-22 10:28:47 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-03-22 09:41:10 +0000
commit9a2664b07762619b597227ba7ef47e69e5813dc0 (patch)
treeafdb420cc4953efc65910434b1621d76bcab2a9c
parent518179f881364007afc2b5c3e07bb0ba6642ddc8 (diff)
downloadqttools-9a2664b07762619b597227ba7ef47e69e5813dc0.tar.gz
Assistant: Fix warnings about constructing/concatenating QString from char *.
Use QLatin1Char/String where applicable. Change-Id: I8584ea79fb34b55ad99966e2dd959b95ab73fb18 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
-rw-r--r--src/assistant/help/qhelpprojectdata.cpp8
-rw-r--r--src/assistant/help/qhelpsearchindexreader_clucene.cpp4
-rw-r--r--src/assistant/help/qhelpsearchquerywidget.cpp4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/assistant/help/qhelpprojectdata.cpp b/src/assistant/help/qhelpprojectdata.cpp
index f48fdea9b..fa084ff3c 100644
--- a/src/assistant/help/qhelpprojectdata.cpp
+++ b/src/assistant/help/qhelpprojectdata.cpp
@@ -275,13 +275,13 @@ void QHelpProjectDataPrivate::addMatchingFiles(const QString &pattern)
{
// The pattern matching is expensive, so we skip it if no
// wildcard symbols occur in the string.
- if (!pattern.contains('?') && !pattern.contains('*')
- && !pattern.contains('[') && !pattern.contains(']')) {
+ if (!pattern.contains(QLatin1Char('?')) && !pattern.contains(QLatin1Char('*'))
+ && !pattern.contains(QLatin1Char('[')) && !pattern.contains(QLatin1Char(']'))) {
filterSectionList.last().addFile(pattern);
return;
}
- QFileInfo fileInfo(rootPath + '/' + pattern);
+ QFileInfo fileInfo(rootPath + QLatin1Char('/') + pattern);
const QDir &dir = fileInfo.dir();
const QString &path = dir.canonicalPath();
@@ -303,7 +303,7 @@ void QHelpProjectDataPrivate::addMatchingFiles(const QString &pattern)
if (regExp.exactMatch(file)) {
matchFound = true;
filterSectionList.last().
- addFile(QFileInfo(pattern).dir().path() + '/' + file);
+ addFile(QFileInfo(pattern).dir().path() + QLatin1Char('/') + file);
}
}
if (!matchFound)
diff --git a/src/assistant/help/qhelpsearchindexreader_clucene.cpp b/src/assistant/help/qhelpsearchindexreader_clucene.cpp
index 18b128b01..a63128a88 100644
--- a/src/assistant/help/qhelpsearchindexreader_clucene.cpp
+++ b/src/assistant/help/qhelpsearchindexreader_clucene.cpp
@@ -270,8 +270,8 @@ bool QHelpSearchIndexReaderClucene::buildTryHarderQuery(
bool QHelpSearchIndexReaderClucene::isNegativeQuery(const QHelpSearchQuery &query) const
{
- const QString &search = query.wordList.join(" ");
- return search.contains('!') || search.contains('-')
+ const QString &search = query.wordList.join(QLatin1Char(' '));
+ return search.contains(QLatin1Char('!')) || search.contains(QLatin1Char('-'))
|| search.contains(QLatin1String(" NOT "));
}
diff --git a/src/assistant/help/qhelpsearchquerywidget.cpp b/src/assistant/help/qhelpsearchquerywidget.cpp
index 46f6fdfbd..e0b481e58 100644
--- a/src/assistant/help/qhelpsearchquerywidget.cpp
+++ b/src/assistant/help/qhelpsearchquerywidget.cpp
@@ -212,7 +212,7 @@ private:
queryHist.queries.append(query);
foreach (const QHelpSearchQuery &queryPart, query) {
static_cast<CompleterModel *>(searchCompleter.model())->
- addTerm(queryPart.wordList.join(" "));
+ addTerm(queryPart.wordList.join(QLatin1Char(' ')));
}
}
}
@@ -241,7 +241,7 @@ private:
queryHist->queries.at(queryHist->curQuery);
foreach (const QHelpSearchQuery &queryPart, query) {
if (QLineEdit *lineEdit = lineEditFor(queryPart.fieldName))
- lineEdit->setText(queryPart.wordList.join(" "));
+ lineEdit->setText(queryPart.wordList.join(QLatin1Char(' ')));
}
if (queryHist->curQuery == maxOrMinIndex)