[vlc-commits] qt: fix url encoding of medialibrary endpoints

Pierre Lamot git at videolan.org
Fri Jan 10 15:06:13 CET 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Tue Jan  7 16:12:13 2020 +0100| [4fd1e6b78414d403481f9ad1518d580629762116] | committer: Jean-Baptiste Kempf

qt: fix url encoding of medialibrary endpoints

  QUrl::toString use QUrl::PrettyDecoded by default, but this doesn't encode
  spaces for instance and creates missformated URL

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4fd1e6b78414d403481f9ad1518d580629762116
---

 modules/gui/qt/network/networkmediamodel.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt/network/networkmediamodel.cpp b/modules/gui/qt/network/networkmediamodel.cpp
index 2787215b64..4acf17a8bc 100644
--- a/modules/gui/qt/network/networkmediamodel.cpp
+++ b/modules/gui/qt/network/networkmediamodel.cpp
@@ -130,10 +130,11 @@ void NetworkMediaModel::setIndexed(bool indexed)
     if (indexed == m_indexed || !m_canBeIndexed)
         return;
     int res;
-    if ( indexed )
-        res = vlc_ml_add_folder( m_ml, qtu( m_url.toString( QUrl::None ) ) );
-    else
-        res = vlc_ml_remove_folder( m_ml, qtu( m_url.toString( QUrl::None ) ) );
+    if ( indexed ) {
+        printf("add folder %s\n", qtu( m_url.toString( QUrl::FullyEncoded ) ));
+        res = vlc_ml_add_folder( m_ml, qtu( m_url.toString( QUrl::FullyEncoded ) ) );
+    } else
+        res = vlc_ml_remove_folder( m_ml, qtu( m_url.toString( QUrl::FullyEncoded ) ) );
 
     if (res == VLC_SUCCESS) {
         m_indexed = indexed;



More information about the vlc-commits mailing list