X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/dcbf1a11783d47e7e4fa30d488ac93a8bc547e71..b9f1ebca009cb3da36ebc3d4537aedcc69770077:/src/dolphincontroller.cpp diff --git a/src/dolphincontroller.cpp b/src/dolphincontroller.cpp index fe8c426f3..980e16059 100644 --- a/src/dolphincontroller.cpp +++ b/src/dolphincontroller.cpp @@ -26,10 +26,11 @@ #include #include +Qt::MouseButtons DolphinController::m_mouseButtons = Qt::NoButton; + DolphinController::DolphinController(DolphinView* dolphinView) : QObject(dolphinView), m_zoomLevel(0), - m_mouseButtons(Qt::NoButton), m_url(), m_dolphinView(dolphinView), m_itemView(0) @@ -59,7 +60,7 @@ void DolphinController::setItemView(QAbstractItemView* view) if (m_itemView != 0) { m_zoomLevel = ZoomLevelInfo::zoomLevelForIconSize(m_itemView->iconSize()); - + // TODO: this is a workaround until Qt-issue 176832 has been fixed connect(m_itemView, SIGNAL(pressed(const QModelIndex&)), this, SLOT(updateMouseButtonState())); @@ -129,12 +130,13 @@ void DolphinController::handleKeyPressEvent(QKeyEvent* event) const QItemSelectionModel* selModel = m_itemView->selectionModel(); const QModelIndex currentIndex = selModel->currentIndex(); const bool trigger = currentIndex.isValid() - && (event->key() == Qt::Key_Return) + && ((event->key() == Qt::Key_Return) + || (event->key() == Qt::Key_Enter)) && (selModel->selectedIndexes().count() > 0); if (trigger) { const QModelIndexList indexList = selModel->selectedIndexes(); foreach (const QModelIndex& index, indexList) { - triggerItem(index); + emit itemTriggered(itemForIndex(index)); } } } @@ -178,9 +180,6 @@ void DolphinController::triggerItem(const QModelIndex& index) m_itemView->clearSelection(); emit itemEntered(KFileItem()); } - m_mouseButtons = Qt::NoButton; - } else if (m_mouseButtons & Qt::RightButton) { - m_mouseButtons = Qt::NoButton; } } @@ -194,9 +193,6 @@ void DolphinController::requestTab(const QModelIndex& index) if (validRequest) { emit tabRequested(item.url()); } - m_mouseButtons = Qt::NoButton; - } else if (m_mouseButtons & Qt::RightButton) { - m_mouseButtons = Qt::NoButton; } }