Fix drag slider from Maps tab

When viewing the maps tab it is possible to drag and drop
the slider causing a file import dialog to pop-up and fail.
This patch rejects any drop events where the url is http.

Fixes #97.
This commit is contained in:
Mark Liversedge
2010-05-27 13:38:19 +01:00
committed by Sean Rhea
parent 51784f64f6
commit 06e44b8d47

View File

@@ -466,7 +466,15 @@ MainWindow::selectView(int view)
void
MainWindow::dragEnterEvent(QDragEnterEvent *event)
{
event->acceptProposedAction(); // whatever you wanna drop we will try and process!
bool accept = true;
// we reject http, since we want a file!
foreach (QUrl url, event->mimeData()->urls())
if (url.toString().startsWith("http"))
accept = false;
if (accept) event->acceptProposedAction(); // whatever you wanna drop we will try and process!
else event->ignore();
}
void