X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/3d4e6938f57fcf010b4fda7255384098327eb67d..80ad31f00a6c2bfa54f7164aa2a5c9f6b30f1eab:/src/dolphinview.cpp diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 4b221a0e3..d6c5f6c25 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -86,9 +86,6 @@ DolphinView::DolphinView(QWidget* parent, m_topLayout->setSpacing(0); m_topLayout->setMargin(0); - connect(m_dirLister, SIGNAL(completed()), - this, SLOT(updateCutItems())); - m_controller = new DolphinController(this); m_controller->setUrl(url); @@ -230,7 +227,7 @@ void DolphinView::setShowPreview(bool show) m_iconManager->setShowPreview(show); emit showPreviewChanged(); - loadDirectory(viewPropsUrl, true); + loadDirectory(viewPropsUrl); } bool DolphinView::showPreview() const @@ -251,7 +248,7 @@ void DolphinView::setShowHiddenFiles(bool show) m_dirLister->setShowingDotFiles(show); emit showHiddenFilesChanged(); - loadDirectory(viewPropsUrl, true); + loadDirectory(viewPropsUrl); } bool DolphinView::showHiddenFiles() const @@ -455,7 +452,7 @@ void DolphinView::setAdditionalInfo(KFileItemDelegate::InformationList info) if (itemView() != m_detailsView) { // the details view requires no reloading of the directory, as it maps // the file item delegate info to its columns internally - loadDirectory(viewPropsUrl, true); + loadDirectory(viewPropsUrl); } } @@ -540,17 +537,26 @@ void DolphinView::mouseReleaseEvent(QMouseEvent* event) void DolphinView::wheelEvent(QWheelEvent* event) { - if ((event->modifiers() & Qt::ControlModifier) == Qt::ControlModifier) { - int d = event->delta(); - if (d > 0 && isZoomInPossible()) { + if (event->modifiers() & Qt::ControlModifier) { + const int delta = event->delta(); + if ((delta > 0) && isZoomInPossible()) { zoomIn(); - } else if (d < 0 && isZoomOutPossible()) { + } else if ((delta < 0) && isZoomOutPossible()) { zoomOut(); } - event->accept(); + event->accept(); } } +bool DolphinView::eventFilter(QObject* watched, QEvent* event) +{ + if ((watched == itemView()) && (event->type() == QEvent::FocusIn)) { + m_controller->requestActivation(); + } + + return QWidget::eventFilter(watched, event); +} + void DolphinView::activate() { setActive(true); @@ -900,6 +906,9 @@ void DolphinView::createView() } Q_ASSERT(view != 0); + view->installEventFilter(this); + + m_controller->setItemView(view); m_fileItemDelegate = new KFileItemDelegate(view); view->setItemDelegate(m_fileItemDelegate);