From 52774a3222e51a97323a308de8f4b6b38edbe9e9 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 9 Jul 2025 22:34:35 +0200 Subject: [PATCH] ChartLyricsProvider: Fix empty results --- src/lyrics/chartlyricsprovider.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lyrics/chartlyricsprovider.cpp b/src/lyrics/chartlyricsprovider.cpp index fa73ebb3b..463020014 100644 --- a/src/lyrics/chartlyricsprovider.cpp +++ b/src/lyrics/chartlyricsprovider.cpp @@ -66,7 +66,8 @@ void ChartLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, QObject::disconnect(reply, nullptr, this, nullptr); 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); if (!reply_data_result.success()) { @@ -75,9 +76,7 @@ void ChartLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, } QXmlStreamReader reader(reply_data_result.data); - LyricsSearchResults results; LyricsSearchResult result; - while (!reader.atEnd()) { const QXmlStreamReader::TokenType type = reader.readNext(); const QString name = reader.name().toString();