Changeset View
Changeset View
Standalone View
Standalone View
lib/thumbnailview/thumbnailview.cpp
Show First 20 Lines • Show All 685 Lines • ▼ Show 20 Line(s) | 682 | { | |||
---|---|---|---|---|---|
686 | } | 686 | } | ||
687 | 687 | | |||
688 | KFileItemList selectedFiles; | 688 | KFileItemList selectedFiles; | ||
689 | for (const auto index : indexes) { | 689 | for (const auto index : indexes) { | ||
690 | selectedFiles << fileItemForIndex(index); | 690 | selectedFiles << fileItemForIndex(index); | ||
691 | } | 691 | } | ||
692 | 692 | | |||
693 | QDrag* drag = new QDrag(this); | 693 | QDrag* drag = new QDrag(this); | ||
694 | drag->setMimeData(MimeTypeUtils::selectionMimeData(selectedFiles)); | 694 | drag->setMimeData(MimeTypeUtils::selectionMimeData(selectedFiles, MimeTypeUtils::DropTarget)); | ||
695 | d->initDragPixmap(drag, indexes); | 695 | d->initDragPixmap(drag, indexes); | ||
696 | drag->exec(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction, Qt::CopyAction); | 696 | drag->exec(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction, Qt::CopyAction); | ||
697 | } | 697 | } | ||
698 | 698 | | |||
699 | void ThumbnailView::dragEnterEvent(QDragEnterEvent* event) | 699 | void ThumbnailView::dragEnterEvent(QDragEnterEvent* event) | ||
700 | { | 700 | { | ||
701 | QAbstractItemView::dragEnterEvent(event); | 701 | QAbstractItemView::dragEnterEvent(event); | ||
702 | if (event->mimeData()->hasUrls()) { | 702 | if (event->mimeData()->hasUrls()) { | ||
▲ Show 20 Lines • Show All 274 Lines • Show Last 20 Lines |