forked from qt-creator/qt-creator
Dropping files into the editor shouldn't insert file:///...
On some desktop environments, dragging and dropping a file gives us the url to the file in multiple mime types, including text/plain. This causes the url to be inserted as text by default. Work around this issue by explicitly ignoring drop events for the text editor when they also come with urls. Task-number: QTCREATORBUG-728 Reviewed-by: Friedemann Kleint
This commit is contained in:
@@ -101,8 +101,6 @@ extern "C" void handleSigInt(int sig)
|
||||
using namespace Core;
|
||||
using namespace Core::Internal;
|
||||
|
||||
static const char *uriListMimeFormatC = "text/uri-list";
|
||||
|
||||
enum { debugMainWindow = 0 };
|
||||
|
||||
MainWindow::MainWindow() :
|
||||
@@ -358,7 +356,7 @@ static bool isDesktopFileManagerDrop(const QMimeData *d, QStringList *files = 0)
|
||||
if (files)
|
||||
files->clear();
|
||||
// Extract dropped files from Mime data.
|
||||
if (!d->hasFormat(QLatin1String(uriListMimeFormatC)))
|
||||
if (!d->hasUrls())
|
||||
return false;
|
||||
const QList<QUrl> urls = d->urls();
|
||||
if (urls.empty())
|
||||
|
||||
Reference in New Issue
Block a user