Changeset View
Changeset View
Standalone View
Standalone View
src/kitemviews/kitemlistselectionmanager.cpp
Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Line(s) | 229 | foreach (const KItemRange& itemRange, itemRanges) { | |||
---|---|---|---|---|---|
230 | if (m_currentItem < itemRange.index) { | 230 | if (m_currentItem < itemRange.index) { | ||
231 | break; | 231 | break; | ||
232 | } | 232 | } | ||
233 | inc += itemRange.count; | 233 | inc += itemRange.count; | ||
234 | } | 234 | } | ||
235 | // Calling setCurrentItem would trigger the selectionChanged signal, but we want to | 235 | // Calling setCurrentItem would trigger the selectionChanged signal, but we want to | ||
236 | // emit it only once in this function -> change the current item manually and emit currentChanged | 236 | // emit it only once in this function -> change the current item manually and emit currentChanged | ||
237 | m_currentItem += inc; | 237 | m_currentItem += inc; | ||
238 | if (m_currentItem >= m_model->count()) { | ||||
239 | m_currentItem = -1; | ||||
240 | } | ||||
238 | emit currentChanged(m_currentItem, previousCurrent); | 241 | emit currentChanged(m_currentItem, previousCurrent); | ||
239 | } | 242 | } | ||
240 | 243 | | |||
241 | // Update the anchor item | 244 | // Update the anchor item | ||
242 | if (m_anchorItem < 0) { | 245 | if (m_anchorItem < 0) { | ||
243 | m_anchorItem = 0; | 246 | m_anchorItem = 0; | ||
244 | } else { | 247 | } else { | ||
245 | int inc = 0; | 248 | int inc = 0; | ||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |