Commit eb1d9b62 authored by Luigi Toscano's avatar Luigi Toscano

LyricWiki: link to the actual lyrics page

Instead of pointing to the homepage of the wiki,
set the link to the actual page of the lyrics
which are being shown.

BUG: 332664
FIXED-IN: 18.12.0

Test Plan:
The link to the LyricsWiki points to the actual page.
Nothing changes when the lyrics are not found.

Reviewers: mpyne

Reviewed By: mpyne

Differential Revision:
parent 56358be7
......@@ -144,6 +144,13 @@ void LyricsWidget::receiveLyricsReply(QNetworkReply* reply)
setHtml(i18n("<span style='color:red'>Error while retrieving lyrics!</span>"));
const QUrlQuery replyUrlQuery(reply->url());
QString titlesUrlPart = replyUrlQuery.queryItemValue(QStringLiteral("titles"), QUrl::FullyEncoded);
if (titlesUrlPart.isEmpty()) {
// default homepage, but this code path should never happen at this point.
titlesUrlPart = QStringLiteral("Lyrics_Wiki");
const QString lyricsUrl = QStringLiteral("") + titlesUrlPart;
QString content = QString::fromUtf8(reply->readAll());
int lIndex = content.indexOf("&lt;lyrics&gt;");
......@@ -159,5 +166,5 @@ void LyricsWidget::receiveLyricsReply(QNetworkReply* reply)
setHtml("<h1>" + m_title + "</h1>" +
content +
i18n("<br /><br /><i>Lyrics provided by <a href=''>LyricWiki</a></i>"));
i18n("<br /><br /><i>Lyrics provided by <a href='%1'>LyricWiki</a></i>", lyricsUrl));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment