| 180 | } |
| 181 | |
| 182 | void 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 | |
| 227 | void QuickOpenModel::destroyed(QObject* obj) |
| 228 | { |
nothing calls this directly
no test coverage detected