SUMMARY The drag© function (by using Ctrl Key) doesn't seem to work anymore after Frameworks 5.63. In previous versions of Kate/Kdevelop this function was working fine (kubuntu 19.10 with ppa / Apps:19.04.3, Frameworks: 5.62) STEPS TO REPRODUCE 1. Within any editor using ktexteditor (kate/kwrite/kdevelop) select a block of text 2. Press the Ctrl-Key and start dragging with the mouse 3. Drop on another location OBSERVED RESULT - The cursor turns into a dragging hand - The text is moved to the 'drop' location instead of being copied EXPECTED RESULT - The cursor turns to an arrow with a plus sign - The text is copied to the 'drop' location SOFTWARE/OS VERSIONS KDE Applications Version: 19.11.70 KDE Plasma Version: 5.17.80 KDE Frameworks Version: 5.64.0 according to System Settings (oddly, the 'about' dialog reports 5.60.0) Qt Version: 5.12.4 ADDITIONAL INFORMATION Also "reported" on https://unix.stackexchange.com/questions/547832/kate-kwrite-editor-drag-drop-copy-functionality-gone
Hello, I tracked it down to the revision D23964 https://phabricator.kde.org/D23964 To be exact error is caused by this one change: https://github.com/KDE/ktexteditor/commit/8f7f22c1fc83a5f18a1701c7c78dae882158de30?diff=unified#diff-fccc06952d6abc88b4b165fc4577eb0fL3240
David some people claim you broke this with https://phabricator.kde.org/D23964
This would fix it for me: diff --git a/src/view/kateviewinternal.cpp b/src/view/kateviewinternal.cpp index 51e1efc7..b7922eb2 100644 --- a/src/view/kateviewinternal.cpp +++ b/src/view/kateviewinternal.cpp @@ -3232,7 +3232,7 @@ void KateViewInternal::doDrag() QMimeData *mimeData = new QMimeData(); mimeData->setText(view()->selectionText()); m_dragInfo.dragObject->setMimeData(mimeData); - m_dragInfo.dragObject->exec(Qt::MoveAction); + m_dragInfo.dragObject->exec(Qt::MoveAction | Qt::CopyAction);
(In reply to Christoph Cullmann from comment #3) > This would fix it for me: > > diff --git a/src/view/kateviewinternal.cpp b/src/view/kateviewinternal.cpp > index 51e1efc7..b7922eb2 100644 > --- a/src/view/kateviewinternal.cpp > +++ b/src/view/kateviewinternal.cpp > @@ -3232,7 +3232,7 @@ void KateViewInternal::doDrag() > QMimeData *mimeData = new QMimeData(); > mimeData->setText(view()->selectionText()); > m_dragInfo.dragObject->setMimeData(mimeData); > - m_dragInfo.dragObject->exec(Qt::MoveAction); > + m_dragInfo.dragObject->exec(Qt::MoveAction | Qt::CopyAction); Can confirm, this fixes it for me too.
Git commit 33a47ec6ebb84c9ddda4f4788df8f94c084ae45e by Christoph Cullmann. Committed on 26/01/2020 at 13:04. Pushed by cullmann into branch 'master'. fix Drag© function (by using Ctrl Key) M +1 -1 src/view/kateviewinternal.cpp https://commits.kde.org/ktexteditor/33a47ec6ebb84c9ddda4f4788df8f94c084ae45e