Replace emit with Q_EMIT
This commit is contained in:
@@ -167,13 +167,13 @@ void QobuzFavoriteRequest::AddFavoritesReply(QNetworkReply *reply, const Favorit
|
||||
|
||||
switch (type) {
|
||||
case FavoriteType::Artists:
|
||||
emit ArtistsAdded(songs);
|
||||
Q_EMIT ArtistsAdded(songs);
|
||||
break;
|
||||
case FavoriteType::Albums:
|
||||
emit AlbumsAdded(songs);
|
||||
Q_EMIT AlbumsAdded(songs);
|
||||
break;
|
||||
case FavoriteType::Songs:
|
||||
emit SongsAdded(songs);
|
||||
Q_EMIT SongsAdded(songs);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -261,13 +261,13 @@ void QobuzFavoriteRequest::RemoveFavoritesReply(QNetworkReply *reply, const Favo
|
||||
|
||||
switch (type) {
|
||||
case FavoriteType::Artists:
|
||||
emit ArtistsRemoved(songs);
|
||||
Q_EMIT ArtistsRemoved(songs);
|
||||
break;
|
||||
case FavoriteType::Albums:
|
||||
emit AlbumsRemoved(songs);
|
||||
Q_EMIT AlbumsRemoved(songs);
|
||||
break;
|
||||
case FavoriteType::Songs:
|
||||
emit SongsRemoved(songs);
|
||||
Q_EMIT SongsRemoved(songs);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -202,8 +202,8 @@ void QobuzRequest::Search(const int query_id, const QString &search_text) {
|
||||
|
||||
void QobuzRequest::GetArtists() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Receiving artists..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Receiving artists..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddArtistsRequest();
|
||||
|
||||
}
|
||||
@@ -254,8 +254,8 @@ void QobuzRequest::FlushArtistsRequests() {
|
||||
|
||||
void QobuzRequest::GetAlbums() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Receiving albums..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Receiving albums..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddAlbumsRequest();
|
||||
|
||||
}
|
||||
@@ -306,8 +306,8 @@ void QobuzRequest::FlushAlbumsRequests() {
|
||||
|
||||
void QobuzRequest::GetSongs() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Receiving songs..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Receiving songs..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddSongsRequest();
|
||||
|
||||
}
|
||||
@@ -358,8 +358,8 @@ void QobuzRequest::FlushSongsRequests() {
|
||||
|
||||
void QobuzRequest::ArtistsSearch() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Searching..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Searching..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddArtistsSearchRequest();
|
||||
|
||||
}
|
||||
@@ -372,8 +372,8 @@ void QobuzRequest::AddArtistsSearchRequest(const int offset) {
|
||||
|
||||
void QobuzRequest::AlbumsSearch() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Searching..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Searching..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddAlbumsSearchRequest();
|
||||
|
||||
}
|
||||
@@ -386,8 +386,8 @@ void QobuzRequest::AddAlbumsSearchRequest(const int offset) {
|
||||
|
||||
void QobuzRequest::SongsSearch() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Searching..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Searching..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddSongsSearchRequest();
|
||||
|
||||
}
|
||||
@@ -464,7 +464,7 @@ void QobuzRequest::ArtistsReplyReceived(QNetworkReply *reply, const int limit_re
|
||||
}
|
||||
|
||||
if (offset_requested == 0) {
|
||||
emit UpdateProgress(query_id_, GetProgress(artists_received_, artists_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(artists_received_, artists_total_));
|
||||
}
|
||||
|
||||
QJsonValue value_items = ExtractItems(obj_artists);
|
||||
@@ -523,7 +523,7 @@ void QobuzRequest::ArtistsReplyReceived(QNetworkReply *reply, const int limit_re
|
||||
}
|
||||
artists_received_ += artists_received;
|
||||
|
||||
if (offset_requested != 0) emit UpdateProgress(query_id_, GetProgress(artists_received_, artists_total_));
|
||||
if (offset_requested != 0) Q_EMIT UpdateProgress(query_id_, GetProgress(artists_received_, artists_total_));
|
||||
|
||||
ArtistsFinishCheck(limit_requested, offset, artists_received);
|
||||
|
||||
@@ -551,9 +551,9 @@ void QobuzRequest::ArtistsFinishCheck(const int limit, const int offset, const i
|
||||
artist_albums_requests_pending_.clear();
|
||||
|
||||
if (artist_albums_requests_total_ > 0) {
|
||||
if (artist_albums_requests_total_ == 1) emit UpdateStatus(query_id_, tr("Receiving albums for %1 artist...").arg(artist_albums_requests_total_));
|
||||
else emit UpdateStatus(query_id_, tr("Receiving albums for %1 artists...").arg(artist_albums_requests_total_));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
if (artist_albums_requests_total_ == 1) Q_EMIT UpdateStatus(query_id_, tr("Receiving albums for %1 artist...").arg(artist_albums_requests_total_));
|
||||
else Q_EMIT UpdateStatus(query_id_, tr("Receiving albums for %1 artists...").arg(artist_albums_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -607,7 +607,7 @@ void QobuzRequest::ArtistAlbumsReplyReceived(QNetworkReply *reply, const Artist
|
||||
|
||||
--artist_albums_requests_active_;
|
||||
++artist_albums_requests_received_;
|
||||
emit UpdateProgress(query_id_, GetProgress(artist_albums_requests_received_, artist_albums_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(artist_albums_requests_received_, artist_albums_requests_total_));
|
||||
AlbumsReceived(reply, artist, 0, offset_requested);
|
||||
|
||||
}
|
||||
@@ -759,7 +759,7 @@ void QobuzRequest::AlbumsReceived(QNetworkReply *reply, const Artist &artist_req
|
||||
|
||||
if (query_type_ == Type::FavouriteAlbums || query_type_ == Type::SearchAlbums) {
|
||||
albums_received_ += albums_received;
|
||||
emit UpdateProgress(query_id_, GetProgress(albums_received_, albums_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(albums_received_, albums_total_));
|
||||
}
|
||||
|
||||
AlbumsFinishCheck(artist_requested, limit_requested, offset, albums_total, albums_received);
|
||||
@@ -808,9 +808,9 @@ void QobuzRequest::AlbumsFinishCheck(const Artist &artist, const int limit, cons
|
||||
album_songs_requests_pending_.clear();
|
||||
|
||||
if (album_songs_requests_total_ > 0) {
|
||||
if (album_songs_requests_total_ == 1) emit UpdateStatus(query_id_, tr("Receiving songs for %1 album...").arg(album_songs_requests_total_));
|
||||
else emit UpdateStatus(query_id_, tr("Receiving songs for %1 albums...").arg(album_songs_requests_total_));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
if (album_songs_requests_total_ == 1) Q_EMIT UpdateStatus(query_id_, tr("Receiving songs for %1 album...").arg(album_songs_requests_total_));
|
||||
else Q_EMIT UpdateStatus(query_id_, tr("Receiving songs for %1 albums...").arg(album_songs_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -863,7 +863,7 @@ void QobuzRequest::AlbumSongsReplyReceived(QNetworkReply *reply, const Artist &a
|
||||
--album_songs_requests_active_;
|
||||
++album_songs_requests_received_;
|
||||
if (offset_requested == 0) {
|
||||
emit UpdateProgress(query_id_, GetProgress(album_songs_requests_received_, album_songs_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(album_songs_requests_received_, album_songs_requests_total_));
|
||||
}
|
||||
SongsReceived(reply, artist, album, 0, offset_requested);
|
||||
|
||||
@@ -1022,7 +1022,7 @@ void QobuzRequest::SongsReceived(QNetworkReply *reply, const Artist &artist_requ
|
||||
|
||||
if (query_type_ == Type::FavouriteSongs || query_type_ == Type::SearchSongs) {
|
||||
songs_received_ += songs_received;
|
||||
emit UpdateProgress(query_id_, GetProgress(songs_received_, songs_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(songs_received_, songs_total_));
|
||||
}
|
||||
|
||||
SongsFinishCheck(album_artist, album, limit_requested, offset_requested, songs_total, songs_received);
|
||||
@@ -1258,9 +1258,9 @@ void QobuzRequest::GetAlbumCovers() {
|
||||
AddAlbumCoverRequest(song);
|
||||
}
|
||||
|
||||
if (album_covers_requests_total_ == 1) emit UpdateStatus(query_id_, tr("Receiving album cover for %1 album...").arg(album_covers_requests_total_));
|
||||
else emit UpdateStatus(query_id_, tr("Receiving album covers for %1 albums...").arg(album_covers_requests_total_));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
if (album_covers_requests_total_ == 1) Q_EMIT UpdateStatus(query_id_, tr("Receiving album cover for %1 album...").arg(album_covers_requests_total_));
|
||||
else Q_EMIT UpdateStatus(query_id_, tr("Receiving album covers for %1 albums...").arg(album_covers_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
|
||||
StartRequests();
|
||||
|
||||
@@ -1323,7 +1323,7 @@ void QobuzRequest::AlbumCoverReceived(QNetworkReply *reply, const QUrl &cover_ur
|
||||
|
||||
if (finished_) return;
|
||||
|
||||
emit UpdateProgress(query_id_, GetProgress(album_covers_requests_received_, album_covers_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(album_covers_requests_received_, album_covers_requests_total_));
|
||||
|
||||
if (!album_covers_requests_sent_.contains(cover_url)) {
|
||||
AlbumCoverFinishCheck();
|
||||
@@ -1425,15 +1425,15 @@ void QobuzRequest::FinishCheck() {
|
||||
finished_ = true;
|
||||
if (no_results_ && songs_.isEmpty()) {
|
||||
if (IsSearch())
|
||||
emit Results(query_id_, SongMap(), tr("No match."));
|
||||
Q_EMIT Results(query_id_, SongMap(), tr("No match."));
|
||||
else
|
||||
emit Results(query_id_, SongMap(), QString());
|
||||
Q_EMIT Results(query_id_, SongMap(), QString());
|
||||
}
|
||||
else {
|
||||
if (songs_.isEmpty() && errors_.isEmpty())
|
||||
emit Results(query_id_, songs_, tr("Unknown error"));
|
||||
Q_EMIT Results(query_id_, songs_, tr("Unknown error"));
|
||||
else
|
||||
emit Results(query_id_, songs_, ErrorsToHTML(errors_));
|
||||
Q_EMIT Results(query_id_, songs_, ErrorsToHTML(errors_));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ void QobuzService::ExitReceived() {
|
||||
QObject::disconnect(obj, nullptr, this, nullptr);
|
||||
qLog(Debug) << obj << "successfully exited.";
|
||||
wait_for_exit_.removeAll(obj);
|
||||
if (wait_for_exit_.isEmpty()) emit ExitFinished();
|
||||
if (wait_for_exit_.isEmpty()) Q_EMIT ExitFinished();
|
||||
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ void QobuzService::SendLogin() {
|
||||
|
||||
void QobuzService::SendLoginWithCredentials(const QString &app_id, const QString &username, const QString &password) {
|
||||
|
||||
emit UpdateStatus(tr("Authenticating..."));
|
||||
Q_EMIT UpdateStatus(tr("Authenticating..."));
|
||||
login_errors_.clear();
|
||||
|
||||
login_sent_ = true;
|
||||
@@ -446,8 +446,8 @@ void QobuzService::HandleAuthReply(QNetworkReply *reply) {
|
||||
login_attempts_ = 0;
|
||||
if (timer_login_attempt_->isActive()) timer_login_attempt_->stop();
|
||||
|
||||
emit LoginComplete(true);
|
||||
emit LoginSuccess();
|
||||
Q_EMIT LoginComplete(true);
|
||||
Q_EMIT LoginSuccess();
|
||||
|
||||
}
|
||||
|
||||
@@ -477,23 +477,23 @@ void QobuzService::TryLogin() {
|
||||
if (authenticated() || login_sent_) return;
|
||||
|
||||
if (login_attempts_ >= kLoginAttempts) {
|
||||
emit LoginComplete(false, tr("Maximum number of login attempts reached."));
|
||||
Q_EMIT LoginComplete(false, tr("Maximum number of login attempts reached."));
|
||||
return;
|
||||
}
|
||||
if (app_id_.isEmpty()) {
|
||||
emit LoginComplete(false, tr("Missing Qobuz app ID."));
|
||||
Q_EMIT LoginComplete(false, tr("Missing Qobuz app ID."));
|
||||
return;
|
||||
}
|
||||
if (username_.isEmpty()) {
|
||||
emit LoginComplete(false, tr("Missing Qobuz username."));
|
||||
Q_EMIT LoginComplete(false, tr("Missing Qobuz username."));
|
||||
return;
|
||||
}
|
||||
if (password_.isEmpty()) {
|
||||
emit LoginComplete(false, tr("Missing Qobuz password."));
|
||||
Q_EMIT LoginComplete(false, tr("Missing Qobuz password."));
|
||||
return;
|
||||
}
|
||||
|
||||
emit RequestLogin();
|
||||
Q_EMIT RequestLogin();
|
||||
|
||||
}
|
||||
|
||||
@@ -510,12 +510,12 @@ void QobuzService::ResetArtistsRequest() {
|
||||
void QobuzService::GetArtists() {
|
||||
|
||||
if (app_id().isEmpty()) {
|
||||
emit ArtistsResults(SongMap(), tr("Missing Qobuz app ID."));
|
||||
Q_EMIT ArtistsResults(SongMap(), tr("Missing Qobuz app ID."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!authenticated()) {
|
||||
emit ArtistsResults(SongMap(), tr("Not authenticated with Qobuz."));
|
||||
Q_EMIT ArtistsResults(SongMap(), tr("Not authenticated with Qobuz."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -532,19 +532,19 @@ void QobuzService::GetArtists() {
|
||||
void QobuzService::ArtistsResultsReceived(const int id, const SongMap &songs, const QString &error) {
|
||||
|
||||
Q_UNUSED(id);
|
||||
emit ArtistsResults(songs, error);
|
||||
Q_EMIT ArtistsResults(songs, error);
|
||||
ResetArtistsRequest();
|
||||
|
||||
}
|
||||
|
||||
void QobuzService::ArtistsUpdateStatusReceived(const int id, const QString &text) {
|
||||
Q_UNUSED(id);
|
||||
emit ArtistsUpdateStatus(text);
|
||||
Q_EMIT ArtistsUpdateStatus(text);
|
||||
}
|
||||
|
||||
void QobuzService::ArtistsUpdateProgressReceived(const int id, const int progress) {
|
||||
Q_UNUSED(id);
|
||||
emit ArtistsUpdateProgress(progress);
|
||||
Q_EMIT ArtistsUpdateProgress(progress);
|
||||
}
|
||||
|
||||
void QobuzService::ResetAlbumsRequest() {
|
||||
@@ -560,12 +560,12 @@ void QobuzService::ResetAlbumsRequest() {
|
||||
void QobuzService::GetAlbums() {
|
||||
|
||||
if (app_id().isEmpty()) {
|
||||
emit AlbumsResults(SongMap(), tr("Missing Qobuz app ID."));
|
||||
Q_EMIT AlbumsResults(SongMap(), tr("Missing Qobuz app ID."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!authenticated()) {
|
||||
emit AlbumsResults(SongMap(), tr("Not authenticated with Qobuz."));
|
||||
Q_EMIT AlbumsResults(SongMap(), tr("Not authenticated with Qobuz."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -582,19 +582,19 @@ void QobuzService::GetAlbums() {
|
||||
void QobuzService::AlbumsResultsReceived(const int id, const SongMap &songs, const QString &error) {
|
||||
|
||||
Q_UNUSED(id);
|
||||
emit AlbumsResults(songs, error);
|
||||
Q_EMIT AlbumsResults(songs, error);
|
||||
ResetAlbumsRequest();
|
||||
|
||||
}
|
||||
|
||||
void QobuzService::AlbumsUpdateStatusReceived(const int id, const QString &text) {
|
||||
Q_UNUSED(id);
|
||||
emit AlbumsUpdateStatus(text);
|
||||
Q_EMIT AlbumsUpdateStatus(text);
|
||||
}
|
||||
|
||||
void QobuzService::AlbumsUpdateProgressReceived(const int id, const int progress) {
|
||||
Q_UNUSED(id);
|
||||
emit AlbumsUpdateProgress(progress);
|
||||
Q_EMIT AlbumsUpdateProgress(progress);
|
||||
}
|
||||
|
||||
void QobuzService::ResetSongsRequest() {
|
||||
@@ -610,12 +610,12 @@ void QobuzService::ResetSongsRequest() {
|
||||
void QobuzService::GetSongs() {
|
||||
|
||||
if (app_id().isEmpty()) {
|
||||
emit SongsResults(SongMap(), tr("Missing Qobuz app ID."));
|
||||
Q_EMIT SongsResults(SongMap(), tr("Missing Qobuz app ID."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!authenticated()) {
|
||||
emit SongsResults(SongMap(), tr("Not authenticated with Qobuz."));
|
||||
Q_EMIT SongsResults(SongMap(), tr("Not authenticated with Qobuz."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -632,19 +632,19 @@ void QobuzService::GetSongs() {
|
||||
void QobuzService::SongsResultsReceived(const int id, const SongMap &songs, const QString &error) {
|
||||
|
||||
Q_UNUSED(id);
|
||||
emit SongsResults(songs, error);
|
||||
Q_EMIT SongsResults(songs, error);
|
||||
ResetSongsRequest();
|
||||
|
||||
}
|
||||
|
||||
void QobuzService::SongsUpdateStatusReceived(const int id, const QString &text) {
|
||||
Q_UNUSED(id);
|
||||
emit SongsUpdateStatus(text);
|
||||
Q_EMIT SongsUpdateStatus(text);
|
||||
}
|
||||
|
||||
void QobuzService::SongsUpdateProgressReceived(const int id, const int progress) {
|
||||
Q_UNUSED(id);
|
||||
emit SongsUpdateProgress(progress);
|
||||
Q_EMIT SongsUpdateProgress(progress);
|
||||
}
|
||||
|
||||
int QobuzService::Search(const QString &text, StreamingSearchView::SearchType type) {
|
||||
@@ -672,7 +672,7 @@ void QobuzService::StartSearch() {
|
||||
search_text_ = pending_search_text_;
|
||||
|
||||
if (app_id_.isEmpty()) { // App ID is the only thing needed to search.
|
||||
emit SearchResults(search_id_, SongMap(), tr("Missing Qobuz app ID."));
|
||||
Q_EMIT SearchResults(search_id_, SongMap(), tr("Missing Qobuz app ID."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -713,7 +713,7 @@ void QobuzService::SendSearch() {
|
||||
void QobuzService::SearchResultsReceived(const int id, const SongMap &songs, const QString &error) {
|
||||
|
||||
search_request_.reset();
|
||||
emit SearchResults(id, songs, error);
|
||||
Q_EMIT SearchResults(id, songs, error);
|
||||
|
||||
}
|
||||
|
||||
@@ -746,7 +746,7 @@ void QobuzService::HandleStreamURLFailure(const uint id, const QUrl &media_url,
|
||||
if (!stream_url_requests_.contains(id)) return;
|
||||
stream_url_requests_.remove(id);
|
||||
|
||||
emit StreamURLFailure(id, media_url, error);
|
||||
Q_EMIT StreamURLFailure(id, media_url, error);
|
||||
|
||||
}
|
||||
|
||||
@@ -755,7 +755,7 @@ void QobuzService::HandleStreamURLSuccess(const uint id, const QUrl &media_url,
|
||||
if (!stream_url_requests_.contains(id)) return;
|
||||
stream_url_requests_.remove(id);
|
||||
|
||||
emit StreamURLSuccess(id, media_url, stream_url, filetype, samplerate, bit_depth, duration);
|
||||
Q_EMIT StreamURLSuccess(id, media_url, stream_url, filetype, samplerate, bit_depth, duration);
|
||||
|
||||
}
|
||||
|
||||
@@ -770,8 +770,8 @@ void QobuzService::LoginError(const QString &error, const QVariant &debug) {
|
||||
}
|
||||
if (debug.isValid()) qLog(Debug) << debug;
|
||||
|
||||
emit LoginFailure(error_html);
|
||||
emit LoginComplete(false, error_html);
|
||||
Q_EMIT LoginFailure(error_html);
|
||||
Q_EMIT LoginComplete(false, error_html);
|
||||
|
||||
login_errors_.clear();
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ void QobuzStreamURLRequest::LoginComplete(const bool success, const QString &err
|
||||
need_login_ = false;
|
||||
|
||||
if (!success) {
|
||||
emit StreamURLFailure(id_, media_url_, error);
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -80,13 +80,13 @@ void QobuzStreamURLRequest::LoginComplete(const bool success, const QString &err
|
||||
void QobuzStreamURLRequest::Process() {
|
||||
|
||||
if (app_id().isEmpty() || app_secret().isEmpty()) {
|
||||
emit StreamURLFailure(id_, media_url_, tr("Missing Qobuz app ID or secret."));
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, tr("Missing Qobuz app ID or secret."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!authenticated()) {
|
||||
need_login_ = true;
|
||||
emit TryLogin();
|
||||
Q_EMIT TryLogin();
|
||||
return;
|
||||
}
|
||||
GetStreamURL();
|
||||
@@ -99,7 +99,7 @@ void QobuzStreamURLRequest::Cancel() {
|
||||
reply_->abort();
|
||||
}
|
||||
else {
|
||||
emit StreamURLFailure(id_, media_url_, tr("Cancelled."));
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, tr("Cancelled."));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -159,32 +159,32 @@ void QobuzStreamURLRequest::StreamURLReceived() {
|
||||
need_login_ = true;
|
||||
return;
|
||||
}
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
|
||||
QJsonObject json_obj = ExtractJsonObj(data);
|
||||
if (json_obj.isEmpty()) {
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!json_obj.contains(QLatin1String("track_id"))) {
|
||||
Error(QStringLiteral("Invalid Json reply, stream url is missing track_id."), json_obj);
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
|
||||
int track_id = json_obj[QLatin1String("track_id")].toInt();
|
||||
if (track_id != song_id_) {
|
||||
Error(QStringLiteral("Incorrect track ID returned."), json_obj);
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!json_obj.contains(QLatin1String("mime_type")) || !json_obj.contains(QLatin1String("url"))) {
|
||||
Error(QStringLiteral("Invalid Json reply, stream url is missing url or mime_type."), json_obj);
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ void QobuzStreamURLRequest::StreamURLReceived() {
|
||||
|
||||
if (!url.isValid()) {
|
||||
Error(QStringLiteral("Returned stream url is invalid."), json_obj);
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ void QobuzStreamURLRequest::StreamURLReceived() {
|
||||
bit_depth = static_cast<int>(json_obj[QLatin1String("bit_depth")].toDouble());
|
||||
}
|
||||
|
||||
emit StreamURLSuccess(id_, media_url_, url, filetype, samplerate, bit_depth, duration);
|
||||
Q_EMIT StreamURLSuccess(id_, media_url_, url, filetype, samplerate, bit_depth, duration);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ void QobuzUrlHandler::GetStreamURLFailure(const uint id, const QUrl &media_url,
|
||||
Request req = requests_.take(id);
|
||||
CancelTask(req.task_id);
|
||||
|
||||
emit AsyncLoadComplete(LoadResult(media_url, LoadResult::Type::Error, error));
|
||||
Q_EMIT AsyncLoadComplete(LoadResult(media_url, LoadResult::Type::Error, error));
|
||||
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ void QobuzUrlHandler::GetStreamURLSuccess(const uint id, const QUrl &media_url,
|
||||
Request req = requests_.take(id);
|
||||
CancelTask(req.task_id);
|
||||
|
||||
emit AsyncLoadComplete(LoadResult(media_url, LoadResult::Type::TrackAvailable, stream_url, filetype, samplerate, bit_depth, duration));
|
||||
Q_EMIT AsyncLoadComplete(LoadResult(media_url, LoadResult::Type::TrackAvailable, stream_url, filetype, samplerate, bit_depth, duration));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user