]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/places/placespanel.cpp
Further preperations for drag & drop support in the places panel
[dolphin.git] / src / panels / places / placespanel.cpp
index 968c9af455bacf135089fd519a8888ae2fd6a47e..deef429358b055ba128f78c54cf31a57f1a51b20 100644 (file)
@@ -43,6 +43,7 @@
 #include "placesitemlistwidget.h"
 #include "placesitemmodel.h"
 #include <views/draganddrophelper.h>
+#include <QGraphicsSceneDragDropEvent>
 #include <QVBoxLayout>
 #include <QShowEvent>
 
@@ -88,6 +89,7 @@ void PlacesPanel::showEvent(QShowEvent* event)
         connect(m_controller, SIGNAL(itemMiddleClicked(int)), this, SLOT(slotItemMiddleClicked(int)));
         connect(m_controller, SIGNAL(itemContextMenuRequested(int,QPointF)), this, SLOT(slotItemContextMenuRequested(int,QPointF)));
         connect(m_controller, SIGNAL(viewContextMenuRequested(QPointF)), this, SLOT(slotViewContextMenuRequested(QPointF)));
+        connect(m_controller, SIGNAL(itemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotItemDropEvent(int,QGraphicsSceneDragDropEvent*)));
 
         KItemListContainer* container = new KItemListContainer(m_controller, this);
         container->setEnabledFrame(false);
@@ -252,6 +254,11 @@ void PlacesPanel::slotViewContextMenuRequested(const QPointF& pos)
     selectClosestItem();
 }
 
+void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event)
+{
+    m_model->dropMimeData(index, event->mimeData());
+}
+
 void PlacesPanel::slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent)
 {
     Q_UNUSED(parent);