- const int currentIndex = m_model->index(m_currentItemUrl);
- if (currentIndex != -1) {
- selectionManager->setCurrentItem(currentIndex);
-
- // scroll to current item and reset the state
- if (m_scrollToCurrentItem) {
- m_view->scrollToItem(currentIndex);
- m_scrollToCurrentItem = false;
+
+ // if there is a selection already, leave it that way
+ if (!selectionManager->hasSelection()) {
+ const int currentIndex = m_model->index(m_currentItemUrl);
+ if (currentIndex != -1) {
+ selectionManager->setCurrentItem(currentIndex);
+
+ // scroll to current item and reset the state
+ if (m_scrollToCurrentItem) {
+ m_view->scrollToItem(currentIndex);
+ m_scrollToCurrentItem = false;
+ }
+ } else {
+ selectionManager->setCurrentItem(0);