From 05ab47d2a385f78c62ed1454c8a36a19e937441a Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Sun, 30 Dec 2012 22:08:31 +0000 Subject: [PATCH] Use QUrl to un-encode URLs --- models/playqueuemodel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/playqueuemodel.cpp b/models/playqueuemodel.cpp index ba7bcc8a8..9c3b31677 100644 --- a/models/playqueuemodel.cpp +++ b/models/playqueuemodel.cpp @@ -56,9 +56,9 @@ static QStringList reverseList(const QStringList &orig) } #ifdef TAGLIB_FOUND -static QString unencodeUrl(QString u) +static inline QString unencodeUrl(QString u) { - return u.replace("%20", " ").replace("%5C", "\\"); + return QUrl(u).path(); } #endif @@ -508,8 +508,8 @@ bool PlayQueueModel::dropMimeData(const QMimeData *data, foreach (QString u, orig) { if (u.startsWith("http://")) { useable.append(u); - } else if (allowLocal && (u.startsWith('/') || u.startsWith("file:///"))) { - if (u.startsWith("file://")) { + } else if (allowLocal && (u.startsWith('/') || u.startsWith("file:/"))) { + if (u.startsWith("file:/")) { u=u.mid(7); } if (alwaysUseHttp || !mpdLocal) {