[vlc-devel] commit: Fix some playlist start showing/non-showing bug. ( Jean-Baptiste Kempf )

git version control git at videolan.org
Mon Aug 25 23:33:22 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Aug 25 14:35:42 2008 -0700| [bc2e32496eee7fe00608abbc15c39fd56c868010] | committer: Jean-Baptiste Kempf 

Fix some playlist start showing/non-showing bug.

Still errors present, but too latE.

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

 modules/gui/qt4/components/playlist/playlist.cpp |   12 ++++++++++++
 modules/gui/qt4/components/playlist/playlist.hpp |    5 +++--
 modules/gui/qt4/dialogs_provider.cpp             |    2 ++
 modules/gui/qt4/dialogs_provider.hpp             |    2 ++
 modules/gui/qt4/main_interface.cpp               |   12 ++++++++----
 5 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist.cpp b/modules/gui/qt4/components/playlist/playlist.cpp
index 2ae4a44..7168d36 100644
--- a/modules/gui/qt4/components/playlist/playlist.cpp
+++ b/modules/gui/qt4/components/playlist/playlist.cpp
@@ -156,3 +156,15 @@ void PlaylistWidget::dragEnterEvent(QDragEnterEvent *event)
     event->acceptProposedAction();
 }
 
+void PlaylistWidget::closeEvent( QCloseEvent *event )
+{
+    if( THEDP->isDying() )
+    {
+        close();
+    }
+    else
+    {
+        if( p_intf->p_sys->p_mi )
+            p_intf->p_sys->p_mi->togglePlaylist();
+    }
+}
diff --git a/modules/gui/qt4/components/playlist/playlist.hpp b/modules/gui/qt4/components/playlist/playlist.hpp
index 5945176..701b913 100644
--- a/modules/gui/qt4/components/playlist/playlist.hpp
+++ b/modules/gui/qt4/components/playlist/playlist.hpp
@@ -56,8 +56,9 @@ private:
     QWidget *parent;
 protected:
     intf_thread_t *p_intf;
-    void dropEvent( QDropEvent *);
-    void dragEnterEvent( QDragEnterEvent * );
+    virtual void dropEvent( QDropEvent *);
+    virtual void dragEnterEvent( QDragEnterEvent * );
+    virtual void closeEvent( QCloseEvent * );
 
 private slots:
     void setArt( QString );
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index cf4207e..fe37d85 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -57,6 +57,7 @@ DialogsProvider* DialogsProvider::instance = NULL;
 DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
                                   QObject( NULL ), p_intf( _p_intf )
 {
+    b_isDying = false;
     fixed_timer = new QTimer( this );
     fixed_timer->start( 150 /* milliseconds */ );
 
@@ -92,6 +93,7 @@ DialogsProvider::~DialogsProvider()
 
 void DialogsProvider::quit()
 {
+    b_isDying = true;
     vlc_object_kill( p_intf->p_libvlc );
     QApplication::closeAllWindows();
     QApplication::quit();
diff --git a/modules/gui/qt4/dialogs_provider.hpp b/modules/gui/qt4/dialogs_provider.hpp
index d86e24e..d69e9f5 100644
--- a/modules/gui/qt4/dialogs_provider.hpp
+++ b/modules/gui/qt4/dialogs_provider.hpp
@@ -116,6 +116,7 @@ public:
                                 EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
                                 EXT_FILTER_PLAYLIST,
                                 QString path = QString() );
+    bool isDying() { return b_isDying; }
 protected:
     QSignalMapper *menusMapper;
     QSignalMapper *menusUpdateMapper;
@@ -127,6 +128,7 @@ private:
     intf_thread_t *p_intf;
     static DialogsProvider *instance;
     void addFromSimple( bool, bool );
+    bool b_isDying;
 
 public slots:
     void doInteraction( intf_dialog_args_t * );
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 7a5b196..84a1883 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -218,10 +218,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     QVLCTools::restoreWidgetPosition( settings, this, QSize(380, 60) );
 
 
-    /* Playlist */
-    if( settings->value( "playlist-visible", 0 ).toInt() ) togglePlaylist();
+    bool b_visible = settings->value( "playlist-visible", 0 ).toInt();
     settings->endGroup();
 
+    /* Playlist */
+    if( b_visible ) togglePlaylist();
+
     /* Final sizing and showing */
     setMinimumWidth( __MAX( controls->sizeHint().width(),
                             menuBar()->sizeHint().width() ) );
@@ -740,8 +742,10 @@ void MainInterface::togglePlaylist()
     {
         playlistWidget = new PlaylistWidget( p_intf, this );
 
-        i_pl_dock = (pl_dock_e)getSettings()
-                         ->value( "pl-dock-status", PL_UNDOCKED ).toInt();
+        i_pl_dock = PL_UNDOCKED;
+/*        i_pl_dock = (pl_dock_e)getSettings()
+                         ->value( "pl-dock-status", PL_UNDOCKED ).toInt(); */
+
         if( i_pl_dock == PL_UNDOCKED )
         {
             playlistWidget->setWindowFlags( Qt::Window );




More information about the vlc-devel mailing list