diff options
| author | Méven Car <[email protected]> | 2020-05-03 12:45:54 +0200 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2020-05-03 12:46:00 +0200 |
| commit | e076d8668f673e09ddd01b3367e413a494d6d2bb (patch) | |
| tree | d0fd2b0a7144cb3f92e48062ec6bdb855bcdf60a /src | |
| parent | dcd8c646a566eff1ff2c487fb2e7abe9a53a23cb (diff) | |
filenamesearch:/ define a title for the query
Summary: CCBUG: 420354
Reviewers: ngraham, elvisangelaccio, #dolphin, #frameworks, iasensio
Reviewed By: elvisangelaccio, #dolphin, iasensio
Subscribers: iasensio, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D29198
Diffstat (limited to 'src')
| -rw-r--r-- | src/search/dolphinsearchbox.cpp | 10 | ||||
| -rw-r--r-- | src/search/dolphinsearchbox.h | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 52a495270..cdc0718df 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -136,6 +136,7 @@ QUrl DolphinSearchBox::urlForSearching() const } query.addQueryItem(QStringLiteral("url"), searchPath().url()); + query.addQueryItem(QStringLiteral("title"), queryTitle(m_searchInput->text())); url.setQuery(query); } @@ -472,6 +473,12 @@ void DolphinSearchBox::init() connect(m_startSearchTimer, &QTimer::timeout, this, &DolphinSearchBox::emitSearchRequest); } +QString DolphinSearchBox::queryTitle(const QString& text) const +{ + return i18nc("@title UDS_DISPLAY_NAME for a KIO directory listing. %1 is the query the user entered.", + "Query Results from '%1'", text); +} + QUrl DolphinSearchBox::balooUrlForSearching() const { #ifdef HAVE_BALOO @@ -494,8 +501,7 @@ QUrl DolphinSearchBox::balooUrlForSearching() const query.setSearchString(queryStrings.join(QLatin1Char(' '))); - return query.toSearchUrl(i18nc("@title UDS_DISPLAY_NAME for a KIO directory listing. %1 is the query the user entered.", - "Query Results from '%1'", text)); + return query.toSearchUrl(queryTitle(text)); #else return QUrl(); #endif diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h index 2bf3ce4b1..4afd752bc 100644 --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -161,6 +161,8 @@ private: bool isIndexingEnabled() const; private: + QString queryTitle(const QString& text) const; + bool m_startedSearching; bool m_active; |
