DolphinViewController* dolphinViewController,
const ViewModeController* viewModeController) :
QObject(view),
- m_appliedPointingHandCursor(false),
m_view(view),
m_dolphinViewController(dolphinViewController),
m_toolTipManager(0),
this, SLOT(slotNameFilterChanged(const QString&)));
view->viewport()->installEventFilter(this);
-
- // Apply a pointing-hand cursor when hovering files
- connect(view, SIGNAL(entered(const QModelIndex&)), SLOT(applyPointingHandCursor()));
- connect(view, SIGNAL(viewportEntered()), SLOT(restoreCursor()));
- connect(viewModeController, SIGNAL(urlChanged(const KUrl&)), SLOT(restoreCursor()));
}
ViewExtensionsFactory::~ViewExtensionsFactory()
bool ViewExtensionsFactory::eventFilter(QObject* watched, QEvent* event)
{
Q_UNUSED(watched);
-
- switch (event->type()) {
- case QEvent::Wheel:
- if (m_selectionManager != 0) {
- m_selectionManager->reset();
- }
- break;
-
- case QEvent::Leave:
- restoreCursor();
- break;
-
- default: break;
+ if ((event->type() == QEvent::Wheel) && (m_selectionManager != 0)) {
+ m_selectionManager->reset();
}
-
return false;
}
m_dolphinViewController->requestActivation();
}
-void ViewExtensionsFactory::applyPointingHandCursor()
-{
- if (!m_appliedPointingHandCursor && !(QApplication::mouseButtons() & Qt::LeftButton)) {
- QApplication::setOverrideCursor(QCursor(Qt::PointingHandCursor));
- m_appliedPointingHandCursor = true;
- }
-}
-
-void ViewExtensionsFactory::restoreCursor()
-{
- if (m_appliedPointingHandCursor) {
- QApplication::restoreOverrideCursor();
- m_appliedPointingHandCursor = false;
- }
-}
-
DolphinSortFilterProxyModel* ViewExtensionsFactory::proxyModel() const
{
return static_cast<DolphinSortFilterProxyModel*>(m_view->model());