mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
Fix renamed file reclaims focus
Summary: After renaming a file and then selecting another file immediately the just selected file stays selected. BUG: 388555 Test Plan: Steps to reproduce: $ mkdir /tmp/test $ cd /tmp/test $ touch a.tmp b.tmp $ dolphin /tmp/test In dolphin: * select a.tmp * <F2> * type aaa * select b.tmp immediately Expected result: * a.tmp renamed to aaa.tmp * b.tmp stays selected, aaa.tmp stays unselected Reviewers: ngraham, michaelh, #dolphin, elvisangelaccio Reviewed By: ngraham, michaelh, #dolphin, elvisangelaccio Subscribers: emateli, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D9711
This commit is contained in:
parent
6cf74d2fdd
commit
bba44ae907
|
@ -1356,6 +1356,9 @@ void DolphinView::updateViewState()
|
|||
{
|
||||
if (m_currentItemUrl != QUrl()) {
|
||||
KItemListSelectionManager* selectionManager = m_container->controller()->selectionManager();
|
||||
|
||||
// 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);
|
||||
|
@ -1368,6 +1371,7 @@ void DolphinView::updateViewState()
|
|||
} else {
|
||||
selectionManager->setCurrentItem(0);
|
||||
}
|
||||
}
|
||||
|
||||
m_currentItemUrl = QUrl();
|
||||
}
|
||||
|
@ -1384,6 +1388,8 @@ void DolphinView::updateViewState()
|
|||
if (!m_selectedUrls.isEmpty()) {
|
||||
KItemListSelectionManager* selectionManager = m_container->controller()->selectionManager();
|
||||
|
||||
// if there is a selection already, leave it that way
|
||||
if (!selectionManager->hasSelection()) {
|
||||
if (m_clearSelectionBeforeSelectingNewItems) {
|
||||
selectionManager->clearSelection();
|
||||
m_clearSelectionBeforeSelectingNewItems = false;
|
||||
|
@ -1406,6 +1412,7 @@ void DolphinView::updateViewState()
|
|||
selectionManager->setSelectedItems(selectedItems);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DolphinView::hideToolTip()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue