Replace emit with Q_EMIT
This commit is contained in:
@@ -126,7 +126,7 @@ SpotifyRequest::~SpotifyRequest() {
|
||||
void SpotifyRequest::Process() {
|
||||
|
||||
if (!service_->authenticated()) {
|
||||
emit UpdateStatus(query_id_, tr("Authenticating..."));
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Authenticating..."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -209,8 +209,8 @@ void SpotifyRequest::Search(const int query_id, const QString &search_text) {
|
||||
|
||||
void SpotifyRequest::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();
|
||||
|
||||
}
|
||||
@@ -263,8 +263,8 @@ void SpotifyRequest::FlushArtistsRequests() {
|
||||
|
||||
void SpotifyRequest::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();
|
||||
|
||||
}
|
||||
@@ -317,8 +317,8 @@ void SpotifyRequest::FlushAlbumsRequests() {
|
||||
|
||||
void SpotifyRequest::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();
|
||||
|
||||
}
|
||||
@@ -372,8 +372,8 @@ void SpotifyRequest::FlushSongsRequests() {
|
||||
|
||||
void SpotifyRequest::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();
|
||||
|
||||
}
|
||||
@@ -386,8 +386,8 @@ void SpotifyRequest::AddArtistsSearchRequest(const int offset) {
|
||||
|
||||
void SpotifyRequest::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();
|
||||
|
||||
}
|
||||
@@ -400,8 +400,8 @@ void SpotifyRequest::AddAlbumsSearchRequest(const int offset) {
|
||||
|
||||
void SpotifyRequest::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();
|
||||
|
||||
}
|
||||
@@ -474,7 +474,7 @@ void SpotifyRequest::ArtistsReplyReceived(QNetworkReply *reply, const int limit_
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -528,7 +528,7 @@ void SpotifyRequest::ArtistsReplyReceived(QNetworkReply *reply, const int limit_
|
||||
}
|
||||
artists_received_ += artists_received;
|
||||
|
||||
if (offset_requested != 0) emit UpdateProgress(query_id_, GetProgress(artists_total_, artists_received_));
|
||||
if (offset_requested != 0) Q_EMIT UpdateProgress(query_id_, GetProgress(artists_total_, artists_received_));
|
||||
|
||||
ArtistsFinishCheck(limit_requested, offset, artists_received);
|
||||
|
||||
@@ -556,9 +556,9 @@ void SpotifyRequest::ArtistsFinishCheck(const int limit, const int offset, const
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -610,7 +610,7 @@ void SpotifyRequest::ArtistAlbumsReplyReceived(QNetworkReply *reply, const Artis
|
||||
|
||||
--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);
|
||||
|
||||
}
|
||||
@@ -813,7 +813,7 @@ void SpotifyRequest::AlbumsReceived(QNetworkReply *reply, const Artist &artist_a
|
||||
|
||||
if (type_ == Type::FavouriteAlbums || 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_artist, limit_requested, offset, albums_total, albums_received);
|
||||
@@ -862,9 +862,9 @@ void SpotifyRequest::AlbumsFinishCheck(const Artist &artist, const int limit, co
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -922,7 +922,7 @@ void SpotifyRequest::AlbumSongsReplyReceived(QNetworkReply *reply, const Artist
|
||||
--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);
|
||||
|
||||
@@ -1028,7 +1028,7 @@ void SpotifyRequest::SongsReceived(QNetworkReply *reply, const Artist &artist, c
|
||||
|
||||
if (type_ == Type::FavouriteSongs || 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(artist, album, limit_requested, offset_requested, songs_total, songs_received);
|
||||
@@ -1209,9 +1209,9 @@ void SpotifyRequest::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();
|
||||
|
||||
@@ -1272,7 +1272,7 @@ void SpotifyRequest::AlbumCoverReceived(QNetworkReply *reply, const QString &alb
|
||||
|
||||
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(album_id)) {
|
||||
AlbumCoverFinishCheck();
|
||||
@@ -1374,16 +1374,16 @@ void SpotifyRequest::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("Data missing error"));
|
||||
Q_EMIT Results(query_id_, songs_, tr("Data missing error"));
|
||||
}
|
||||
else {
|
||||
emit Results(query_id_, songs_, ErrorsToHTML(errors_));
|
||||
Q_EMIT Results(query_id_, songs_, ErrorsToHTML(errors_));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user