]> cloud.milkyroute.net Git - dolphin.git/commitdiff
assure that the restoring the column view cannot fail and replace the temporary ...
authorPeter Penz <peter.penz19@gmail.com>
Tue, 25 Sep 2007 05:59:27 +0000 (05:59 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 25 Sep 2007 05:59:27 +0000 (05:59 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=716711

src/dolphinview.cpp
src/dolphinviewcontainer.cpp

index 69d7706d335535b87c9ae0cde413dd19a0a0530c..9541f5abbe3bfc08bec88ae215e606f42bedfefa 100644 (file)
@@ -420,23 +420,20 @@ void DolphinView::setUrl(const KUrl& url)
         return;
     }
 
+    const bool restoreColumnView = !isColumnViewActive()
+                                    && !m_rootUrl.isEmpty()
+                                    && m_rootUrl.isParentOf(url)
+                                    && (m_rootUrl != url);
+
     const KUrl oldRootUrl = rootUrl();
     m_controller->setUrl(url); // emits urlChanged, which we forward
 
-    bool useUrlProperties = true;
-    const bool restoreColumnView = !isColumnViewActive()
-                                   && m_rootUrl.isParentOf(url)
-                                   && (m_rootUrl != url);
     if (restoreColumnView) {
         applyViewProperties(m_rootUrl);
-        if (itemView() == m_columnView) {
-            startDirLister(m_rootUrl);
-            m_columnView->showColumn(url);
-            useUrlProperties = false;
-        }
-    }
-
-    if (useUrlProperties) {
+        Q_ASSERT(itemView() == m_columnView);
+        startDirLister(m_rootUrl);
+        m_columnView->showColumn(url);
+    } else {
         applyViewProperties(url);
         startDirLister(url);
     }
index 9a358b2fffd195a0cd8b9ac10f3195984779ad36..d54ec1e93949af92ec8b459ac7654ad21dc0447d 100644 (file)
@@ -506,6 +506,7 @@ void DolphinViewContainer::slotItemTriggered(const KFileItem& item)
     KUrl url = item.mostLocalUrl(isLocal);
 
     if (item.isDir()) {
+        m_view->setRootUrl(KUrl());  // the root URL is unknown
         m_view->setUrl(url);
     } else if (item.isFile()) {
         // allow to browse through ZIP and tar files