diff --git a/frame/dbus/dbusdockentry.h b/frame/dbus/dbusdockentry.h index 4272452dc..f2a3be571 100644 --- a/frame/dbus/dbusdockentry.h +++ b/frame/dbus/dbusdockentry.h @@ -89,6 +89,11 @@ public Q_SLOTS: // METHODS return asyncCall(QStringLiteral("HandleMenuItem"), item); } + inline QDBusPendingReply<> HandleDragDrop(const QStringList &uriList) + { + return asyncCall(QStringLiteral("HandleDragDrop"), QVariant::fromValue(uriList)); + } + inline QDBusPendingReply<> RequestDock() { return asyncCall(QStringLiteral("RequestDock")); diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index b4a99cc56..0c0334201 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -185,7 +185,21 @@ void AppItem::resizeEvent(QResizeEvent *e) void AppItem::dragEnterEvent(QDragEnterEvent *e) { - qDebug() << e; + // ignore drag from panel + if (e->source()) + return; + + e->accept(); +} + +void AppItem::dropEvent(QDropEvent *e) +{ + QStringList uriList; + for (auto uri : e->mimeData()->urls()) + uriList << uri.toString(); + +// qDebug() << uriList; + m_itemEntry->HandleDragDrop(uriList); } void AppItem::invokedMenuItem(const QString &itemId, const bool checked) diff --git a/frame/item/appitem.h b/frame/item/appitem.h index a836861c7..540919e28 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -25,6 +25,7 @@ private: void mouseMoveEvent(QMouseEvent *e); void resizeEvent(QResizeEvent *e); void dragEnterEvent(QDragEnterEvent *e); + void dropEvent(QDropEvent *e); void invokedMenuItem(const QString &itemId, const bool checked); const QString contextMenu() const;