diff options
| author | Frank Reininghaus <[email protected]> | 2011-10-14 09:21:19 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2011-10-14 09:21:19 +0200 |
| commit | 1abb47fba752e16b9a7d4fb8f483b239749c5f4d (patch) | |
| tree | a99c79ebb2e9364083c02dc4b22bce721963ecf6 /src/views/dolphinview.cpp | |
| parent | d7c4fdedd0dcca4465eaf68a1904cde46c33a74c (diff) | |
Activate the DolphinView if the KItemListContainer gets focus
This is needed in the case that the view is split to make the
DolphinMainWindow aware of the view which is currently active.
Diffstat (limited to 'src/views/dolphinview.cpp')
| -rw-r--r-- | src/views/dolphinview.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 441c7e276..f2f434f46 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -164,6 +164,7 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) : m_container = new DolphinItemListContainer(m_dirLister, this); m_container->setVisibleRoles(QList<QByteArray>() << "name"); + m_container->installEventFilter(this); KItemListController* controller = m_container->controller(); controller->setSelectionBehavior(KItemListController::MultiSelection); @@ -695,10 +696,20 @@ void DolphinView::setCategorizedSorting(bool categorized) emit categorizedSortingChanged(categorized); } -void DolphinView::mouseReleaseEvent(QMouseEvent* event) +bool DolphinView::eventFilter(QObject* watched, QEvent* event) { - QWidget::mouseReleaseEvent(event); - setActive(true); + switch (event->type()) { + case QEvent::FocusIn: + if (watched == m_container) { + setActive(true); + } + break; + + default: + break; + } + + return QWidget::eventFilter(watched, event); } void DolphinView::activate() |
