From 188754a3e5b298683b88fbe6786c524c172ed6a9 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Thu, 21 Feb 2008 12:49:11 +0000 Subject: Let the DolphinController be aware on which QAbstractItemView instance he is working. This allows to connect signals from the view implementations (icons view, details view, column view) directly to the slots of the DolphinController without a helper slot. svn path=/trunk/KDE/kdebase/apps/; revision=777737 --- src/dolphindetailsview.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/dolphindetailsview.cpp') diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index f364900b6..b17164d8b 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -97,7 +97,7 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr // RETURN-key in keyPressEvent(). if (KGlobalSettings::singleClick()) { connect(this, SIGNAL(clicked(const QModelIndex&)), - this, SLOT(triggerItem(const QModelIndex&))); + controller, SLOT(triggerItem(const QModelIndex&))); if (DolphinSettings::instance().generalSettings()->showSelectionToggle()) { SelectionManager* selManager = new SelectionManager(this); connect(selManager, SIGNAL(selectionChanged()), @@ -107,7 +107,7 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr } } else { connect(this, SIGNAL(doubleClicked(const QModelIndex&)), - this, SLOT(triggerItem(const QModelIndex&))); + controller, SLOT(triggerItem(const QModelIndex&))); } connect(this, SIGNAL(entered(const QModelIndex&)), this, SLOT(slotEntered(const QModelIndex&))); @@ -310,7 +310,7 @@ void DolphinDetailsView::dragMoveEvent(QDragMoveEvent* event) m_dragging = false; } else { m_dragging = true; - const KFileItem item = m_controller->itemForIndex(index, this); + const KFileItem item = m_controller->itemForIndex(index); if (!item.isNull() && item.isDir()) { m_dropRect = visualRect(index); } else { @@ -333,7 +333,7 @@ void DolphinDetailsView::dropEvent(QDropEvent* event) const QModelIndex index = indexAt(event->pos()); KFileItem item; if (index.isValid() && (index.column() == DolphinModel::Name)) { - item = m_controller->itemForIndex(index, this); + item = m_controller->itemForIndex(index); } m_controller->indicateDroppedUrls(urls, m_controller->url(), @@ -372,7 +372,7 @@ void DolphinDetailsView::paintEvent(QPaintEvent* event) void DolphinDetailsView::keyPressEvent(QKeyEvent* event) { QTreeView::keyPressEvent(event); - m_controller->handleKeyPressEvent(event, this); + m_controller->handleKeyPressEvent(event); } void DolphinDetailsView::resizeEvent(QResizeEvent* event) @@ -420,7 +420,7 @@ void DolphinDetailsView::slotEntered(const QModelIndex& index) const QPoint pos = viewport()->mapFromGlobal(QCursor::pos()); const int nameColumnWidth = header()->sectionSize(DolphinModel::Name); if (pos.x() < nameColumnWidth) { - m_controller->emitItemEntered(index, this); + m_controller->emitItemEntered(index); } else { m_controller->emitViewportEntered(); @@ -470,11 +470,6 @@ void DolphinDetailsView::zoomOut() } } -void DolphinDetailsView::triggerItem(const QModelIndex& index) -{ - m_controller->triggerItem(index, this); -} - void DolphinDetailsView::configureColumns(const QPoint& pos) { KMenu popup(this); -- cgit v1.3