summaryrefslogtreecommitdiffstats
path: root/kate/app/katefilelist.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-09-20 22:21:29 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-09-20 22:21:29 -0500
commit6d8d7bc0070aea8a420b66e910d6c3d420d353f4 (patch)
treefe9c05f7394c5e2b64a58d5828da33198241b828 /kate/app/katefilelist.cpp
parent5a0695b39107650840062ccf46682e7c3074f005 (diff)
downloadtdebase-6d8d7bc0070aea8a420b66e910d6c3d420d353f4.tar.gz
tdebase-6d8d7bc0070aea8a420b66e910d6c3d420d353f4.zip
Fix unwanted drag and drop continuation when file modification dialog was shown and mouse cursor subsequently moved back over the file list
Diffstat (limited to 'kate/app/katefilelist.cpp')
-rw-r--r--kate/app/katefilelist.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/kate/app/katefilelist.cpp b/kate/app/katefilelist.cpp
index 98857b3c3..9cf4b172d 100644
--- a/kate/app/katefilelist.cpp
+++ b/kate/app/katefilelist.cpp
@@ -176,6 +176,8 @@ void KateFileList::keyPressEvent(TQKeyEvent *e) {
// returning
void KateFileList::contentsMousePressEvent( TQMouseEvent *e )
{
+ m_lastMouseDownPos = e->pos();
+
if ( ! itemAt( contentsToViewport( e->pos() ) ) )
return;
@@ -259,7 +261,17 @@ void KateFileList::slotActivateView( TQListViewItem *item )
if ( ! item || item->rtti() != RTTI_KateFileListItem )
return;
- viewManager->activateView( ((KateFileListItem *)item)->documentNumber() );
+ KateFileListItem *i = ((KateFileListItem*)item);
+ const KateDocumentInfo *info = KateDocManager::self()->documentInfo(i->document());
+
+ if (info && info->modifiedOnDisc) {
+ // Simulate mouse button release, otherwise the paused DND operation
+ // will reactivate as soon as the mouse re-enters the list view!
+ TQMouseEvent e(TQEvent::MouseButtonRelease, m_lastMouseDownPos, Qt::LeftButton, 0);
+ contentsMouseReleaseEvent(&e);
+ }
+
+ viewManager->activateView( i->documentNumber() );
}
void KateFileList::slotModChanged (Kate::Document *doc)