Fix unwanted drag and drop continuation when file modification dialog was shown and mouse cursor subsequently moved back over the file list

pull/2/head
Timothy Pearson 10 years ago
parent 5a0695b391
commit 6d8d7bc007

@ -176,6 +176,8 @@ void KateFileList::keyPressEvent(TQKeyEvent *e) {
// returning // returning
void KateFileList::contentsMousePressEvent( TQMouseEvent *e ) void KateFileList::contentsMousePressEvent( TQMouseEvent *e )
{ {
m_lastMouseDownPos = e->pos();
if ( ! itemAt( contentsToViewport( e->pos() ) ) ) if ( ! itemAt( contentsToViewport( e->pos() ) ) )
return; return;
@ -259,7 +261,17 @@ void KateFileList::slotActivateView( TQListViewItem *item )
if ( ! item || item->rtti() != RTTI_KateFileListItem ) if ( ! item || item->rtti() != RTTI_KateFileListItem )
return; 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) void KateFileList::slotModChanged (Kate::Document *doc)

@ -166,6 +166,8 @@ class KateFileList : public TDEListView
TQListViewItem *m_clickedMenuItem; TQListViewItem *m_clickedMenuItem;
TQPoint m_lastMouseDownPos;
class ToolTip *m_tooltip; class ToolTip *m_tooltip;
}; };

Loading…
Cancel
Save