From 06e44b8d4760181e7beed1b07bf23860db824e4f Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Thu, 27 May 2010 13:38:19 +0100 Subject: [PATCH] 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. --- src/MainWindow.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 7a9b56852..522531a75 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -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