Clang-Tidy and Clazy fixes
This commit is contained in:
@@ -209,7 +209,7 @@ void GeniusLyricsProvider::RequestAccessToken(const QUrl &url, const QUrl &redir
|
||||
|
||||
}
|
||||
|
||||
void GeniusLyricsProvider::HandleLoginSSLErrors(QList<QSslError> ssl_errors) {
|
||||
void GeniusLyricsProvider::HandleLoginSSLErrors(const QList<QSslError> &ssl_errors) {
|
||||
|
||||
for (const QSslError &ssl_error : ssl_errors) {
|
||||
login_errors_ += ssl_error.errorString();
|
||||
@@ -543,7 +543,7 @@ void GeniusLyricsProvider::Error(const QString &error, const QVariant &debug) {
|
||||
|
||||
}
|
||||
|
||||
void GeniusLyricsProvider::EndSearch(std::shared_ptr<GeniusLyricsSearchContext> search, const GeniusLyricsLyricContext lyric) {
|
||||
void GeniusLyricsProvider::EndSearch(std::shared_ptr<GeniusLyricsSearchContext> search, const GeniusLyricsLyricContext &lyric) {
|
||||
|
||||
if (search->requests_lyric_.contains(lyric.url)) {
|
||||
search->requests_lyric_.remove(lyric.url);
|
||||
|
||||
@@ -76,10 +76,10 @@ class GeniusLyricsProvider : public JsonLyricsProvider {
|
||||
void RequestAccessToken(const QUrl &url, const QUrl &redirect_url);
|
||||
void AuthError(const QString &error = QString(), const QVariant &debug = QVariant());
|
||||
void Error(const QString &error, const QVariant &debug = QVariant()) override;
|
||||
void EndSearch(std::shared_ptr<GeniusLyricsSearchContext> search, const GeniusLyricsLyricContext lyric = GeniusLyricsLyricContext());
|
||||
void EndSearch(std::shared_ptr<GeniusLyricsSearchContext> search, const GeniusLyricsLyricContext &lyric = GeniusLyricsLyricContext());
|
||||
|
||||
private slots:
|
||||
void HandleLoginSSLErrors(QList<QSslError> ssl_errors);
|
||||
void HandleLoginSSLErrors(const QList<QSslError> &ssl_errors);
|
||||
void RedirectArrived();
|
||||
void AccessTokenRequestFinished(QNetworkReply *reply);
|
||||
void HandleSearchReply(QNetworkReply *reply, const quint64 id);
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
@@ -28,6 +30,8 @@
|
||||
#include "lyricsfetcher.h"
|
||||
#include "lyricsfetchersearch.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
const int LyricsFetcher::kMaxConcurrentRequests = 5;
|
||||
|
||||
LyricsFetcher::LyricsFetcher(LyricsProviders *lyrics_providers, QObject *parent)
|
||||
@@ -36,7 +40,7 @@ LyricsFetcher::LyricsFetcher(LyricsProviders *lyrics_providers, QObject *parent)
|
||||
next_id_(0),
|
||||
request_starter_(new QTimer(this)) {
|
||||
|
||||
request_starter_->setInterval(500);
|
||||
request_starter_->setInterval(500ms);
|
||||
QObject::connect(request_starter_, &QTimer::timeout, this, &LyricsFetcher::StartRequests);
|
||||
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ void LyricsProviders::ReloadSettings() {
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup(LyricsSettingsPage::kSettingsGroup);
|
||||
QStringList providers_enabled = s.value("providers", QStringList() << all_providers.values()).toStringList();
|
||||
QStringList providers_enabled = s.value("providers", QStringList() << all_providers.values()).toStringList(); // clazy:exclude=qt6-deprecated-api-fixes
|
||||
s.endGroup();
|
||||
|
||||
int i = 0;
|
||||
@@ -69,7 +69,7 @@ void LyricsProviders::ReloadSettings() {
|
||||
if (provider) {
|
||||
provider->set_enabled(true);
|
||||
provider->set_order(++i);
|
||||
new_providers << provider;
|
||||
new_providers << provider; // clazy:exclude=reserve-candidates
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user