Changeset View
Changeset View
Standalone View
Standalone View
kate/katequickopen.cpp
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Line(s) | 140 | { | |||
---|---|---|---|---|---|
141 | QModelIndex index = m_model->index(0, 0); | 141 | QModelIndex index = m_model->index(0, 0); | ||
142 | m_listView->setCurrentIndex(index); | 142 | m_listView->setCurrentIndex(index); | ||
143 | } | 143 | } | ||
144 | 144 | | |||
145 | void KateQuickOpen::update() | 145 | void KateQuickOpen::update() | ||
146 | { | 146 | { | ||
147 | /** | 147 | /** | ||
148 | * new base mode creation | 148 | * new base mode creation | ||
149 | * remove from proxy model before populating to avoid wasting time | ||||
150 | * with repeatedly sorting it | ||||
149 | */ | 151 | */ | ||
150 | m_base_model->clear(); | 152 | m_base_model->clear(); | ||
153 | m_model->setSourceModel(nullptr); | ||||
151 | 154 | | |||
152 | /** | 155 | /** | ||
153 | * remember local file names to avoid dupes with project files | 156 | * remember local file names to avoid dupes with project files | ||
154 | */ | 157 | */ | ||
155 | QSet<QString> alreadySeenFiles; | 158 | QSet<QString> alreadySeenFiles; | ||
156 | QSet<KTextEditor::Document *> alreadySeenDocs; | 159 | QSet<KTextEditor::Document *> alreadySeenDocs; | ||
157 | 160 | | |||
158 | /** | 161 | /** | ||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | |||||
262 | } | 265 | } | ||
263 | 266 | | |||
264 | if (idxToSelect.isValid()) { | 267 | if (idxToSelect.isValid()) { | ||
265 | m_listView->setCurrentIndex(m_model->mapFromSource(idxToSelect)); | 268 | m_listView->setCurrentIndex(m_model->mapFromSource(idxToSelect)); | ||
266 | } else { | 269 | } else { | ||
267 | reselectFirst(); | 270 | reselectFirst(); | ||
268 | } | 271 | } | ||
269 | 272 | | |||
273 | m_model->setSourceModel(m_base_model); | ||||
274 | | ||||
270 | /** | 275 | /** | ||
271 | * adjust view | 276 | * adjust view | ||
272 | */ | 277 | */ | ||
273 | m_listView->resizeColumnToContents(0); | 278 | m_listView->resizeColumnToContents(0); | ||
274 | } | 279 | } | ||
275 | 280 | | |||
276 | void KateQuickOpen::slotReturnPressed() | 281 | void KateQuickOpen::slotReturnPressed() | ||
277 | { | 282 | { | ||
Show All 22 Lines |