MCPcopy Create free account
hub / github.com/KDE/kdevelop / updateTimerInterval

Method updateTimerInterval

plugins/quickopen/quickopenwidget.cpp:149–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149void QuickOpenWidget::updateTimerInterval(bool cheapFilterChange)
150{
151 const int MAX_ITEMS = 10000;
152 if (cheapFilterChange && m_model->rowCount(QModelIndex()) < MAX_ITEMS) {
153 // cheap change and there are currently just a few items,
154 // so apply filter instantly
155 m_filterTimer.setInterval(0);
156 } else if (m_model->unfilteredRowCount() < MAX_ITEMS) {
157 // not a cheap change, but there are generally
158 // just a few items in the list: apply filter instantly
159 m_filterTimer.setInterval(0);
160 } else {
161 // otherwise use a timer to prevent sluggishness while typing
162 m_filterTimer.setInterval(300);
163 }
164}
165
166void QuickOpenWidget::showEvent(QShowEvent* e)
167{

Callers

nothing calls this directly

Calls 3

unfilteredRowCountMethod · 0.80
QModelIndexClass · 0.50
rowCountMethod · 0.45

Tested by

no test coverage detected