MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / SetFilter

Method SetFilter

plugins/base/utils/filter-selection.cpp:253–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253void FilterSelectionWidget::SetFilter(const SourceSelection &source,
254 const FilterSelection &filter)
255{
256 _source = source;
257 PopulateSelection();
258
259 int idx = -1;
260
261 switch (filter.GetType()) {
262 case FilterSelection::Type::ALL:
263 idx = findText(obs_module_text(
264 "AdvSceneSwitcher.filterSelection.all"));
265 break;
266 case FilterSelection::Type::SOURCE: {
267 if (_filterEndIdx == -1) {
268 idx = -1;
269 break;
270 }
271 idx = FindIdxInRagne(this, _variablesEndIdx, _filterEndIdx,
272 filter.ToString());
273 break;
274 }
275 case FilterSelection::Type::VARIABLE: {
276 if (_variablesEndIdx == -1) {
277 idx = -1;
278 break;
279 }
280 idx = FindIdxInRagne(this, _selectIdx, _variablesEndIdx,
281 filter.ToString());
282 break;
283 default:
284 idx = -1;
285 break;
286 }
287 }
288 setCurrentIndex(idx);
289 _currentSelection = filter;
290}
291
292void FilterSelectionWidget::showEvent(QShowEvent *event)
293{

Callers 2

UpdateEntryDataMethod · 0.80
UpdateEntryDataMethod · 0.80

Calls 4

obs_module_textFunction · 0.85
FindIdxInRagneFunction · 0.50
GetTypeMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected