diff options
| author | Peter Penz <[email protected]> | 2012-06-02 15:45:40 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-06-02 15:47:17 +0200 |
| commit | a2674f5184c1c6fbcf1f8bbb8099761888f5880d (patch) | |
| tree | 434e91121f79f380c1b7a12f016ef94fb3fed747 /src/dolphinviewcontainer.cpp | |
| parent | 12215d6f0f7768fc943347a349d9817844e0528a (diff) | |
Provide a default name when adding a search query to the places panel
BUG: 300430
FIXED-IN: 4.9.0
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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()) { |
