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

Method restart_internal

plugins/quickopen/quickopenmodel.cpp:182–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void QuickOpenModel::restart_internal(bool keepFilterText)
183{
184 if (!keepFilterText) {
185 m_filterText.clear();
186 }
187
188 bool anyEnabled = std::any_of(m_providers.constBegin(), m_providers.constEnd(), [](const ProviderEntry& e) {
189 return e.enabled;
190 });
191
192 if (!anyEnabled) {
193 return;
194 }
195
196 for (const ProviderEntry& provider : std::as_const(m_providers)) {
197 if (!qobject_cast<QuickOpenFileSetInterface*>(provider.provider)) {
198 continue;
199 }
200
201 ///Always reset providers that implement QuickOpenFileSetInterface and have some matching scopes, because they may be needed by other providers.
202 if (m_enabledScopes.isEmpty() || !(m_enabledScopes & provider.scopes).isEmpty()) {
203 provider.provider->reset();
204 }
205 }
206
207 for (const ProviderEntry& provider : std::as_const(m_providers)) {
208 if (qobject_cast<QuickOpenFileSetInterface*>(provider.provider)) {
209 continue;
210 }
211
212 if (provider.enabled && provider.provider) {
213 provider.provider->reset();
214 }
215 }
216
217 if (keepFilterText) {
218 textChanged(m_filterText);
219 } else {
220 beginResetModel();
221 m_cachedData.clear();
222 clearExpanding();
223 endResetModel();
224 }
225}
226
227void QuickOpenModel::destroyed(QObject* obj)
228{

Callers

nothing calls this directly

Calls 5

constBeginMethod · 0.80
constEndMethod · 0.80
clearMethod · 0.45
isEmptyMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected