void DolphinViewContainer::setSearchModeEnabled(bool enabled)
{
+ if (enabled) {
+ const QUrl& locationUrl = m_urlNavigator->locationUrl();
+ m_searchBox->fromSearchUrl(locationUrl);
+ }
+
if (enabled == isSearchModeEnabled()) {
if (enabled && !m_searchBox->hasFocus()) {
m_searchBox->setFocus();
m_searchBox->setVisible(enabled);
m_navigatorWidget->setVisible(!enabled);
- if (enabled) {
- const QUrl& locationUrl = m_urlNavigator->locationUrl();
- m_searchBox->fromSearchUrl(locationUrl);
- } else {
+ if (!enabled) {
m_view->setViewPropertiesContext(QString());
// Restore the URL for the URL navigator. If Dolphin has been
if (isSearchModeEnabled()) {
text = i18n("Search for %1 in %2", m_searchBox->text(), m_searchBox->searchPath().fileName());
} else {
- text = url().fileName();
+ text = url().adjusted(QUrl::StripTrailingSlash).fileName();
if (text.isEmpty()) {
text = url().host();
}