Changeset View
Changeset View
Standalone View
Standalone View
src/view/katestatusbar.cpp
Show First 20 Lines • Show All 319 Lines • ▼ Show 20 Line(s) | |||||
320 | } | 320 | } | ||
321 | 321 | | |||
322 | void KateStatusBar::updateDictionary() | 322 | void KateStatusBar::updateDictionary() | ||
323 | { | 323 | { | ||
324 | QString newDict; | 324 | QString newDict; | ||
325 | // Check if at the current cursor position is a special dictionary in use | 325 | // Check if at the current cursor position is a special dictionary in use | ||
326 | KTextEditor::Cursor position(m_view->cursorPositionVirtual()); | 326 | KTextEditor::Cursor position(m_view->cursorPositionVirtual()); | ||
327 | const QList<QPair<KTextEditor::MovingRange *, QString>> dictRanges = m_view->doc()->dictionaryRanges(); | 327 | const QList<QPair<KTextEditor::MovingRange *, QString>> dictRanges = m_view->doc()->dictionaryRanges(); | ||
328 | for (auto rangeDictPair : dictRanges) { | 328 | for (const auto &rangeDictPair : dictRanges) { | ||
329 | const KTextEditor::MovingRange *range = rangeDictPair.first; | 329 | const KTextEditor::MovingRange *range = rangeDictPair.first; | ||
330 | if (range->contains(position) || range->end() == position) { | 330 | if (range->contains(position) || range->end() == position) { | ||
331 | newDict = rangeDictPair.second; | 331 | newDict = rangeDictPair.second; | ||
332 | break; | 332 | break; | ||
333 | } | 333 | } | ||
334 | } | 334 | } | ||
335 | // Check if the default dictionary is in use | 335 | // Check if the default dictionary is in use | ||
336 | if (newDict.isEmpty()) { | 336 | if (newDict.isEmpty()) { | ||
▲ Show 20 Lines • Show All 253 Lines • Show Last 20 Lines |