diff --git a/context/lastfmengine.cpp b/context/lastfmengine.cpp index 4caa5572c..afafd866b 100644 --- a/context/lastfmengine.cpp +++ b/context/lastfmengine.cpp @@ -132,17 +132,24 @@ void LastFmEngine::parseResponse() if (!text.isEmpty()) { static const QRegExp constLicense("User-contributed text is available.*"); text.remove(constLicense); - DBUG << __FUNCTION__ << "Text:" << text; - QString query=reply->property(constQuery).toString(); - int split = text.indexOf('\n', 512); - if (-1==split) { - split = text.indexOf(". ", 512); - } + text.replace("\n", "
"); + text=text.simplified(); + text.replace("
", "
"); - text = text.left(split); - if (-1!=split) { - text += QLatin1String("

")+constLinkPlaceholder+QLatin1String(""); + // Remove last.fm read more link (as we add our own!!) + int end=text.lastIndexOf(QLatin1String("on Last.fm")); + if (-1!=end) { + int start=text.lastIndexOf(QLatin1String("
")+constLinkPlaceholder+QLatin1String(""); + text.replace("




", "

"); + text.replace("



", "

"); + text.replace("


", "

"); } emit searchResult(text, text.isEmpty() ? QString() : constLang); }