const QMimeDatabase db;
+ m_clearSelectionBeforeSelectingNewItems = true;
+ m_markFirstNewlySelectedItemAsCurrent = true;
+ m_selectJobCreatedItems = true;
+
// Duplicate all selected items and append "copy" to the end of the file name
// but before the filename extension, if present
- QList<QUrl> newSelection;
for (const auto &item : itemList) {
const QUrl originalURL = item.url();
const QString originalDirectoryPath = originalURL.adjusted(QUrl::RemoveFilename).path();
}
KIO::CopyJob *job = KIO::copyAs(originalURL, duplicateURL);
+ job->setAutoRename(true);
KJobWidgets::setWindow(job, this);
- if (job) {
- newSelection << duplicateURL;
- KIO::FileUndoManager::self()->recordCopyJob(job);
- }
+ connect(job, &KIO::CopyJob::result, this, &DolphinView::slotJobResult);
+ connect(job, &KIO::CopyJob::copyingDone, this, &DolphinView::slotItemCreatedFromJob);
+ connect(job, &KIO::CopyJob::copyingLinkDone, this, &DolphinView::slotItemLinkCreatedFromJob);
+ KIO::FileUndoManager::self()->recordCopyJob(job);
}
-
- forceUrlsSelection(newSelection.first(), newSelection);
}
void DolphinView::stopLoading()
slotItemCreated(to);
}
+void DolphinView::slotItemLinkCreatedFromJob(KIO::Job *, const QUrl &, const QString &, const QUrl &to)
+{
+ slotItemCreated(to);
+}
+
void DolphinView::slotItemCreated(const QUrl &url)
{
if (m_markFirstNewlySelectedItemAsCurrent) {
void slotRenameDialogRenamingFinished(const QList<QUrl> &urls);
void slotSelectedItemTextPressed(int index);
void slotItemCreatedFromJob(KIO::Job *, const QUrl &, const QUrl &to);
+ void slotItemLinkCreatedFromJob(KIO::Job *, const QUrl &, const QString &, const QUrl &to);
void slotIncreaseZoom();
void slotDecreaseZoom();
void slotSwipeUp();