aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/general.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmmpui/general.cpp')
-rw-r--r--src/qmmpui/general.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/qmmpui/general.cpp b/src/qmmpui/general.cpp
index 0ca8e2fb0..592bdf894 100644
--- a/src/qmmpui/general.cpp
+++ b/src/qmmpui/general.cpp
@@ -100,12 +100,9 @@ QList<GeneralFactory *> General::enabledFactories()
QString General::file(const GeneralFactory *factory)
{
loadPlugins();
- for(const QmmpUiPluginCache *item : qAsConst(*m_cache))
- {
- if(item->shortName() == factory->properties().shortName)
- return item->file();
- }
- return QString();
+ auto it = std::find_if(m_cache->cbegin(), m_cache->cend(),
+ [factory] (QmmpUiPluginCache *item){ return item->shortName() == factory->properties().shortName; } );
+ return it == m_cache->cend() ? QString() : (*it)->file();
}
void General::setEnabled(GeneralFactory* factory, bool enable)