[vlc-commits] qt: sub-file expects a file path (fixes #18664)

Rémi Denis-Courmont git at videolan.org
Mon Aug 7 20:48:17 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug  7 21:46:07 2017 +0300| [f34079c1660966037b35d327e29728b82d1b8f29] | committer: Rémi Denis-Courmont

qt: sub-file expects a file path (fixes #18664)

The sub-file wants a file path, not an URI. Set it accordingly.

NOTE: Either way, this won´t work if the path contains a whitespace
because of longstanding bug #1952.

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

 modules/gui/qt/components/open_panels.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/components/open_panels.cpp b/modules/gui/qt/components/open_panels.cpp
index 76609b36b2..15f59c477b 100644
--- a/modules/gui/qt/components/open_panels.cpp
+++ b/modules/gui/qt/components/open_panels.cpp
@@ -249,12 +249,18 @@ void FileOpenPanel::removeFile()
 /* Show a fileBrowser to select a subtitle */
 void FileOpenPanel::browseFileSub()
 {
-    // TODO Handle selection of more than one subtitles file
     QStringList urls = THEDP->showSimpleOpen( qtr("Open subtitle file"),
                            EXT_FILTER_SUBTITLE, p_intf->p_sys->filepath );
 
     if( urls.isEmpty() ) return;
-    ui.subInput->setText( urls.join(" ") );
+
+    // TODO Handle selection of more than one subtitles file
+    char *path = vlc_uri2path( qtu(urls[0]) );
+    if( path == NULL )
+        return;
+
+    ui.subInput->setText( qfu(path) );
+    free( path );
     updateMRL();
 }
 



More information about the vlc-commits mailing list