From a2674f5184c1c6fbcf1f8bbb8099761888f5880d Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 2 Jun 2012 15:45:40 +0200 Subject: Provide a default name when adding a search query to the places panel BUG: 300430 FIXED-IN: 4.9.0 --- src/dolphinviewcontainer.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/dolphinviewcontainer.cpp') diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 7c7d7d309..4d3f1983b 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -316,6 +316,22 @@ bool DolphinViewContainer::isSearchModeEnabled() const return m_searchBox->isVisible(); } +QString DolphinViewContainer::placesText() const +{ + QString text; + + if (isSearchModeEnabled()) { + text = m_searchBox->searchPath().fileName() + QLatin1String(": ") + m_searchBox->text(); + } else { + text = url().fileName(); + if (text.isEmpty()) { + text = url().host(); + } + } + + return text; +} + void DolphinViewContainer::setUrl(const KUrl& newUrl) { if (newUrl != m_urlNavigator->locationUrl()) { -- cgit v1.3