Commit e076d866 authored by Méven Car's avatar Méven Car
Browse files

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
parent dcd8c646
...@@ -136,6 +136,7 @@ QUrl DolphinSearchBox::urlForSearching() const ...@@ -136,6 +136,7 @@ QUrl DolphinSearchBox::urlForSearching() const
} }
query.addQueryItem(QStringLiteral("url"), searchPath().url()); query.addQueryItem(QStringLiteral("url"), searchPath().url());
query.addQueryItem(QStringLiteral("title"), queryTitle(m_searchInput->text()));
url.setQuery(query); url.setQuery(query);
} }
...@@ -472,6 +473,12 @@ void DolphinSearchBox::init() ...@@ -472,6 +473,12 @@ void DolphinSearchBox::init()
connect(m_startSearchTimer, &QTimer::timeout, this, &DolphinSearchBox::emitSearchRequest); 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 QUrl DolphinSearchBox::balooUrlForSearching() const
{ {
#ifdef HAVE_BALOO #ifdef HAVE_BALOO
...@@ -494,8 +501,7 @@ QUrl DolphinSearchBox::balooUrlForSearching() const ...@@ -494,8 +501,7 @@ QUrl DolphinSearchBox::balooUrlForSearching() const
query.setSearchString(queryStrings.join(QLatin1Char(' '))); 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.", return query.toSearchUrl(queryTitle(text));
"Query Results from '%1'", text));
#else #else
return QUrl(); return QUrl();
#endif #endif
......
...@@ -161,6 +161,8 @@ private: ...@@ -161,6 +161,8 @@ private:
bool isIndexingEnabled() const; bool isIndexingEnabled() const;
private: private:
QString queryTitle(const QString& text) const;
bool m_startedSearching; bool m_startedSearching;
bool m_active; bool m_active;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment