- isDragging = true;
-
- const QModelIndexList indexes = itemView->selectionModel()->selectedIndexes();
- if (!indexes.isEmpty()) {
- QMimeData *data = itemView->model()->mimeData(indexes);
- if (data == 0) {
- return;
- }
-
- if (dolphinViewController != 0) {
- dolphinViewController->requestToolTipHiding();
- }
-
- QDrag* drag = new QDrag(itemView);
- drag->setPixmap(createDragPixmap(itemView));
- drag->setMimeData(data);
-
- m_dragSource = itemView;
- drag->exec(supportedActions, Qt::IgnoreAction);
- m_dragSource = 0;
- }
- isDragging = false;
-}
-
-bool DragAndDropHelper::isDragSource(QAbstractItemView* itemView) const
-{
- return (m_dragSource != 0) && (m_dragSource == itemView);
-}
-
-void DragAndDropHelper::dropUrls(const KFileItem& destItem,
- const KUrl& destPath,
- QDropEvent* event,
- QWidget* widget)
-{
- const bool dropToItem = !destItem.isNull() && (destItem.isDir() || destItem.isDesktopFile());
- const KUrl destination = dropToItem ? destItem.url() : destPath;