From 46bd8a12153a97ecb0d3e0f3fc24f55eb1d33c57 Mon Sep 17 00:00:00 2001 From: kateleet Date: Tue, 28 Dec 2021 17:03:19 +0800 Subject: [PATCH] chore: use cutefish cutselection --- model/foldermodel.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/model/foldermodel.cpp b/model/foldermodel.cpp index 499278f..4bb77fe 100644 --- a/model/foldermodel.cpp +++ b/model/foldermodel.cpp @@ -987,13 +987,13 @@ void FolderModel::paste() 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")) { + if (mimeData->hasFormat("application/x-cutefish-cutselection")) { QApplication::clipboard()->clear(); } } @@ -1009,7 +1009,10 @@ void FolderModel::cut() return; QMimeData *mimeData = QSortFilterProxyModel::mimeData(m_selectionModel->selectedIndexes()); - KIO::setClipboardDataCut(mimeData, true); + + mimeData->setData("application/x-kde-cutselection", QByteArray("1")); + mimeData->setData("application/x-cutefish-cutselection", QByteArray("1")); + QApplication::clipboard()->setMimeData(mimeData); }