diff options
| author | Peter Penz <[email protected]> | 2007-06-02 15:03:03 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-06-02 15:03:03 +0000 |
| commit | eda07dc98644978c7134857c429507babf5ae57d (patch) | |
| tree | 0fcf5c907ae9e27d793d79f121a11c05a3790086 /src/dolphindetailsview.cpp | |
| parent | d20078be2e65533fccb79ead44090cb717f7289e (diff) | |
* Fix triggering an assertion when the elastic band is already hidden.
* Assure that the selection gets cleared if a click on the viewport is done.
svn path=/trunk/KDE/kdebase/apps/; revision=670759
Diffstat (limited to 'src/dolphindetailsview.cpp')
| -rw-r--r-- | src/dolphindetailsview.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 998d3c870..961fb15a3 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -30,6 +30,7 @@ #include <kdirmodel.h> #include <kfileitemdelegate.h> +#include <QApplication> #include <QHeaderView> #include <QRubberBand> #include <QPainter> @@ -154,6 +155,13 @@ void DolphinDetailsView::contextMenuEvent(QContextMenuEvent* event) void DolphinDetailsView::mousePressEvent(QMouseEvent* event) { + if (!indexAt(event->pos()).isValid()) { + const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers(); + if (!(modifier & Qt::ShiftModifier) && !(modifier & Qt::ControlModifier)) { + clearSelection(); + } + } + QTreeView::mousePressEvent(event); if (event->button() == Qt::LeftButton) { @@ -178,8 +186,10 @@ void DolphinDetailsView::mouseMoveEvent(QMouseEvent* event) void DolphinDetailsView::mouseReleaseEvent(QMouseEvent* event) { QTreeView::mouseReleaseEvent(event); - updateElasticBand(); - m_showElasticBand = false; + if (m_showElasticBand) { + updateElasticBand(); + m_showElasticBand = false; + } m_controller->triggerActivation(); } @@ -188,8 +198,11 @@ void DolphinDetailsView::dragEnterEvent(QDragEnterEvent* event) if (event->mimeData()->hasUrls()) { event->acceptProposedAction(); } - updateElasticBand(); - m_showElasticBand = false; + + if (m_showElasticBand) { + updateElasticBand(); + m_showElasticBand = false; + } } void DolphinDetailsView::dropEvent(QDropEvent* event) |
