| 221 | } |
| 222 | |
| 223 | void MainWindow::dropEvent( QDropEvent* ev ) |
| 224 | { |
| 225 | Sublime::View* dropToView = viewForPosition(mapToGlobal(ev->position().toPoint())); |
| 226 | if(dropToView) |
| 227 | activateView(dropToView); |
| 228 | |
| 229 | QList<QUrl> urls; |
| 230 | |
| 231 | const QMimeData* mimeData = ev->mimeData(); |
| 232 | if (mimeData->hasUrls()) { |
| 233 | urls = mimeData->urls(); |
| 234 | } else if (mimeData->hasText()) { |
| 235 | const QUrl url = QUrl::fromUserInput(mimeData->text()); |
| 236 | if (url.isValid()) { |
| 237 | urls << url; |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | bool eventUsed = false; |
| 242 | if (urls.size() == 1) { |
| 243 | eventUsed = Core::self()->projectControllerInternal()->fetchProjectFromUrl(urls.at(0), ProjectController::NoFetchFlags); |
| 244 | } |
| 245 | |
| 246 | if (!eventUsed) { |
| 247 | for (const auto& url : std::as_const(urls)) { |
| 248 | Core::self()->documentController()->openDocument(url); |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | ev->acceptProposedAction(); |
| 253 | } |
| 254 | |
| 255 | void MainWindow::loadSettings() |
| 256 | { |
nothing calls this directly
no test coverage detected