| 95 | } |
| 96 | |
| 97 | void BlockedModsDialog::dropEvent(QDropEvent* e) |
| 98 | { |
| 99 | for (QUrl& url : e->mimeData()->urls()) { |
| 100 | if (url.scheme().isEmpty()) { // ensure isLocalFile() works correctly |
| 101 | url.setScheme("file"); |
| 102 | } |
| 103 | |
| 104 | if (!url.isLocalFile()) { // can't drop external files here. |
| 105 | continue; |
| 106 | } |
| 107 | |
| 108 | QString filePath = url.toLocalFile(); |
| 109 | qDebug() << "[Blocked Mods Dialog] Dropped file:" << filePath; |
| 110 | addHashTask(filePath); |
| 111 | |
| 112 | // watch for changes |
| 113 | QFileInfo file = QFileInfo(filePath); |
| 114 | QString path = file.dir().absolutePath(); |
| 115 | qDebug() << "[Blocked Mods Dialog] Adding watch path:" << path; |
| 116 | m_watcher.addPath(path); |
| 117 | } |
| 118 | scanPaths(); |
| 119 | update(); |
| 120 | } |
| 121 | |
| 122 | void BlockedModsDialog::done(int r) |
| 123 | { |