vlc | branch: master | Pierre Lamot <[email protected]> | Tue Jun 5 11:30:13 2018 +0200| [bc02f60c248efc97aa2557ac0291788ba868f097] | committer: Jean-Baptiste Kempf
qt: fix subtitle open not selecting the current video folder scheme was prunned Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bc02f60c248efc97aa2557ac0291788ba868f097 --- modules/gui/qt/dialogs_provider.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/gui/qt/dialogs_provider.cpp b/modules/gui/qt/dialogs_provider.cpp index 3061b2dad6..a6e9d240c5 100644 --- a/modules/gui/qt/dialogs_provider.cpp +++ b/modules/gui/qt/dialogs_provider.cpp @@ -794,22 +794,20 @@ void DialogsProvider::loadSubtitlesFile() if( !p_item ) return; char *path = input_item_GetURI( p_item ); - char *path2 = NULL; + QUrl url; if( path ) { - path2 = vlc_uri2path( path ); - free( path ); - if( path2 ) - { - char *sep = strrchr( path2, DIR_SEP_CHAR ); - if( sep ) *sep = '\0'; - } + url.setUrl( qfu(path) ); + url = url.adjusted(QUrl::RemoveFilename); + if (url.scheme() != "file") + url.clear(); + free(path); } QStringList qsl = showSimpleOpen( qtr( "Open subtitles..." ), EXT_FILTER_SUBTITLE, - qfu( path2 ) ); - free( path2 ); + url ); + foreach( const QString &qsUrl, qsl ) { if( input_AddSlave( p_input, SLAVE_TYPE_SPU, qtu( qsUrl ), true, true, false ) ) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
