]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Use a KIO Job for applying the view properties recursively to sub directories.
[dolphin.git] / src / dolphinmainwindow.cpp
index fdda8d9e69155dbaeb1678a8b1f0ee6be4a3e505..64678202a4627f778e2342e413a9e4ab998ad0d1 100644 (file)
@@ -819,12 +819,15 @@ void DolphinMainWindow::toggleSortOrder()
 void DolphinMainWindow::toggleSplitView()
 {
     if (m_view[SecondaryIdx] == 0) {
+        const int newWidth = (m_view[PrimaryIdx]->width() - m_splitter->handleWidth()) / 2;
         // create a secondary view
         m_view[SecondaryIdx] = new DolphinView(this,
-                                               m_splitter,
+                                               0,
                                                m_view[PrimaryIdx]->url(),
                                                m_view[PrimaryIdx]->mode(),
                                                m_view[PrimaryIdx]->isShowHiddenFilesEnabled());
+        m_splitter->addWidget(m_view[SecondaryIdx]);
+        m_splitter->setSizes(QList<int>() << newWidth << newWidth);
         m_view[SecondaryIdx]->show();
     }
     else {
@@ -841,7 +844,7 @@ void DolphinMainWindow::toggleSplitView()
             // From an implementation point of view it is more efficient to close
             // the primary view and exchange the internal pointers afterwards.
             m_view[PrimaryIdx]->close();
-            m_view[PrimaryIdx]->deleteLater();
+            delete m_view[PrimaryIdx];
             m_view[PrimaryIdx] = m_view[SecondaryIdx];
             m_view[SecondaryIdx] = 0;
             setActiveView(m_view[PrimaryIdx]);
@@ -1122,6 +1125,7 @@ void DolphinMainWindow::init()
                                          homeUrl,
                                          props.viewMode(),
                                          props.isShowHiddenFilesEnabled());
+    m_view[PrimaryIdx]->show();
 
     m_activeView = m_view[PrimaryIdx];