]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Assure that the item delegate draws the hover effect and the selection for the detail...
[dolphin.git] / src / dolphinmainwindow.cpp
index 48f085e336bf872d6e13d30fe810fc3e26acb9bf..618676935b9d2bd517c7ac4297aee21ace2a9bd6 100644 (file)
@@ -58,6 +58,7 @@
 #include <kio/netaccess.h>
 #include <kinputdialog.h>
 #include <klocale.h>
+#include <kprotocolmanager.h>
 #include <kmenu.h>
 #include <kmenubar.h>
 #include <kmessagebox.h>
@@ -182,9 +183,12 @@ void DolphinMainWindow::refreshViews()
     // the secondary view
     DolphinViewContainer* activeViewContainer = m_activeViewContainer;
 
-    m_viewTab[m_tabIndex].primaryView->view()->refresh();
-    if (m_viewTab[m_tabIndex].secondaryView != 0) {
-        m_viewTab[m_tabIndex].secondaryView->view()->refresh();
+    const int tabCount = m_viewTab.count();
+    for (int i = 0; i < tabCount; ++i) {
+        m_viewTab[i].primaryView->refresh();
+        if (m_viewTab[i].secondaryView != 0) {
+            m_viewTab[i].secondaryView->refresh();
+        }
     }
 
     setActiveViewContainer(activeViewContainer);
@@ -197,6 +201,13 @@ void DolphinMainWindow::pasteIntoFolder()
 
 void DolphinMainWindow::changeUrl(const KUrl& url)
 {
+    if (!KProtocolManager::supportsListing(url)) {
+        // The URL navigator only checks for validity, not
+        // if the URL can be listed. An error message is
+        // shown due to DolphinViewContainer::restoreView().
+        return;
+    }
+    
     DolphinViewContainer* view = activeViewContainer();
     if (view != 0) {
         view->setUrl(url);
@@ -826,6 +837,7 @@ void DolphinMainWindow::init()
 
     setCentralWidget(centralWidget);
     setupDockWidgets();
+    emit urlChanged(homeUrl);
 
     setupGUI(Keys | Save | Create | ToolBar);
 
@@ -851,7 +863,6 @@ void DolphinMainWindow::init()
     }
 
     m_showMenuBar->setChecked(!menuBar()->isHidden());  // workaround for bug #171080
-    emit urlChanged(homeUrl);
 }
 
 void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContainer)