┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphindetailsview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-02-21 12:49:11 +0000
committerPeter Penz <[email protected]>2008-02-21 12:49:11 +0000
commit188754a3e5b298683b88fbe6786c524c172ed6a9 (patch)
treed17b3f04bf2fe17c380862ec3f9b28f090ca9cd2 /src/dolphindetailsview.cpp
parente287058acb772b55b679a694062361d3fb0e8f89 (diff)
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
Diffstat (limited to 'src/dolphindetailsview.cpp')
-rw-r--r--src/dolphindetailsview.cpp17
1 files changed, 6 insertions, 11 deletions
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);