[vlmc-devel] MediaLibraryModel: Fix showing percent-encoded titles

Yikai Lu git at videolan.org
Wed Mar 8 05:11:13 CET 2017


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Tue Mar  7 21:57:25 2017 -0600| [b9b1df700489a0249bb21897c0393cff39b24def] | committer: Yikai Lu

MediaLibraryModel: Fix showing percent-encoded titles

> https://code.videolan.org/videolan/vlmc/commit/b9b1df700489a0249bb21897c0393cff39b24def
---

 src/Library/MediaLibraryModel.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Library/MediaLibraryModel.cpp b/src/Library/MediaLibraryModel.cpp
index cb766aa..5a52a89 100644
--- a/src/Library/MediaLibraryModel.cpp
+++ b/src/Library/MediaLibraryModel.cpp
@@ -23,6 +23,7 @@
 #include "config.h"
 
 #include "MediaLibraryModel.h"
+#include <QUrl>
 
 #ifdef WITH_GUI
 #include <QPixmap>
@@ -105,7 +106,7 @@ QVariant MediaLibraryModel::data( const QModelIndex &index, int role ) const
     {
     case Qt::DisplayRole:
     case Roles::Title:
-        return QVariant( QString::fromStdString( m->title() ) );
+        return QVariant( QUrl::fromPercentEncoding( QByteArray( m->title().c_str() ) ) );
 #ifdef WITH_GUI
     case Qt::DecorationRole:
         return QPixmap( QString::fromStdString( m->thumbnail() ) );



More information about the Vlmc-devel mailing list