Commit a6817bec authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Qt4: fix opening directory with special characters

parent 1644d683
......@@ -497,12 +497,25 @@ static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
{
QString dir = QFileDialog::getExistingDirectory( NULL, qtr( I_OP_DIR_WINTITLE ), p_intf->p_sys->filepath );
if (!dir.isEmpty() )
if( dir.isEmpty() )
return;
QString mrl;
if( dir.endsWith( "/VIDEO_TS", Qt::CaseInsensitive ) )
mrl = qfu("dvd://") + toNativeSeparators( dir );
else
{
QString mrl = (dir.endsWith( "VIDEO_TS", Qt::CaseInsensitive ) ?
"dvd://" : "directory://")
+ toNativeSeparators( dir );
char *uri = make_URI( qtu( dir ), "directory" );
if( unlikely(uri == NULL) )
return;
mrl = qfu(uri);
free( uri );
}
input_item_t *p_input = input_item_New( THEPL, qtu( mrl ), NULL );
if( unlikely( p_input == NULL ) )
return;
/* FIXME: playlist_AddInput() can fail */
playlist_AddInput( THEPL, p_input,
......@@ -512,7 +525,6 @@ static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
if( !go )
input_Read( THEPL, p_input );
vlc_gc_decref( p_input );
}
}
void DialogsProvider::PLOpenDir()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment