aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/lyrics/ultimatelyricsparser.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2020-08-12 21:03:34 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2020-08-12 21:03:34 +0000
commit7ef8d11baeaf1847ba7f1df5d858f8cffea9300d (patch)
treea741fb49db8834efd4b46d760b89082547eb2a9d /src/plugins/General/lyrics/ultimatelyricsparser.cpp
parent6f301f5880f7efce76ed46e7b502830642b87370 (diff)
downloadqmmp-7ef8d11baeaf1847ba7f1df5d858f8cffea9300d.tar.gz
qmmp-7ef8d11baeaf1847ba7f1df5d858f8cffea9300d.tar.bz2
qmmp-7ef8d11baeaf1847ba7f1df5d858f8cffea9300d.zip
coding style fixes
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9470 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/lyrics/ultimatelyricsparser.cpp')
-rw-r--r--src/plugins/General/lyrics/ultimatelyricsparser.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/plugins/General/lyrics/ultimatelyricsparser.cpp b/src/plugins/General/lyrics/ultimatelyricsparser.cpp
index 7f3ffaa14..ef9f70dd7 100644
--- a/src/plugins/General/lyrics/ultimatelyricsparser.cpp
+++ b/src/plugins/General/lyrics/ultimatelyricsparser.cpp
@@ -24,6 +24,7 @@
#include <QXmlStreamReader>
#include <QFile>
#include <QtDebug>
+#include <algorithm>
#if (QT_VERSION < QT_VERSION_CHECK(5, 7, 0)) //qAsConst template
#include <qmmp/qmmp.h>
#endif
@@ -135,17 +136,13 @@ const QList<LyricsProvider *> &UltimateLyricsParser::providers()
LyricsProvider *UltimateLyricsParser::provider(const QString &name) const
{
- for(LyricsProvider *provider : qAsConst(m_providers))
- {
- if(provider->name() == name)
- return provider;
- }
- return nullptr;
+ auto it = std::find_if(m_providers.cbegin(), m_providers.cend(), [name](LyricsProvider *provider){ return provider->name() == name; });
+ return it == m_providers.cend() ? nullptr : *it;
}
-QStringList UltimateLyricsParser::defaultProviders()
+const QStringList &UltimateLyricsParser::defaultProviders()
{
- QStringList out = {
+ static const QStringList out = {
"lyrics.wikia.com",
"Encyclopaedia Metallum",
"letras.mus.br",