fix: cut logic

This commit is contained in:
kateleet 2021-12-28 16:52:26 +08:00
parent 2a4727c522
commit 451b27ccaa

View file

@ -983,7 +983,19 @@ void FolderModel::paste()
} }
if (enable) { if (enable) {
KIO::paste(mimeData, m_dirModel->dirLister()->url()); // Copy a new MimeData.
QMimeData *data = new QMimeData;
for (QString mimetype : mimeData->formats()) {
data->setData(mimetype, mimeData->data(mimetype));
}
KIO::Job *job = KIO::paste(data, m_dirModel->dirLister()->url());
job->start();
// Clear system clipboard.
if (mimeData->hasFormat("application/x-kde-cutselection")) {
QApplication::clipboard()->clear();
}
} }
} }