summaryrefslogtreecommitdiffstats
path: root/src/assistant/help/qhelpsearchengine.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2024-02-08 00:23:51 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2024-02-13 22:24:11 +0100
commit25a36bca696023c9fe8ea7514a074df360660473 (patch)
tree5a1dc79622e3a77b94875d9d90ca6d7e0c988eac /src/assistant/help/qhelpsearchengine.cpp
parent9f125e0dff3f6e7b4d4079218db459ee328af46c (diff)
QtHelp: Bit more cleanup in cpp files
Inline some short methods in private API. Use more {} for default constructed values. Fix indentations. Add some TODOs. Task-number: QTBUG-122025 Change-Id: I29062709f6d302a8768ead1c20eda3af5c256c74 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/assistant/help/qhelpsearchengine.cpp')
-rw-r--r--src/assistant/help/qhelpsearchengine.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/assistant/help/qhelpsearchengine.cpp b/src/assistant/help/qhelpsearchengine.cpp
index a0a69865a..412eec457 100644
--- a/src/assistant/help/qhelpsearchengine.cpp
+++ b/src/assistant/help/qhelpsearchengine.cpp
@@ -48,9 +48,7 @@ public:
QList<QHelpSearchResult> searchResults(int start, int end) const
{
- return indexReader ?
- indexReader->searchResults(start, end) :
- QList<QHelpSearchResult>();
+ return indexReader ? indexReader->searchResults(start, end) : QList<QHelpSearchResult>();
}
void updateIndex(bool reindex = false)
@@ -71,8 +69,7 @@ public:
}
indexWriter->cancelIndexing();
- indexWriter->updateIndex(helpEngine->collectionFile(),
- indexFilesFolder(), reindex);
+ indexWriter->updateIndex(helpEngine->collectionFile(), indexFilesFolder(), reindex);
}
void cancelIndexing()
@@ -114,8 +111,7 @@ public:
QString indexFilesFolder = QLatin1String(".fulltextsearch");
if (helpEngine && !helpEngine->collectionFile().isEmpty()) {
QFileInfo fi(helpEngine->collectionFile());
- indexFilesFolder = fi.absolutePath() + QDir::separator()
- + QLatin1Char('.')
+ indexFilesFolder = fi.absolutePath() + QDir::separator() + QLatin1Char('.')
+ fi.fileName().left(fi.fileName().lastIndexOf(QLatin1String(".qhc")));
}
return indexFilesFolder;
@@ -281,7 +277,6 @@ QHelpSearchQueryWidget* QHelpSearchEngine::queryWidget()
{
if (!d->queryWidget)
d->queryWidget = new QHelpSearchQueryWidget();
-
return d->queryWidget;
}
@@ -292,7 +287,6 @@ QHelpSearchResultWidget* QHelpSearchEngine::resultWidget()
{
if (!d->resultWidget)
d->resultWidget = new QHelpSearchResultWidget(this);
-
return d->resultWidget;
}
@@ -381,8 +375,7 @@ QT_WARNING_DISABLE_DEPRECATED
*/
QList<QHelpSearchQuery> QHelpSearchEngine::query() const
{
- return QList<QHelpSearchQuery>() << QHelpSearchQuery(QHelpSearchQuery::DEFAULT,
- d->m_searchInput.split(QChar::Space));
+ return {{QHelpSearchQuery::DEFAULT, d->m_searchInput.split(QChar::Space)}};
}
QT_WARNING_POP
#endif // QT_DEPRECATED_SINCE(5, 9)