[vlc-commits] qt: fix subtitle open not selecting the current video folder
Pierre Lamot
git at videolan.org
Mon Jun 11 10:25:59 CEST 2018
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | 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 <jb at videolan.org>
> 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 ) )
More information about the vlc-commits
mailing list