]> cloud.milkyroute.net Git - dolphin.git/commitdiff
column view: fixed SHIFT modifier selection behavior
authorPeter Penz <peter.penz19@gmail.com>
Tue, 7 Aug 2007 06:34:05 +0000 (06:34 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 7 Aug 2007 06:34:05 +0000 (06:34 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=697218

src/dolphincolumnview.cpp

index 99a5fea7e177ad54767a58e04f548944c3183c50..b26fe9067c5d5281f334cddc71194831c9d0696e 100644 (file)
@@ -250,6 +250,9 @@ void ColumnWidget::mousePressEvent(QMouseEvent* event)
             const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
             if (modifier & Qt::ControlModifier) {
                 m_view->requestActivation(this);
             const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
             if (modifier & Qt::ControlModifier) {
                 m_view->requestActivation(this);
+                if (!selModel->hasSelection()) {
+                    selModel->setCurrentIndex(index, QItemSelectionModel::Select);
+                }
                 selModel->select(index, QItemSelectionModel::Toggle);
                 swallowMousePressEvent = true;
             } else if (item->isDir()) {
                 selModel->select(index, QItemSelectionModel::Toggle);
                 swallowMousePressEvent = true;
             } else if (item->isDir()) {
@@ -267,9 +270,6 @@ void ColumnWidget::mousePressEvent(QMouseEvent* event)
                 m_view->requestActivation(this);
             }
 
                 m_view->requestActivation(this);
             }
 
-            // TODO: check behavior with ShiftModifier
-            //if (modifier & Qt::ShiftModifier)
-
             // TODO: is the assumption OK that Qt::RightButton always represents the context menu button?
             if (event->button() == Qt::RightButton) {
                 swallowMousePressEvent = true;
             // TODO: is the assumption OK that Qt::RightButton always represents the context menu button?
             if (event->button() == Qt::RightButton) {
                 swallowMousePressEvent = true;