Use static_cast

This commit is contained in:
Jonas Kvinge
2021-03-21 18:53:02 +01:00
parent f91a679cdf
commit 59bffed47f
80 changed files with 241 additions and 242 deletions

View File

@@ -60,8 +60,6 @@ class QobuzRequest : public QobuzBaseRequest {
void Search(const int search_id, const QString &search_text);
signals:
void Login();
void Login(QString username, QString password, QString token);
void LoginSuccess();
void LoginFailure(QString failure_reason);
void Results(int id, SongList songs, QString error);

View File

@@ -151,7 +151,7 @@ QobuzService::QobuzService(Application *app, QObject *parent)
timer_login_attempt_->setSingleShot(true);
QObject::connect(timer_login_attempt_, &QTimer::timeout, this, &QobuzService::ResetLoginAttempts);
QObject::connect(this, &QobuzService::Login, this, &QobuzService::SendLogin);
QObject::connect(this, &QobuzService::RequestLogin, this, &QobuzService::SendLogin);
QObject::connect(this, &QobuzService::LoginWithCredentials, this, &QobuzService::SendLoginWithCredentials);
QObject::connect(this, &QobuzService::AddArtists, favorite_request_, &QobuzFavoriteRequest::AddArtists);
@@ -479,7 +479,7 @@ void QobuzService::TryLogin() {
return;
}
emit Login();
emit RequestLogin();
}

View File

@@ -227,11 +227,11 @@ void QobuzStreamURLRequest::StreamURLReceived() {
}
int samplerate = -1;
if (json_obj.contains("sampling_rate")) {
samplerate = json_obj["sampling_rate"].toDouble() * 1000;
samplerate = static_cast<int>(json_obj["sampling_rate"].toDouble()) * 1000;
}
int bit_depth = -1;
if (json_obj.contains("bit_depth")) {
bit_depth = json_obj["bit_depth"].toDouble();
bit_depth = static_cast<int>(json_obj["bit_depth"].toDouble());
}
emit StreamURLFinished(original_url_, url, filetype, samplerate, bit_depth, duration);