Commit 8d7e600f authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

portalize drag urls

this enables sandboxed application to receive drop events
parent 7fdd9f22
Pipeline #203464 failed with stage
in 6 minutes and 10 seconds
......@@ -17,6 +17,7 @@
#include <KTwoFingerSwipe>
#include <KTwoFingerTap>
#include <KUrlMimeData>
#include <QAccessible>
#include <QApplication>
......@@ -1318,10 +1319,11 @@ void KItemListController::startDragging()
return;
}
QMimeData* data = m_model->createMimeData(selectedItems);
QMimeData *data = m_model->createMimeData(selectedItems);
if (!data) {
return;
}
KUrlMimeData::exportUrlsToPortal(data);
// The created drag object will be owned and deleted
// by QApplication::activeWindow().
......
......@@ -162,6 +162,7 @@ void TreeViewContextMenu::populateMimeData(QMimeData* mimeData, bool cut)
bool dummy;
mostLocalUrls.append(m_fileItem.mostLocalUrl(&dummy));
KIO::setClipboardDataCut(mimeData, cut);
KUrlMimeData::exportUrlsToPortal(mimeData);
KUrlMimeData::setUrls(kdeUrls, mostLocalUrls, mimeData);
}
......
......@@ -45,6 +45,7 @@
#include <KLocalizedString>
#include <KMessageBox>
#include <KProtocolManager>
#include <KUrlMimeData>
#include <QAbstractItemView>
#include <QActionGroup>
......@@ -757,12 +758,14 @@ void DolphinView::cutSelectedItemsToClipboard()
{
QMimeData* mimeData = selectionMimeData();
KIO::setClipboardDataCut(mimeData, true);
KUrlMimeData::exportUrlsToPortal(mimeData);
QApplication::clipboard()->setMimeData(mimeData);
}
void DolphinView::copySelectedItemsToClipboard()
{
QMimeData* mimeData = selectionMimeData();
QMimeData *mimeData = selectionMimeData();
KUrlMimeData::exportUrlsToPortal(mimeData);
QApplication::clipboard()->setMimeData(mimeData);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment