Replace emit with Q_EMIT
This commit is contained in:
@@ -82,13 +82,13 @@ void ChartLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id,
|
||||
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
Error(QStringLiteral("%1 (%2)").arg(reply->errorString()).arg(reply->error()));
|
||||
emit SearchFinished(id);
|
||||
Q_EMIT SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() != 200) {
|
||||
Error(QStringLiteral("Received HTTP code %1").arg(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt()));
|
||||
emit SearchFinished(id);
|
||||
Q_EMIT SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ void ChartLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id,
|
||||
qLog(Debug) << "ChartLyrics: Got lyrics for" << request.artist << request.title;
|
||||
}
|
||||
|
||||
emit SearchFinished(id, results);
|
||||
Q_EMIT SearchFinished(id, results);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -311,8 +311,8 @@ void GeniusLyricsProvider::AccessTokenRequestFinished(QNetworkReply *reply) {
|
||||
|
||||
qLog(Debug) << "Genius: Authentication was successful.";
|
||||
|
||||
emit AuthenticationComplete(true);
|
||||
emit AuthenticationSuccess();
|
||||
Q_EMIT AuthenticationComplete(true);
|
||||
Q_EMIT AuthenticationSuccess();
|
||||
|
||||
}
|
||||
|
||||
@@ -525,8 +525,8 @@ void GeniusLyricsProvider::AuthError(const QString &error, const QVariant &debug
|
||||
for (const QString &e : std::as_const(login_errors_)) Error(e);
|
||||
if (debug.isValid()) qLog(Debug) << debug;
|
||||
|
||||
emit AuthenticationFailure(login_errors_);
|
||||
emit AuthenticationComplete(false, login_errors_);
|
||||
Q_EMIT AuthenticationFailure(login_errors_);
|
||||
Q_EMIT AuthenticationComplete(false, login_errors_);
|
||||
|
||||
login_errors_.clear();
|
||||
|
||||
@@ -552,7 +552,7 @@ void GeniusLyricsProvider::EndSearch(GeniusLyricsSearchContextPtr search, const
|
||||
else {
|
||||
qLog(Debug) << "GeniusLyrics: Got lyrics for" << search->request.artist << search->request.title;
|
||||
}
|
||||
emit SearchFinished(search->id, search->results);
|
||||
Q_EMIT SearchFinished(search->id, search->results);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -92,34 +92,34 @@ void HtmlLyricsProvider::HandleLyricsReply(QNetworkReply *reply, const int id, c
|
||||
else {
|
||||
qLog(Error) << name_ << reply->errorString() << reply->error();
|
||||
}
|
||||
emit SearchFinished(id);
|
||||
Q_EMIT SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() != 200) {
|
||||
qLog(Error) << name_ << "Received HTTP code" << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
emit SearchFinished(id);
|
||||
Q_EMIT SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
QByteArray data = reply->readAll();
|
||||
if (data.isEmpty()) {
|
||||
qLog(Error) << name_ << "Empty reply received from server.";
|
||||
emit SearchFinished(id);
|
||||
Q_EMIT SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
const QString lyrics = ParseLyricsFromHTML(QString::fromUtf8(data), QRegularExpression(start_tag_), QRegularExpression(end_tag_), QRegularExpression(lyrics_start_), multiple_);
|
||||
if (lyrics.isEmpty() || lyrics.contains(QLatin1String("we do not have the lyrics for"), Qt::CaseInsensitive)) {
|
||||
qLog(Debug) << name_ << "No lyrics for" << request.artist << request.album << request.title;
|
||||
emit SearchFinished(id);
|
||||
Q_EMIT SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
qLog(Debug) << name_ << "Got lyrics for" << request.artist << request.album << request.title;
|
||||
|
||||
LyricsSearchResult result(lyrics);
|
||||
emit SearchFinished(id, LyricsSearchResults() << result);
|
||||
Q_EMIT SearchFinished(id, LyricsSearchResults() << result);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ void LoloLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, c
|
||||
failure_reason = QStringLiteral("%1 (%2)").arg(reply->errorString()).arg(reply->error());
|
||||
if (reply->error() < 200) {
|
||||
Error(failure_reason);
|
||||
emit SearchFinished(id);
|
||||
Q_EMIT SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ void LoloLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, c
|
||||
qLog(Debug) << "LoloLyrics: Got lyrics for" << request.artist << request.title;
|
||||
}
|
||||
|
||||
emit SearchFinished(id, results);
|
||||
Q_EMIT SearchFinished(id, results);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -213,6 +213,6 @@ void LyricFindLyricsProvider::EndSearch(const int id, const LyricsSearchRequest
|
||||
qLog(Debug) << "LyricFind: Got lyrics for" << request.artist << request.title;
|
||||
}
|
||||
|
||||
emit SearchFinished(id, results);
|
||||
Q_EMIT SearchFinished(id, results);
|
||||
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ void LyricsFetcher::SingleSearchFinished(const quint64 request_id, const LyricsS
|
||||
|
||||
LyricsFetcherSearch *search = active_requests_.take(request_id);
|
||||
search->deleteLater();
|
||||
emit SearchFinished(request_id, results);
|
||||
Q_EMIT SearchFinished(request_id, results);
|
||||
|
||||
}
|
||||
|
||||
@@ -127,6 +127,6 @@ void LyricsFetcher::SingleLyricsFetched(const quint64 request_id, const QString
|
||||
|
||||
LyricsFetcherSearch *search = active_requests_.take(request_id);
|
||||
search->deleteLater();
|
||||
emit LyricsFetched(request_id, provider, lyrics);
|
||||
Q_EMIT LyricsFetched(request_id, provider, lyrics);
|
||||
|
||||
}
|
||||
|
||||
@@ -134,13 +134,13 @@ void LyricsFetcherSearch::AllProvidersFinished() {
|
||||
|
||||
if (!results_.isEmpty()) {
|
||||
qLog(Debug) << "Using lyrics from" << results_.last().provider << "for" << request_.artist << request_.title << "with score" << results_.last().score;
|
||||
emit LyricsFetched(id_, results_.constLast().provider, results_.constLast().lyrics);
|
||||
Q_EMIT LyricsFetched(id_, results_.constLast().provider, results_.constLast().lyrics);
|
||||
}
|
||||
else {
|
||||
emit LyricsFetched(id_, QString(), QString());
|
||||
Q_EMIT LyricsFetched(id_, QString(), QString());
|
||||
}
|
||||
|
||||
emit SearchFinished(id_, results_);
|
||||
Q_EMIT SearchFinished(id_, results_);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -437,7 +437,7 @@ void MusixmatchLyricsProvider::EndSearch(LyricsSearchContextPtr search, const QU
|
||||
else {
|
||||
qLog(Debug) << "MusixmatchLyrics: Got lyrics for" << search->request.artist << search->request.title;
|
||||
}
|
||||
emit SearchFinished(search->id, search->results);
|
||||
Q_EMIT SearchFinished(search->id, search->results);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -76,19 +76,19 @@ void OVHLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, co
|
||||
|
||||
QJsonObject json_obj = ExtractJsonObj(reply);
|
||||
if (json_obj.isEmpty()) {
|
||||
emit SearchFinished(id);
|
||||
Q_EMIT SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (json_obj.contains(QLatin1String("error"))) {
|
||||
Error(json_obj[QLatin1String("error")].toString());
|
||||
qLog(Debug) << "OVHLyrics: No lyrics for" << request.artist << request.title;
|
||||
emit SearchFinished(id);
|
||||
Q_EMIT SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!json_obj.contains(QLatin1String("lyrics"))) {
|
||||
emit SearchFinished(id);
|
||||
Q_EMIT SearchFinished(id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -97,12 +97,12 @@ void OVHLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, co
|
||||
|
||||
if (result.lyrics.isEmpty()) {
|
||||
qLog(Debug) << "OVHLyrics: No lyrics for" << request.artist << request.title;
|
||||
emit SearchFinished(id);
|
||||
Q_EMIT SearchFinished(id);
|
||||
}
|
||||
else {
|
||||
result.lyrics = Utilities::DecodeHtmlEntities(result.lyrics);
|
||||
qLog(Debug) << "OVHLyrics: Got lyrics for" << request.artist << request.title;
|
||||
emit SearchFinished(id, LyricsSearchResults() << result);
|
||||
Q_EMIT SearchFinished(id, LyricsSearchResults() << result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user