┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.cpp
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2017-09-17 11:56:42 +0200
committerElvis Angelaccio <[email protected]>2017-09-17 11:56:42 +0200
commit49396318f0f37f913a91bf02484a16e34fec6bf4 (patch)
tree8d8274df0e2b71aab201eb16679243cff573695d /src/views/dolphinview.cpp
parentd1b68db1a348f22eb8f6b6ffaae5097820385e83 (diff)
parent478f404b8abf924a0e3e21bbf1dd49aefbe47672 (diff)
Merge branch 'Applications/17.08'
Diffstat (limited to 'src/views/dolphinview.cpp')
-rw-r--r--src/views/dolphinview.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 5fcec9241..2ca51f52d 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -635,6 +635,9 @@ void DolphinView::renameSelectedItems()
this, &DolphinView::slotRoleEditingFinished);
} else {
RenameDialog* dialog = new RenameDialog(this, items);
+
+ connect(dialog, &RenameDialog::renamingFinished, this, &DolphinView::slotRenameDialogRenamingFinished);
+
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
dialog->raise();
@@ -1308,9 +1311,7 @@ QUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseTh
void DolphinView::observeCreatedItem(const QUrl& url)
{
if (m_active) {
- clearSelection();
- markUrlAsCurrent(url);
- markUrlsAsSelected({url});
+ forceUrlsSelection(url, {url});
}
}
@@ -1541,6 +1542,8 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);
+ forceUrlsSelection(newUrl, {newUrl});
+
if (!newNameExistsAlready) {
// Only connect the result signal if there is no item with the new name
// in the model yet, see bug 328262.
@@ -1747,3 +1750,16 @@ QUrl DolphinView::viewPropertiesUrl() const
url.setPath(m_viewPropertiesContext);
return url;
}
+
+void DolphinView::slotRenameDialogRenamingFinished(const QList<QUrl>& urls)
+{
+ forceUrlsSelection(urls.first(), urls);
+}
+
+void DolphinView::forceUrlsSelection(const QUrl& current, const QList<QUrl>& selected)
+{
+ clearSelection();
+ m_clearSelectionBeforeSelectingNewItems = true;
+ markUrlAsCurrent(current);
+ markUrlsAsSelected(selected);
+}