]> cloud.milkyroute.net Git - dolphin.git/commitdiff
fix: Dolphin right click and compress doesn't scroll
authorAndrey Butirsky <butirsky@gmail.com>
Thu, 9 Sep 2021 14:59:36 +0000 (17:59 +0300)
committerAndrey Butirsky <butirsky@gmail.com>
Tue, 24 May 2022 17:11:37 +0000 (17:11 +0000)
For newly created items being selected, we had updateViewState() called
twice, and the first call blocked work execution needed in the other one

src/views/dolphinview.cpp

index e6aecff80bad89fafc8909d89e9852061cc9997a..c4e5be30a4b0c56e3ff27981005e9776ab0da980 100644 (file)
@@ -1611,12 +1611,13 @@ void DolphinView::updateViewState()
                     m_view->scrollToItem(currentIndex);
                     m_scrollToCurrentItem = false;
                 }
+                m_currentItemUrl = QUrl();
             } else {
                 selectionManager->setCurrentItem(0);
             }
+        } else {
+            m_currentItemUrl = QUrl();
         }
-
-        m_currentItemUrl = QUrl();
     }
 
     if (!m_restoredContentsPosition.isNull()) {
@@ -1651,8 +1652,10 @@ void DolphinView::updateViewState()
                 }
             }
 
-            selectionManager->beginAnchoredSelection(selectionManager->currentItem());
-            selectionManager->setSelectedItems(selectedItems);
+            if (!selectedItems.isEmpty()) {
+                selectionManager->beginAnchoredSelection(selectionManager->currentItem());
+                selectionManager->setSelectedItems(selectedItems);
+            }
         }
     }
 }