]> cloud.milkyroute.net Git - dolphin.git/commitdiff
After restoring the current item when going back to a folder, the current-item URL...
authorPeter Penz <peter.penz19@gmail.com>
Wed, 15 Apr 2009 18:40:08 +0000 (18:40 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 15 Apr 2009 18:40:08 +0000 (18:40 +0000)
BUG: 189522

svn path=/trunk/KDE/kdebase/apps/; revision=954402

src/dolphinview.cpp

index 57a2551adf6c62f704d18756c8591f57e6d7e4ab..ed17c94abdedd23320243b811a0cfe27acf1a31e 100644 (file)
@@ -1156,15 +1156,18 @@ void DolphinView::slotRequestUrlChange(const KUrl& url)
 
 void DolphinView::restoreCurrentItem()
 {
-    const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_currentItemUrl);
-    if (dirIndex.isValid()) {
-        const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
-        QAbstractItemView* view = itemView();
-        const bool clearSelection = !hasSelection();
-        view->setCurrentIndex(proxyIndex);
-        if (clearSelection) {
-            view->clearSelection();
+    if (!m_currentItemUrl.isEmpty()) {
+        const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_currentItemUrl);
+        if (dirIndex.isValid()) {
+            const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
+            QAbstractItemView* view = itemView();
+            const bool clearSelection = !hasSelection();
+            view->setCurrentIndex(proxyIndex);
+            if (clearSelection) {
+                view->clearSelection();
+            }
         }
+        m_currentItemUrl.clear();
     }
 }