Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit eb1d9b62 authored by Luigi Toscano's avatar Luigi Toscano

LyricWiki: link to the actual lyrics page

Summary:
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: https://phabricator.kde.org/D15303
parent 56358be7
......@@ -144,6 +144,13 @@ void LyricsWidget::receiveLyricsReply(QNetworkReply* reply)
setHtml(i18n("<span style='color:red'>Error while retrieving lyrics!</span>"));
return;
}
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("http://lyrics.wikia.com/wiki/") + titlesUrlPart;
QString content = QString::fromUtf8(reply->readAll());
int lIndex = content.indexOf("&lt;lyrics&gt;");
......@@ -159,5 +166,5 @@ void LyricsWidget::receiveLyricsReply(QNetworkReply* reply)
//setText(content);
setHtml("<h1>" + m_title + "</h1>" +
content +
i18n("<br /><br /><i>Lyrics provided by <a href='http://lyrics.wikia.com/Lyrics_Wiki'>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