From 6ab9078e872fd7e31979c849ef2640eb400f480c Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 4 Feb 2019 15:06:18 +0100 Subject: [PATCH] Project tree: Do not pretend to support moving files via Drag & Drop We claimed to support the move action, so on Windows the user could drag files away to e.g. the Desktop or the Explorer. This resulted in inconsistent state, because we do not (cannot?) handle an "external drop" in any of our build system managers. Instead, we now support only the copy action, which leaves our project sources untouched. This is also more likely to be what the user wants. Fixes: QTCREATORBUG-14494 Change-Id: Ie327780768f1ac68d6dbe95c3daa4aa4dc3f0f41 Reviewed-by: Alessandro Portale --- src/plugins/projectexplorer/projectmodels.cpp | 2 +- src/plugins/texteditor/texteditor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index ad79e82975d..d90e3495244 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -398,7 +398,7 @@ bool FlatModel::trimEmptyDirectories(WrapperNode *parent) Qt::DropActions FlatModel::supportedDragActions() const { - return Qt::MoveAction; + return Qt::CopyAction; } QStringList FlatModel::mimeTypes() const diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index aeefcb39cf6..c506d71377f 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -8568,7 +8568,7 @@ void TextEditorLinkLabel::mouseMoveEvent(QMouseEvent *event) data->addFile(m_link.targetFileName, m_link.targetLine, m_link.targetColumn); auto drag = new QDrag(this); drag->setMimeData(data); - drag->exec(Qt::MoveAction); + drag->exec(Qt::CopyAction); } void TextEditorLinkLabel::mouseReleaseEvent(QMouseEvent *event)