mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Enable maps drag&drop
This commit is contained in:
parent
73021bec01
commit
4bad086152
@ -1834,9 +1834,25 @@ void GUI::dragEnterEvent(QDragEnterEvent *event)
|
||||
|
||||
void GUI::dropEvent(QDropEvent *event)
|
||||
{
|
||||
QList<QUrl> urls = event->mimeData()->urls();
|
||||
for (int i = 0; i < urls.size(); i++)
|
||||
openFile(urls.at(i).toLocalFile());
|
||||
MapAction *lastReady = 0;
|
||||
QList<QUrl> 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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user