ChartLyricsProvider: Fix empty results
This commit is contained in:
@@ -66,7 +66,8 @@ void ChartLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id,
|
|||||||
QObject::disconnect(reply, nullptr, this, nullptr);
|
QObject::disconnect(reply, nullptr, this, nullptr);
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
|
|
||||||
const QScopeGuard search_finished = qScopeGuard([this, id]() { Q_EMIT SearchFinished(id); });
|
LyricsSearchResults results;
|
||||||
|
const QScopeGuard search_finished = qScopeGuard([this, id, &results]() { Q_EMIT SearchFinished(id, results); });
|
||||||
|
|
||||||
const ReplyDataResult reply_data_result = GetReplyData(reply);
|
const ReplyDataResult reply_data_result = GetReplyData(reply);
|
||||||
if (!reply_data_result.success()) {
|
if (!reply_data_result.success()) {
|
||||||
@@ -75,9 +76,7 @@ void ChartLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
QXmlStreamReader reader(reply_data_result.data);
|
QXmlStreamReader reader(reply_data_result.data);
|
||||||
LyricsSearchResults results;
|
|
||||||
LyricsSearchResult result;
|
LyricsSearchResult result;
|
||||||
|
|
||||||
while (!reader.atEnd()) {
|
while (!reader.atEnd()) {
|
||||||
const QXmlStreamReader::TokenType type = reader.readNext();
|
const QXmlStreamReader::TokenType type = reader.readNext();
|
||||||
const QString name = reader.name().toString();
|
const QString name = reader.name().toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user