[vlc-devel] commit: Do not read directory twice. This solves #1761 but this may not be the real solution. See the origin of the segfault in my comments on the trac. ( Jean-Philippe Andre )

git version control git at videolan.org
Sun Aug 24 06:49:24 CEST 2008


vlc | branch: master | Jean-Philippe Andre <jpeg at via.ecp.fr> | Sun Aug 24 00:49:38 2008 -0400| [8f529eaeffc2ba89ce5222e1472c8314ce31e9d3] | committer: Jean-Philippe Andre 

Do not read directory twice. This solves #1761 but this may not be the real solution. See the origin of the segfault in my comments on the trac.

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

 modules/gui/qt4/dialogs_provider.cpp |    8 +++++++-
 modules/gui/qt4/dialogs_provider.hpp |    1 +
 modules/gui/qt4/menus.cpp            |    4 ++--
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index 19eeeff..cf4207e 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -422,11 +422,17 @@ 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 );
-        input_Read( THEPL, p_input, false );
+        if( !go )
+            input_Read( THEPL, p_input, false );
         vlc_gc_decref( p_input );
     }
 }
 
+void DialogsProvider::PLOpenDir()
+{
+    openDirectory( p_intf, true, true );
+}
+
 void DialogsProvider::PLAppendDir()
 {
     openDirectory( p_intf, true, false );
diff --git a/modules/gui/qt4/dialogs_provider.hpp b/modules/gui/qt4/dialogs_provider.hpp
index d1547b2..d86e24e 100644
--- a/modules/gui/qt4/dialogs_provider.hpp
+++ b/modules/gui/qt4/dialogs_provider.hpp
@@ -166,6 +166,7 @@ public slots:
 
     void PLAppendDialog();
     void MLAppendDialog();
+    void PLOpenDir();
     void PLAppendDir();
     void MLAppendDir();
 
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 2280861..35ebb97 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -289,7 +289,7 @@ QMenu *QVLCMenu::FileMenu()
     addDPStaticEntry( menu, qtr( "&Open File..." ), "",
         ":/file-asym", SLOT( openFileDialog() ), "Ctrl+O" );
     addDPStaticEntry( menu, qtr( I_OPEN_FOLDER ), "",
-        ":/folder-grey", SLOT( PLAppendDir() ), "Ctrl+F" );
+        ":/folder-grey", SLOT( PLOpenDir() ), "Ctrl+F" );
     addDPStaticEntry( menu, qtr( "Open &Disc..." ), "",
         ":/disc", SLOT( openDiscDialog() ), "Ctrl+D" );
     addDPStaticEntry( menu, qtr( "Open &Network..." ), "",
@@ -677,7 +677,7 @@ void QVLCMenu::PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu )
     addDPStaticEntry( openmenu, qtr( "&Open File..." ), "",
         ":/file-asym", SLOT( openFileDialog() ) );
     addDPStaticEntry( openmenu, qtr( I_OPEN_FOLDER ), "",
-        ":/folder-grey", SLOT( PLAppendDir() ) );
+        ":/folder-grey", SLOT( PLOpenDir() ) );
     addDPStaticEntry( openmenu, qtr( "Open &Disc..." ), "",
         ":/disc", SLOT( openDiscDialog() ) );
     addDPStaticEntry( openmenu, qtr( "Open &Network..." ), "",




More information about the vlc-devel mailing list