]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
Panel: fix actions and shortcuts to toggle their visibility
[dolphin.git] / src / dolphinviewcontainer.cpp
index 66a9a116ac3cf487fe65aa74e3ab21f7d782b564..076551e5dc3d432614e2065c4c53d06791233c70 100644 (file)
@@ -728,7 +728,8 @@ void DolphinViewContainer::slotItemActivated(const KFileItem &item)
     }
 
     KIO::OpenUrlJob *job = new KIO::OpenUrlJob(item.targetUrl(), item.mimetype());
     }
 
     KIO::OpenUrlJob *job = new KIO::OpenUrlJob(item.targetUrl(), item.mimetype());
-    job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
+    // Auto*Warning*Handling, errors are put in a KMessageWidget by us in slotOpenUrlFinished.
+    job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoWarningHandlingEnabled, this));
     job->setShowOpenOrExecuteDialog(true);
     connect(job, &KIO::OpenUrlJob::finished, this, &DolphinViewContainer::slotOpenUrlFinished);
     job->start();
     job->setShowOpenOrExecuteDialog(true);
     connect(job, &KIO::OpenUrlJob::finished, this, &DolphinViewContainer::slotOpenUrlFinished);
     job->start();
@@ -818,11 +819,13 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl &url)
     }
 
     if (KProtocolManager::supportsListing(url)) {
     }
 
     if (KProtocolManager::supportsListing(url)) {
-        setSearchModeEnabled(isSearchUrl(url));
+        const bool searchBoxInitialized = isSearchModeEnabled() && m_searchBox->text().isEmpty();
+        setSearchModeEnabled(isSearchUrl(url) || searchBoxInitialized);
+
         m_view->setUrl(url);
         tryRestoreViewState();
 
         m_view->setUrl(url);
         tryRestoreViewState();
 
-        if (m_autoGrabFocus && isActive() && !isSearchUrl(url)) {
+        if (m_autoGrabFocus && isActive() && !isSearchModeEnabled()) {
             // When an URL has been entered, the view should get the focus.
             // The focus must be requested asynchronously, as changing the URL might create
             // a new view widget.
             // When an URL has been entered, the view should get the focus.
             // The focus must be requested asynchronously, as changing the URL might create
             // a new view widget.
@@ -840,7 +843,11 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl &url)
         QDesktopServices::openUrl(url);
         redirect(QUrl(), m_urlNavigator->locationUrl(1));
     } else {
         QDesktopServices::openUrl(url);
         redirect(QUrl(), m_urlNavigator->locationUrl(1));
     } else {
-        showMessage(i18nc("@info:status", "Invalid protocol"), Error);
+        if (!url.scheme().isEmpty()) {
+            showMessage(i18nc("@info:status", "Invalid protocol '%1'", url.scheme()), Error);
+        } else {
+            showMessage(i18nc("@info:status", "Invalid protocol"), Error);
+        }
         m_urlNavigator->goBack();
     }
 }
         m_urlNavigator->goBack();
     }
 }