}
query.addQueryItem(QStringLiteral("url"), searchPath().url());
+ query.addQueryItem(QStringLiteral("title"), queryTitle(m_searchInput->text()));
url.setQuery(query);
}
m_searchInput->clear();
}
}
+ else if (event->key() == Qt::Key_Down) {
+ emit focusViewRequest();
+ }
}
bool DolphinSearchBox::eventFilter(QObject* obj, QEvent* event)
void DolphinSearchBox::slotReturnPressed()
{
emitSearchRequest();
- emit returnPressed();
+ emit focusViewRequest();
}
void DolphinSearchBox::slotFacetChanged()
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
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
{
#ifdef HAVE_BALOO
const Baloo::IndexerConfig searchInfo;
- return searchInfo.fileIndexingEnabled() && searchInfo.shouldBeIndexed(searchPath().toLocalFile());
+ return searchInfo.fileIndexingEnabled() && !searchPath().isEmpty() && searchInfo.shouldBeIndexed(searchPath().toLocalFile());
#else
return false;
#endif