]> git.sesse.net Git - vlc/commitdiff
Qt4: fix opening DVD directory with special characters
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 7 Jul 2010 18:57:56 +0000 (21:57 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 7 Jul 2010 18:58:31 +0000 (21:58 +0300)
modules/gui/qt4/dialogs_provider.cpp

index 8e77ada66912916767e6085c4461a29619ae8c9e..d3343bdf1557b5d54b6c8ea0ee09249d099f9ce6 100644 (file)
@@ -500,20 +500,18 @@ static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
     if( dir.isEmpty() )
         return;
 
-    QString mrl;
-
+    const char *scheme = "directory";
     if( dir.endsWith( "/VIDEO_TS", Qt::CaseInsensitive ) )
-        mrl = qfu("dvd://") + toNativeSeparators( dir );
-    else
-    {
-        char *uri = make_URI( qtu( dir ), "directory" );
-        if( unlikely(uri == NULL) )
-            return;
-        mrl = qfu(uri);
-        free( uri );
-    }
+        scheme = "dvd";
 
-    input_item_t *p_input = input_item_New( THEPL, qtu( mrl ), NULL );
+    char *uri = make_URI( qtu( dir ), scheme );
+    if( unlikely(uri == NULL) )
+        return;
+
+    RecentsMRL::getInstance( p_intf )->addRecent( qfu(uri) );
+
+    input_item_t *p_input = input_item_New( THEPL, uri, NULL );
+    free( uri );
     if( unlikely( p_input == NULL ) )
         return;
 
@@ -521,7 +519,6 @@ static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
     playlist_AddInput( THEPL, p_input,
                       go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
                        PLAYLIST_END, pl, pl_Unlocked );
-    RecentsMRL::getInstance( p_intf )->addRecent( mrl );
     if( !go )
         input_Read( THEPL, p_input );
     vlc_gc_decref( p_input );