From bf1ac8ee9b2edcf9e90f74bae7f392c1b3c318b2 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Tue, 12 Aug 2014 09:17:41 +0200 Subject: [PATCH] Always clear DolphinView's m_currentItemUrl member in updateViewState() 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index c1f585da94..02b8815e07 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -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()) {