Clang-Tidy and Clazy fixes
This commit is contained in:
@@ -79,9 +79,9 @@ QNetworkReply *TidalBaseRequest::CreateRequest(const QString &ressource_name, co
|
||||
|
||||
}
|
||||
|
||||
void TidalBaseRequest::HandleSSLErrors(QList<QSslError> ssl_errors) {
|
||||
void TidalBaseRequest::HandleSSLErrors(const QList<QSslError> &ssl_errors) {
|
||||
|
||||
for (QSslError &ssl_error : ssl_errors) {
|
||||
for (const QSslError &ssl_error : ssl_errors) {
|
||||
Error(ssl_error.errorString());
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ QByteArray TidalBaseRequest::GetReplyData(QNetworkReply *reply, const bool send_
|
||||
qLog(Error) << "Tidal:" << error;
|
||||
qLog(Info) << "Tidal:" << "Attempting to login.";
|
||||
NeedLogin();
|
||||
emit service_->RequestLogin();
|
||||
emit service_->RequestLogin(); // clazy:exclude=incorrect-emit
|
||||
}
|
||||
else {
|
||||
Error(error);
|
||||
|
||||
@@ -95,7 +95,7 @@ class TidalBaseRequest : public QObject {
|
||||
virtual void NeedLogin() = 0;
|
||||
|
||||
private slots:
|
||||
void HandleSSLErrors(QList<QSslError> ssl_errors);
|
||||
void HandleSSLErrors(const QList<QSslError> &ssl_errors);
|
||||
|
||||
private:
|
||||
static const char *kApiUrl;
|
||||
|
||||
@@ -197,7 +197,7 @@ void TidalFavoriteRequest::RemoveSongs(const SongList &songs) {
|
||||
RemoveFavorites(FavoriteType_Songs, songs);
|
||||
}
|
||||
|
||||
void TidalFavoriteRequest::RemoveFavorites(const FavoriteType type, const SongList songs) {
|
||||
void TidalFavoriteRequest::RemoveFavorites(const FavoriteType type, const SongList &songs) {
|
||||
|
||||
if (songs.isEmpty()) return;
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class TidalFavoriteRequest : public TidalBaseRequest {
|
||||
void Error(const QString &error, const QVariant &debug = QVariant()) override;
|
||||
QString FavoriteText(const FavoriteType type);
|
||||
void AddFavorites(const FavoriteType type, const SongList &songs);
|
||||
void RemoveFavorites(const FavoriteType type, const SongList songs);
|
||||
void RemoveFavorites(const FavoriteType type, const SongList &songs);
|
||||
void RemoveFavorites(const FavoriteType type, const QString &id, const SongList &songs);
|
||||
|
||||
TidalService *service_;
|
||||
|
||||
@@ -98,7 +98,7 @@ TidalRequest::~TidalRequest() {
|
||||
|
||||
}
|
||||
|
||||
void TidalRequest::LoginComplete(const bool success, QString error) {
|
||||
void TidalRequest::LoginComplete(const bool success, const QString &error) {
|
||||
|
||||
if (!need_login_) return;
|
||||
need_login_ = false;
|
||||
|
||||
@@ -101,7 +101,7 @@ class TidalRequest : public TidalBaseRequest {
|
||||
void AlbumCoverReceived(QNetworkReply *reply, const QString &album_id, const QUrl &url, const QString &filename);
|
||||
|
||||
public slots:
|
||||
void LoginComplete(const bool success, QString error = QString());
|
||||
void LoginComplete(const bool success, const QString &error = QString());
|
||||
|
||||
private:
|
||||
bool IsQuery() { return (type_ == QueryType_Artists || type_ == QueryType_Albums || type_ == QueryType_Songs); }
|
||||
|
||||
@@ -225,7 +225,7 @@ void TidalService::Exit() {
|
||||
|
||||
void TidalService::ExitReceived() {
|
||||
|
||||
QObject *obj = qobject_cast<QObject*>(sender());
|
||||
QObject *obj = sender();
|
||||
QObject::disconnect(obj, nullptr, this, nullptr);
|
||||
qLog(Debug) << obj << "successfully exited.";
|
||||
wait_for_exit_.removeAll(obj);
|
||||
@@ -291,7 +291,7 @@ void TidalService::ReloadSettings() {
|
||||
|
||||
}
|
||||
|
||||
void TidalService::StartAuthorization(const QString client_id) {
|
||||
void TidalService::StartAuthorization(const QString &client_id) {
|
||||
|
||||
client_id_ = client_id;
|
||||
code_verifier_ = Utilities::CryptographicRandomString(44);
|
||||
@@ -406,9 +406,9 @@ void TidalService::RequestAccessToken(const QString &code) {
|
||||
|
||||
}
|
||||
|
||||
void TidalService::HandleLoginSSLErrors(QList<QSslError> ssl_errors) {
|
||||
void TidalService::HandleLoginSSLErrors(const QList<QSslError> &ssl_errors) {
|
||||
|
||||
for (QSslError &ssl_error : ssl_errors) {
|
||||
for (const QSslError &ssl_error : ssl_errors) {
|
||||
login_errors_ += ssl_error.errorString();
|
||||
}
|
||||
|
||||
@@ -992,7 +992,7 @@ void TidalService::GetStreamURL(const QUrl &url) {
|
||||
|
||||
}
|
||||
|
||||
void TidalService::HandleStreamURLFinished(const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration, QString error) {
|
||||
void TidalService::HandleStreamURLFinished(const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration, const QString &error) {
|
||||
|
||||
TidalStreamURLRequest *stream_url_req = qobject_cast<TidalStreamURLRequest*>(sender());
|
||||
if (!stream_url_req || !stream_url_requests_.contains(stream_url_req)) return;
|
||||
|
||||
@@ -124,7 +124,7 @@ class TidalService : public InternetService {
|
||||
|
||||
public slots:
|
||||
void ShowConfig() override;
|
||||
void StartAuthorization(const QString client_id);
|
||||
void StartAuthorization(const QString &client_id);
|
||||
void TryLogin();
|
||||
void SendLogin();
|
||||
void SendLoginWithCredentials(const QString &api_token, const QString &username, const QString &password);
|
||||
@@ -139,7 +139,7 @@ class TidalService : public InternetService {
|
||||
private slots:
|
||||
void ExitReceived();
|
||||
void RequestNewAccessToken() { RequestAccessToken(); }
|
||||
void HandleLoginSSLErrors(QList<QSslError> ssl_errors);
|
||||
void HandleLoginSSLErrors(const QList<QSslError> &ssl_errors);
|
||||
void AccessTokenRequestFinished(QNetworkReply *reply);
|
||||
void HandleAuthReply(QNetworkReply *reply);
|
||||
void ResetLoginAttempts();
|
||||
@@ -157,7 +157,7 @@ class TidalService : public InternetService {
|
||||
void ArtistsUpdateProgressReceived(const int id, const int progress);
|
||||
void AlbumsUpdateProgressReceived(const int id, const int progress);
|
||||
void SongsUpdateProgressReceived(const int id, const int progress);
|
||||
void HandleStreamURLFinished(const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration, QString error = QString());
|
||||
void HandleStreamURLFinished(const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration, const QString &error = QString());
|
||||
|
||||
private:
|
||||
typedef QPair<QString, QString> Param;
|
||||
|
||||
@@ -65,7 +65,7 @@ TidalStreamURLRequest::~TidalStreamURLRequest() {
|
||||
|
||||
}
|
||||
|
||||
void TidalStreamURLRequest::LoginComplete(const bool success, QString error) {
|
||||
void TidalStreamURLRequest::LoginComplete(const bool success, const QString &error) {
|
||||
|
||||
if (!need_login_) return;
|
||||
need_login_ = false;
|
||||
@@ -270,6 +270,7 @@ void TidalStreamURLRequest::StreamURLReceived() {
|
||||
return;
|
||||
}
|
||||
QJsonArray json_array_urls = json_urls.toArray();
|
||||
urls.reserve(json_array_urls.count());
|
||||
for (const QJsonValueRef value : json_array_urls) {
|
||||
urls << QUrl(value.toString());
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class TidalStreamURLRequest : public TidalBaseRequest {
|
||||
void StreamURLReceived();
|
||||
|
||||
public slots:
|
||||
void LoginComplete(const bool success, QString error = QString());
|
||||
void LoginComplete(const bool success, const QString &error = QString());
|
||||
|
||||
private:
|
||||
void Error(const QString &error, const QVariant &debug = QVariant()) override;
|
||||
|
||||
@@ -51,7 +51,7 @@ UrlHandler::LoadResult TidalUrlHandler::StartLoading(const QUrl &url) {
|
||||
|
||||
}
|
||||
|
||||
void TidalUrlHandler::GetStreamURLFinished(const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration, QString error) {
|
||||
void TidalUrlHandler::GetStreamURLFinished(const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration, const QString &error) {
|
||||
|
||||
if (task_id_ == -1) return;
|
||||
CancelTask();
|
||||
|
||||
@@ -45,7 +45,7 @@ class TidalUrlHandler : public UrlHandler {
|
||||
void CancelTask();
|
||||
|
||||
private slots:
|
||||
void GetStreamURLFinished(const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration, QString error = QString());
|
||||
void GetStreamURLFinished(const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration, const QString &error = QString());
|
||||
|
||||
private:
|
||||
Application *app_;
|
||||
|
||||
Reference in New Issue
Block a user