]> cloud.milkyroute.net Git - dolphin.git/commitdiff
start to simplify the DolphinController as preparation for the kparts DolphinViewWidg...
authorPeter Penz <peter.penz19@gmail.com>
Wed, 6 Jun 2007 20:32:03 +0000 (20:32 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 6 Jun 2007 20:32:03 +0000 (20:32 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=672357

src/dolphincontroller.cpp
src/dolphincontroller.h
src/dolphindetailsview.cpp
src/dolphinview.cpp

index 4f8d8c96f07094404b25ac73738b2a9d5076b998..378c1b4ba86d443999d824ea36d84c70ea003bbe 100644 (file)
@@ -102,9 +102,4 @@ void DolphinController::emitViewportEntered()
     emit viewportEntered();
 }
 
     emit viewportEntered();
 }
 
-void DolphinController::indicateSelectionChange()
-{
-    emit selectionChanged();
-}
-
 #include "dolphincontroller.moc"
 #include "dolphincontroller.moc"
index 1f277e133d632a815fd133d0797b222318d957a1..ccf4e48795f17a7b7fa8673ccb588b4c4b554d60 100644 (file)
@@ -101,8 +101,6 @@ public slots:
      */
     void emitViewportEntered();
 
      */
     void emitViewportEntered();
 
-    void indicateSelectionChange();
-
 signals:
     /**
      * Is emitted if a context menu should be opened.
 signals:
     /**
      * Is emitted if a context menu should be opened.
@@ -163,9 +161,6 @@ signals:
      * the viewport. */
     void viewportEntered();
 
      * the viewport. */
     void viewportEntered();
 
-    /** Is emitted if the selection has been changed by the user. */
-    void selectionChanged();
-
     /** Is emitted if the view should zoom in. */
     void zoomIn();
 
     /** Is emitted if the view should zoom in. */
     void zoomIn();
 
index 66ca9bf8177eef6913a8d61d86ac718872abb882..098fc46a064be178cd218bbe61197585d7c9e9b9 100644 (file)
@@ -155,15 +155,16 @@ void DolphinDetailsView::contextMenuEvent(QContextMenuEvent* event)
 
 void DolphinDetailsView::mousePressEvent(QMouseEvent* event)
 {
 
 void DolphinDetailsView::mousePressEvent(QMouseEvent* event)
 {
-    if (!indexAt(event->pos()).isValid()) {
+    QTreeView::mousePressEvent(event);
+
+    const QModelIndex index = indexAt(event->pos());
+    if (!index.isValid() || (index.column() != KDirModel::Name)) {
         const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
         if (!(modifier & Qt::ShiftModifier) && !(modifier & Qt::ControlModifier)) {
             clearSelection();
         }
     }
 
         const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
         if (!(modifier & Qt::ShiftModifier) && !(modifier & Qt::ControlModifier)) {
             clearSelection();
         }
     }
 
-    QTreeView::mousePressEvent(event);
-
     if (event->button() == Qt::LeftButton) {
         m_showElasticBand = true;
 
     if (event->button() == Qt::LeftButton) {
         m_showElasticBand = true;
 
index 1e6fed77674dfe702c7fed8a40798e542167fe7b..16f06f2716d2058955d5c6847c918a7c0aa34839 100644 (file)
@@ -157,8 +157,6 @@ DolphinView::DolphinView(DolphinMainWindow* mainWindow,
             this, SLOT(updateSortOrder(Qt::SortOrder)));
     connect(m_controller, SIGNAL(itemTriggered(const QModelIndex&)),
             this, SLOT(triggerItem(const QModelIndex&)));
             this, SLOT(updateSortOrder(Qt::SortOrder)));
     connect(m_controller, SIGNAL(itemTriggered(const QModelIndex&)),
             this, SLOT(triggerItem(const QModelIndex&)));
-    connect(m_controller, SIGNAL(selectionChanged()),
-            this, SLOT(emitSelectionChangedSignal()));
     connect(m_controller, SIGNAL(activated()),
             this, SLOT(requestActivation()));
     connect(m_controller, SIGNAL(itemEntered(const QModelIndex&)),
     connect(m_controller, SIGNAL(activated()),
             this, SLOT(requestActivation()));
     connect(m_controller, SIGNAL(itemEntered(const QModelIndex&)),
@@ -1275,7 +1273,7 @@ void DolphinView::createView()
     m_topLayout->insertWidget(1, view);
 
     connect(view->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
     m_topLayout->insertWidget(1, view);
 
     connect(view->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
-            m_controller, SLOT(indicateSelectionChange()));
+            this, SLOT(emitSelectionChangedSignal()));
     connect(view->verticalScrollBar(), SIGNAL(valueChanged(int)),
             this, SLOT(emitContentsMoved()));
     connect(view->horizontalScrollBar(), SIGNAL(valueChanged(int)),
     connect(view->verticalScrollBar(), SIGNAL(valueChanged(int)),
             this, SLOT(emitContentsMoved()));
     connect(view->horizontalScrollBar(), SIGNAL(valueChanged(int)),