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();
event->mimeData(),
event->buttons(),
event->modifiers());
- dropUrls(destUrl, &dropEvent);
+ dropUrls(destUrl, &dropEvent, this);
setActive(true);
}
-void DolphinView::dropUrls(const QUrl &destUrl, QDropEvent *dropEvent)
+void DolphinView::dropUrls(const QUrl &destUrl, QDropEvent *dropEvent, QWidget *dropWidget)
{
- KIO::DropJob* job = DragAndDropHelper::dropUrls(destUrl, dropEvent, this);
+ KIO::DropJob* job = DragAndDropHelper::dropUrls(destUrl, dropEvent, dropWidget);
if (job) {
connect(job, &KIO::DropJob::result, this, &DolphinView::slotPasteJobResult);
void DolphinView::observeCreatedItem(const QUrl& url)
{
if (m_active) {
- clearSelection();
- markUrlAsCurrent(url);
- markUrlsAsSelected({url});
+ forceUrlsSelection(url, {url});
}
}
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.
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);
+}