┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/renamedialog.cpp
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2018-06-03 18:28:23 +0200
committerElvis Angelaccio <[email protected]>2018-06-05 22:07:45 +0200
commite308985de4b355e5758c916ba683040f6f394603 (patch)
treeef188e1479bb1973e783764e6ef01589e0eb5ad0 /src/views/renamedialog.cpp
parenta8bd6f4b1f65d402aacc2d66097fc0cbde870028 (diff)
Fix scrolling to renamed file when using the rename dialog
Summary: The `RenameDialog::slotResult()` slot is currently never called because the dialog is deleted first, due to the usage of the `WA_DeleteOnClose` attribute. This breaks the scroll-to-renamed-file feature when the inline renaming is disabled. Instead of deleting the dialog on close, we can use `deleteLater()` when we are sure the dialog has actually finished its job, which is when the KIO move job emits the `result` signal. Test Plan: - Disable inline renaming - Rename a file so that it goes out of the view - Check whether the view scrolls to the renamed file. Reviewers: #dolphin, emateli Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D13304
Diffstat (limited to 'src/views/renamedialog.cpp')
-rw-r--r--src/views/renamedialog.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp
index e49f56e2d..c9f9c177b 100644
--- a/src/views/renamedialog.cpp
+++ b/src/views/renamedialog.cpp
@@ -62,6 +62,7 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
m_okButton->setShortcut(Qt::CTRL + Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &RenameDialog::slotAccepted);
connect(buttonBox, &QDialogButtonBox::rejected, this, &RenameDialog::reject);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QObject::deleteLater);
m_okButton->setDefault(true);
KGuiItem::assign(m_okButton, KGuiItem(i18nc("@action:button", "&Rename"), QStringLiteral("dialog-ok-apply")));
@@ -178,6 +179,7 @@ void RenameDialog::slotAccepted()
KIO::FileUndoManager::self()->recordJob(cmdType, srcList, parentUrl, job);
connect(job, &KJob::result, this, &RenameDialog::slotResult);
+ connect(job, &KJob::result, this, &QObject::deleteLater);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);