diff --git a/src/GUI/gui.cpp b/src/GUI/gui.cpp index 63953cc4..c94dd08a 100644 --- a/src/GUI/gui.cpp +++ b/src/GUI/gui.cpp @@ -1834,9 +1834,25 @@ void GUI::dragEnterEvent(QDragEnterEvent *event) void GUI::dropEvent(QDropEvent *event) { - QList urls = event->mimeData()->urls(); - for (int i = 0; i < urls.size(); i++) - openFile(urls.at(i).toLocalFile()); + MapAction *lastReady = 0; + QList urls(event->mimeData()->urls()); + + for (int i = 0; i < urls.size(); i++) { + QString file(urls.at(i).toLocalFile()); + + if (!openFile(file, true)) { + MapAction *a; + if (!loadMap(file, a, true)) + openFile(file, false); + else { + if (a) + lastReady = a; + } + } + } + + if (lastReady) + lastReady->trigger(); event->acceptProposedAction(); }