From: Peter Penz Date: Wed, 6 Jun 2007 20:32:03 +0000 (+0000) Subject: start to simplify the DolphinController as preparation for the kparts DolphinViewWidg... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/5de9950182b5a1b0b99e4cc51e48d4d83b6bef24 start to simplify the DolphinController as preparation for the kparts DolphinViewWidget (as discussed with David) svn path=/trunk/KDE/kdebase/apps/; revision=672357 --- diff --git a/src/dolphincontroller.cpp b/src/dolphincontroller.cpp index 4f8d8c96f..378c1b4ba 100644 --- a/src/dolphincontroller.cpp +++ b/src/dolphincontroller.cpp @@ -102,9 +102,4 @@ void DolphinController::emitViewportEntered() emit viewportEntered(); } -void DolphinController::indicateSelectionChange() -{ - emit selectionChanged(); -} - #include "dolphincontroller.moc" diff --git a/src/dolphincontroller.h b/src/dolphincontroller.h index 1f277e133..ccf4e4879 100644 --- a/src/dolphincontroller.h +++ b/src/dolphincontroller.h @@ -101,8 +101,6 @@ public slots: */ void emitViewportEntered(); - void indicateSelectionChange(); - signals: /** * Is emitted if a context menu should be opened. @@ -163,9 +161,6 @@ signals: * 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(); diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 66ca9bf81..098fc46a0 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -155,15 +155,16 @@ void DolphinDetailsView::contextMenuEvent(QContextMenuEvent* 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(); } } - QTreeView::mousePressEvent(event); - if (event->button() == Qt::LeftButton) { m_showElasticBand = true; diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 1e6fed776..16f06f271 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -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&))); - connect(m_controller, SIGNAL(selectionChanged()), - this, SLOT(emitSelectionChangedSignal())); 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_controller, SLOT(indicateSelectionChange())); + this, SLOT(emitSelectionChangedSignal())); connect(view->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(emitContentsMoved())); connect(view->horizontalScrollBar(), SIGNAL(valueChanged(int)),