Changeset View
Changeset View
Standalone View
Standalone View
lib/thumbnailview/thumbnailview.cpp
Show First 20 Lines • Show All 672 Lines • ▼ Show 20 Line(s) | |||||
673 | { | 673 | { | ||
674 | if (!d->mDocumentInfoProvider) { | 674 | if (!d->mDocumentInfoProvider) { | ||
675 | return false; | 675 | return false; | ||
676 | } | 676 | } | ||
677 | QUrl url = urlForIndex(index); | 677 | QUrl url = urlForIndex(index); | ||
678 | return d->mDocumentInfoProvider->isBusy(url); | 678 | return d->mDocumentInfoProvider->isBusy(url); | ||
679 | } | 679 | } | ||
680 | 680 | | |||
681 | void ThumbnailView::startDrag(Qt::DropActions supportedActions) | 681 | void ThumbnailView::startDrag(Qt::DropActions) | ||
682 | { | 682 | { | ||
683 | const QModelIndexList indexes = selectionModel()->selectedIndexes(); | 683 | const QModelIndexList indexes = selectionModel()->selectedIndexes(); | ||
684 | if (indexes.isEmpty()) { | 684 | if (indexes.isEmpty()) { | ||
685 | return; | 685 | return; | ||
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)); | ||
695 | d->initDragPixmap(drag, indexes); | 695 | d->initDragPixmap(drag, indexes); | ||
696 | drag->exec(supportedActions, 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()) { | ||
703 | event->acceptProposedAction(); | 703 | event->acceptProposedAction(); | ||
704 | } | 704 | } | ||
▲ Show 20 Lines • Show All 272 Lines • Show Last 20 Lines |