]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Fix regression concerning the "Places" selector in the location bar
[dolphin.git] / src / dolphinmainwindow.cpp
index d9fe6458d7dc3f4cd0bf2ed6a20882dbe77d0247..db4ad07657bc6db5de4aeadd16c887587e0cac0a 100644 (file)
@@ -198,9 +198,6 @@ DolphinMainWindow::DolphinMainWindow() :
     if (!showMenu) {
         createControlButton();
     }
-
-    const KUrl homeUrl(generalSettings->homeUrl());
-    openNewActivatedTab(homeUrl);
 }
 
 DolphinMainWindow::~DolphinMainWindow()
@@ -209,17 +206,6 @@ DolphinMainWindow::~DolphinMainWindow()
 
 void DolphinMainWindow::openDirectories(const QList<KUrl>& dirs)
 {
-    if (dirs.isEmpty()) {
-        return;
-    }
-
-    if (dirs.count() == 1) {
-        m_activeViewContainer->setUrl(dirs.first());
-        return;
-    }
-
-    const int oldOpenTabsCount = m_viewTab.count();
-
     const bool hasSplitView = GeneralSettings::splitView();
 
     // Open each directory inside a new tab. If the "split view" option has been enabled,
@@ -234,11 +220,6 @@ void DolphinMainWindow::openDirectories(const QList<KUrl>& dirs)
             openNewTab(primaryUrl);
         }
     }
-
-    // Remove the previously opened tabs
-    for (int i = 0; i < oldOpenTabsCount; ++i) {
-        closeTab(0);
-    }
 }
 
 void DolphinMainWindow::openFiles(const QList<KUrl>& files)
@@ -516,6 +497,13 @@ void DolphinMainWindow::openInNewWindow()
 void DolphinMainWindow::showEvent(QShowEvent* event)
 {
     KXmlGuiWindow::showEvent(event);
+
+    if (!m_activeViewContainer && m_viewTab.count() > 0) {
+        // If we have no active view container yet, we set the primary view container
+        // of the first tab as active view container.
+        setActiveTab(0);
+    }
+
     if (!event->spontaneous()) {
         m_activeViewContainer->view()->setFocus();
     }
@@ -782,7 +770,8 @@ void DolphinMainWindow::togglePanelLockState()
 void DolphinMainWindow::slotPlacesPanelVisibilityChanged(bool visible)
 {
     foreach (DolphinTabPage* tabPage, m_viewTab) {
-        tabPage->setPlacesSelectorVisible(visible);
+        // The Places selector in the location bar should be shown if and only if the Places panel is hidden.
+        tabPage->setPlacesSelectorVisible(!visible);
     }
 }