From ba2c3e89f945f337b9b68fd74a9737d00430b809 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Mon, 26 Dec 2011 22:42:49 +0100 Subject: [PATCH] Minor cleanup: Rename m_keyboardAnchorXPos to m_keyboardAnchorPos --- src/kitemviews/kitemlistcontroller.cpp | 18 +++++++++--------- src/kitemviews/kitemlistcontroller.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 0cf62f8e0..7798fc364 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -52,7 +52,7 @@ KItemListController::KItemListController(QObject* parent) : m_autoActivationTimer(0), m_oldSelection(), m_keyboardAnchorIndex(-1), - m_keyboardAnchorXPos(0) + m_keyboardAnchorPos(0) { connect(m_keyboardManager, SIGNAL(changeCurrentItem(QString,bool)), this, SLOT(slotChangeCurrentItem(QString,bool))); @@ -213,7 +213,7 @@ bool KItemListController::keyPressEvent(QKeyEvent* event) if (index > 0) { --index; m_keyboardAnchorIndex = index; - m_keyboardAnchorXPos = keyboardAnchorPos(index); + m_keyboardAnchorPos = keyboardAnchorPos(index); } break; @@ -221,7 +221,7 @@ bool KItemListController::keyPressEvent(QKeyEvent* event) if (index < itemCount - 1) { ++index; m_keyboardAnchorIndex = index; - m_keyboardAnchorXPos = keyboardAnchorPos(index); + m_keyboardAnchorPos = keyboardAnchorPos(index); } break; @@ -951,11 +951,11 @@ void KItemListController::updateKeyboardAnchor() { const bool validAnchor = m_keyboardAnchorIndex >= 0 && m_keyboardAnchorIndex < m_model->count() && - keyboardAnchorPos(m_keyboardAnchorIndex) == m_keyboardAnchorXPos; + keyboardAnchorPos(m_keyboardAnchorIndex) == m_keyboardAnchorPos; if (!validAnchor) { const int index = m_selectionManager->currentItem(); m_keyboardAnchorIndex = index; - m_keyboardAnchorXPos = keyboardAnchorPos(index); + m_keyboardAnchorPos = keyboardAnchorPos(index); } } @@ -984,10 +984,10 @@ int KItemListController::nextRowIndex() const // that is below the current index int nextRowIndex = lastColumnIndex + 1; int searchIndex = nextRowIndex; - qreal minDiff = qAbs(m_keyboardAnchorXPos - keyboardAnchorPos(nextRowIndex)); + qreal minDiff = qAbs(m_keyboardAnchorPos - keyboardAnchorPos(nextRowIndex)); while (searchIndex < maxIndex && keyboardAnchorPos(searchIndex + 1) > keyboardAnchorPos(searchIndex)) { ++searchIndex; - const qreal searchDiff = qAbs(m_keyboardAnchorXPos - keyboardAnchorPos(searchIndex)); + const qreal searchDiff = qAbs(m_keyboardAnchorPos - keyboardAnchorPos(searchIndex)); if (searchDiff < minDiff) { minDiff = searchDiff; nextRowIndex = searchIndex; @@ -1017,10 +1017,10 @@ int KItemListController::previousRowIndex() const // that is above the current index int previousRowIndex = firstColumnIndex - 1; int searchIndex = previousRowIndex; - qreal minDiff = qAbs(m_keyboardAnchorXPos - keyboardAnchorPos(previousRowIndex)); + qreal minDiff = qAbs(m_keyboardAnchorPos - keyboardAnchorPos(previousRowIndex)); while (searchIndex > 0 && keyboardAnchorPos(searchIndex - 1) < keyboardAnchorPos(searchIndex)) { --searchIndex; - const qreal searchDiff = qAbs(m_keyboardAnchorXPos - keyboardAnchorPos(searchIndex)); + const qreal searchDiff = qAbs(m_keyboardAnchorPos - keyboardAnchorPos(searchIndex)); if (searchDiff < minDiff) { minDiff = searchDiff; previousRowIndex = searchIndex; diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index b2c7d65b2..b8de195eb 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -283,7 +283,7 @@ private: * similar behavior like in a text editor: */ int m_keyboardAnchorIndex; - qreal m_keyboardAnchorXPos; + qreal m_keyboardAnchorPos; }; #endif -- 2.47.3