Changeset View
Changeset View
Standalone View
Standalone View
krunner/view.cpp
Show First 20 Lines • Show All 360 Lines • ▼ Show 20 Line(s) | 360 | if (item == QLatin1String("SESSIONS")) { | |||
---|---|---|---|---|---|
361 | return; | 361 | return; | ||
362 | } | 362 | } | ||
363 | 363 | | |||
364 | // Mimic shell behavior of not storing lines starting with a space | 364 | // Mimic shell behavior of not storing lines starting with a space | ||
365 | if (item.at(0).isSpace()) { | 365 | if (item.at(0).isSpace()) { | ||
366 | return; | 366 | return; | ||
367 | } | 367 | } | ||
368 | 368 | | |||
369 | // Avoid removing the same item from the front and prepending it again | ||||
370 | if (!m_history.isEmpty() && m_history.constFirst() == item) { | ||||
apol: `m_history.constFirst() == item` | |||||
371 | return; | ||||
372 | } | ||||
373 | | ||||
369 | if (!KAuthorized::authorize(QStringLiteral("lineedit_text_completion"))) { | 374 | if (!KAuthorized::authorize(QStringLiteral("lineedit_text_completion"))) { | ||
370 | return; | 375 | return; | ||
371 | } | 376 | } | ||
372 | 377 | | |||
373 | m_history.removeOne(item); | 378 | m_history.removeOne(item); | ||
374 | m_history.prepend(item); | 379 | m_history.prepend(item); | ||
375 | 380 | | |||
376 | while (m_history.count() > 50) { // make configurable? | 381 | while (m_history.count() > 50) { // make configurable? | ||
Show All 24 Lines |
m_history.constFirst() == item