]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Always clear DolphinView's m_currentItemUrl member in updateViewState()
authorFrank Reininghaus <frank78ac@googlemail.com>
Tue, 12 Aug 2014 07:17:41 +0000 (09:17 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Tue, 12 Aug 2014 07:17:41 +0000 (09:17 +0200)
Before this patch, we still kept the URL in m_currentItemUrl if the URL
was not found in the model. This could cause problems the next time
updateViewState() was called, because the current index would then be
set to 0, which could cause other issues.

For example, all items between the first item in the view and a folder
which was expanded in Details View could be selected.

In principle, it is possible that updateViewState() is called multiple
times if many large files are being pasted in the view, but since the
item which should be made the current item (and which the view should
be scrolled to) should always be the first pasted item, this change
will most likely not cause any other problems.

BUG: 329377
REVIEW: 119703
FIXED-IN: 4.14.0

src/views/dolphinview.cpp

index c1f585da9448cf8955355db9120921b6130b8e29..02b8815e07a8e7377991d600fc8ba41e4cc89f05 100644 (file)
@@ -1289,11 +1289,11 @@ void DolphinView::updateViewState()
                 m_view->scrollToItem(currentIndex);
                 m_scrollToCurrentItem = false;
             }
-
-            m_currentItemUrl = KUrl();
         } else {
             selectionManager->setCurrentItem(0);
         }
+
+        m_currentItemUrl = KUrl();
     }
 
     if (!m_restoredContentsPosition.isNull()) {