mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
don't load directories when hovering folders during moving the mouse...
svn path=/trunk/KDE/kdebase/apps/; revision=693757
This commit is contained in:
parent
dcac8012b6
commit
14783157ba
1 changed files with 23 additions and 2 deletions
|
@ -71,6 +71,8 @@ protected:
|
|||
virtual void dragMoveEvent(QDragMoveEvent* event);
|
||||
virtual void dropEvent(QDropEvent* event);
|
||||
virtual void mousePressEvent(QMouseEvent* event);
|
||||
virtual void mouseMoveEvent(QMouseEvent* event);
|
||||
virtual void mouseReleaseEvent(QMouseEvent* event);
|
||||
virtual void paintEvent(QPaintEvent* event);
|
||||
virtual void contextMenuEvent(QContextMenuEvent* event);
|
||||
|
||||
|
@ -83,6 +85,7 @@ private:
|
|||
|
||||
private:
|
||||
bool m_active;
|
||||
bool m_swallowMouseMoveEvents;;
|
||||
DolphinColumnView* m_view;
|
||||
KUrl m_url;
|
||||
QStyleOptionViewItem m_viewOptions;
|
||||
|
@ -96,6 +99,7 @@ ColumnWidget::ColumnWidget(QWidget* parent,
|
|||
const KUrl& url) :
|
||||
QListView(parent),
|
||||
m_active(true),
|
||||
m_swallowMouseMoveEvents(false),
|
||||
m_view(columnView),
|
||||
m_url(url),
|
||||
m_dragging(false),
|
||||
|
@ -232,8 +236,6 @@ void ColumnWidget::mousePressEvent(QMouseEvent* event)
|
|||
{
|
||||
if (m_active) {
|
||||
selectionModel()->clear();
|
||||
QListView::mousePressEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
QListView::mousePressEvent(event);
|
||||
|
@ -252,6 +254,10 @@ void ColumnWidget::mousePressEvent(QMouseEvent* event)
|
|||
} else {
|
||||
// a click on the viewport has been done
|
||||
requestActivation = true;
|
||||
|
||||
// Swallow mouse move events if a click is done on the viewport. Otherwise the QColumnView
|
||||
// triggers an unwanted loading of directories on hovering folder items.
|
||||
m_swallowMouseMoveEvents = true;
|
||||
}
|
||||
|
||||
if (requestActivation) {
|
||||
|
@ -261,6 +267,21 @@ void ColumnWidget::mousePressEvent(QMouseEvent* event)
|
|||
}
|
||||
}
|
||||
|
||||
void ColumnWidget::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
// see description in ColumnView::mousePressEvent()
|
||||
if (!m_swallowMouseMoveEvents) {
|
||||
QListView::mouseMoveEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void ColumnWidget::mouseReleaseEvent(QMouseEvent* event)
|
||||
{
|
||||
QListView::mouseReleaseEvent(event);
|
||||
m_swallowMouseMoveEvents = false;
|
||||
}
|
||||
|
||||
|
||||
void ColumnWidget::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
QListView::paintEvent(event);
|
||||
|
|
Loading…
Reference in a new issue