Changeset View
Changeset View
Standalone View
Standalone View
effects.cpp
Show First 20 Lines • Show All 1363 Lines • ▼ Show 20 Line(s) | 1362 | if ((*it).first == name) { | |||
---|---|---|---|---|---|
1364 | makeOpenGLContextCurrent(); | 1364 | makeOpenGLContextCurrent(); | ||
1365 | (*it).second->reconfigure(Effect::ReconfigureAll); | 1365 | (*it).second->reconfigure(Effect::ReconfigureAll); | ||
1366 | return; | 1366 | return; | ||
1367 | } | 1367 | } | ||
1368 | } | 1368 | } | ||
1369 | 1369 | | |||
1370 | bool EffectsHandlerImpl::isEffectLoaded(const QString& name) const | 1370 | bool EffectsHandlerImpl::isEffectLoaded(const QString& name) const | ||
1371 | { | 1371 | { | ||
1372 | for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) | 1372 | auto it = std::find_if(loaded_effects.constBegin(), loaded_effects.constEnd(), | ||
1373 | if ((*it).first == name) | 1373 | [&name](const EffectPair &pair) { return pair.first == name; }); | ||
broulik: Capture `&name` by reference | |||||
1374 | return true; | 1374 | return it != loaded_effects.constEnd(); | ||
1375 | | ||||
1376 | return false; | | |||
1377 | } | 1375 | } | ||
1378 | 1376 | | |||
1379 | bool EffectsHandlerImpl::isEffectSupported(const QString &name) | 1377 | bool EffectsHandlerImpl::isEffectSupported(const QString &name) | ||
1380 | { | 1378 | { | ||
1381 | // if the effect is loaded, it is obviously supported | 1379 | // If the effect is loaded, it is obviously supported. | ||
1382 | auto it = std::find_if(loaded_effects.constBegin(), loaded_effects.constEnd(), [name](const EffectPair &pair) { | 1380 | if (isEffectLoaded(name)) { | ||
1383 | return pair.first == name; | | |||
1384 | }); | | |||
1385 | if (it != loaded_effects.constEnd()) { | | |||
1386 | return true; | 1381 | return true; | ||
1387 | } | 1382 | } | ||
1388 | 1383 | | |||
1389 | // next checks might require a context | 1384 | // next checks might require a context | ||
1390 | makeOpenGLContextCurrent(); | 1385 | makeOpenGLContextCurrent(); | ||
1391 | m_compositor->addRepaintFull(); | 1386 | m_compositor->addRepaintFull(); | ||
1392 | 1387 | | |||
1393 | return m_effectLoader->isEffectSupported(name); | 1388 | return m_effectLoader->isEffectSupported(name); | ||
▲ Show 20 Lines • Show All 677 Lines • Show Last 20 Lines |
Capture &name by reference