| 97 | } |
| 98 | |
| 99 | void ComicsView::dropEvent(QDropEvent *event) |
| 100 | { |
| 101 | QLOG_DEBUG() << "drop" << event->dropAction(); |
| 102 | |
| 103 | bool validAction = event->dropAction() == Qt::CopyAction; // || event->dropAction() & Qt::MoveAction; TODO move |
| 104 | |
| 105 | if (event->mimeData()->hasUrls() && validAction) { |
| 106 | |
| 107 | QList<QPair<QString, QString>> droppedFiles = ComicFilesManager::getDroppedFiles(event->mimeData()->urls()); |
| 108 | |
| 109 | if (event->dropAction() == Qt::CopyAction) { |
| 110 | QLOG_DEBUG() << "copy :" << droppedFiles; |
| 111 | emit copyComicsToCurrentFolder(droppedFiles); |
| 112 | } else if (event->dropAction() & Qt::MoveAction) { |
| 113 | QLOG_DEBUG() << "move :" << droppedFiles; |
| 114 | emit moveComicsToCurrentFolder(droppedFiles); |
| 115 | } |
| 116 | |
| 117 | event->acceptProposedAction(); |
| 118 | } |
| 119 | } |