]> cloud.milkyroute.net Git - dolphin.git/commitdiff
don't lose the history of the URL navigator if the settings of the Icons View, Detail...
authorPeter Penz <peter.penz19@gmail.com>
Thu, 10 May 2007 18:27:32 +0000 (18:27 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Thu, 10 May 2007 18:27:32 +0000 (18:27 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=663282

src/dolphinmainwindow.cpp
src/dolphinview.cpp
src/dolphinview.h

index d84775d59dadeb42edcc8fe13ebcd86cefaa7571..12d864bd781f64374173338c0b8bc8314a34417e 100644 (file)
@@ -206,38 +206,12 @@ void DolphinMainWindow::rename(const KUrl& oldUrl, const KUrl& newUrl)
 
 void DolphinMainWindow::refreshViews()
 {
-    const bool split = DolphinSettings::instance().generalSettings()->splitView();
-    const bool isPrimaryViewActive = (m_activeView == m_view[PrimaryIdx]);
-    KUrl url;
-    for (int i = PrimaryIdx; i <= SecondaryIdx; ++i) {
-        if (m_view[i] != 0) {
-            url = m_view[i]->url();
-
-            // delete view instance...
-            m_view[i]->close();
-            m_view[i]->deleteLater();
-            m_view[i] = 0;
-        }
+    Q_ASSERT(m_view[PrimaryIdx] != 0);
+    m_view[PrimaryIdx]->refresh();
 
-        if (split || (i == PrimaryIdx)) {
-            // ... and recreate it
-            ViewProperties props(url);
-            m_view[i] = new DolphinView(this,
-                                        m_splitter,
-                                        url,
-                                        props.viewMode(),
-                                        props.showHiddenFiles());
-            connectViewSignals(i);
-            m_view[i]->reload();
-            m_view[i]->show();
-        }
+    if (m_view[SecondaryIdx] != 0) {
+        m_view[SecondaryIdx]->refresh();
     }
-
-    m_activeView = isPrimaryViewActive ? m_view[PrimaryIdx] : m_view[SecondaryIdx];
-    Q_ASSERT(m_activeView != 0);
-
-    updateViewActions();
-    emit activeViewChanged();
 }
 
 void DolphinMainWindow::changeUrl(const KUrl& url)
index c51dbb464f713a029628d41be58021bb0181d51c..84b765d4d8ecb307f0c3e474bbad332a0f9b9426 100644 (file)
@@ -617,6 +617,11 @@ void DolphinView::reload()
     startDirLister(url, true);
 }
 
+void DolphinView::refresh()
+{
+    createView();
+}
+
 void DolphinView::mouseReleaseEvent(QMouseEvent* event)
 {
     QWidget::mouseReleaseEvent(event);
index 9581f6601cb5b6a80c652f97469ff1c6a7140e39..b3b20600216b031182ed37e437d6dc47a27a3b49 100644 (file)
@@ -350,6 +350,13 @@ public:
     /** Reloads the current directory. */
     void reload();
 
+    /**
+     * Refreshs the view to get synchronized with the (updated) Dolphin settings.
+     * This method only needs to get invoked if the view settings for the Icons View,
+     * Details View or Columns View have been changed.
+     */
+    void refresh();
+
 public slots:
     /**
      * Popups the filter bar above the status bar if \a show is true.