[MPRIS Dataengine] Use UTF-8 for URLs instead of Latin1

While investingating properties of the MPRIS dataengine, I have noitced
that the :xsesam:url property in the metadata was encoded incorrectly. I
have several folders containing music with non-Latin characters, and
they showed up as ????.

After a quick chat with kbroulik on IRC, I decided to make this patch,
which uses UTF-8 instead.

Differential Revision: https://phabricator.kde.org/D2732
wilder-5.14
Luca Beltrame 10 years ago
parent bb15240078
commit 629fa121be
No known key found for this signature in database
GPG Key ID: 40C8281493B01C16
  1. 2
      dataengines/mpris2/playercontainer.cpp

@ -156,7 +156,7 @@ void PlayerContainer::refresh()
static bool decodeUri(QVariantMap &map, const QString& entry) {
if (map.contains(entry)) {
QString urlString = map.value(entry).toString();
QUrl url = QUrl::fromEncoded(urlString.toLatin1());
QUrl url = QUrl::fromEncoded(urlString.toUtf8());
if (!url.isValid()) {
// try to be lenient
url = QUrl(urlString);

Loading…
Cancel
Save