]> git.sesse.net Git - vlc/commitdiff
Qt4: Playlist fixes.
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 29 Sep 2008 18:33:57 +0000 (11:33 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 1 Oct 2008 03:13:54 +0000 (20:13 -0700)
(cherry picked from commit 6b67205f13b3f8ce5a3c860b63a95f3bccf8d934)

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/playlist.hpp
modules/gui/qt4/dialogs/playlist.cpp
modules/gui/qt4/main_interface.cpp

index 8d07f3462f7e7e78bacbc03cf1fd8060753ca8f5..b570b82b321ea5963306075303fdac51b22f30cc 100644 (file)
@@ -42,9 +42,7 @@
  * Playlist Widget. The embedded playlist
  **********************************************************************/
 
-PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i,
-                                QWidget *_parent )
-               : p_intf ( _p_i ), parent( _parent )
+PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i ) : p_intf ( _p_i )
 {
     setContentsMargins( 3, 3, 3, 3 );
 
@@ -130,8 +128,8 @@ PlaylistWidget::~PlaylistWidget()
 {
     getSettings()->beginGroup("Playlist");
     getSettings()->setValue( "splitterSizes", saveState() );
-    getSettings()->setValue( "GlobalPos", mapToGlobal( pos() ) );
     getSettings()->endGroup();
+    msg_Dbg( p_intf, "Playlist Destroyed" );
 }
 
 #include "main_interface.hpp"
index cb48b9cf9568d8603d957d835ed1a3b9f736a632..71b7fd955c9ba50985707c25f6808c2af1cf8bbb 100644 (file)
@@ -48,14 +48,13 @@ class PlaylistWidget : public QSplitter
 {
     Q_OBJECT;
 public:
-    PlaylistWidget( intf_thread_t *_p_i, QWidget *parent ) ;
+    PlaylistWidget( intf_thread_t *_p_i );
     virtual ~PlaylistWidget();
 private:
     PLSelector *selector;
     PLPanel *rightPanel;
     QPushButton *addButton;
     ArtLabel *art;
-    QWidget *parent;
 protected:
     intf_thread_t *p_intf;
     virtual void dropEvent( QDropEvent *);
index b8d4eadc2f4f4752a998b4c984742b2e75228f4a..f15e584e9ae1473f12f7410796bdbc7af3046546 100644 (file)
@@ -52,7 +52,7 @@ PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf )
 
     getSettings()->beginGroup("playlistdialog");
 
-    playlistWidget = new PlaylistWidget( p_intf, this );
+    playlistWidget = new PlaylistWidget( p_intf );
     l->addWidget( playlistWidget );
 
     readSettings( getSettings(), QSize( 600,700 ) );
index 150a6d275bb761b8a7c098a412b4777f55bb7501..7417307c7b55222b3ddcc08dbf047431733515c3 100644 (file)
@@ -253,6 +253,8 @@ MainInterface::~MainInterface()
     {
         if( !isDocked() )
             QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
+
+        delete playlistWidget;
     }
 
     settings->beginGroup( "MainWindow" );
@@ -725,7 +727,7 @@ void MainInterface::togglePlaylist()
     If no playlist exist, then create one and attach it to the DockPL*/
     if( !playlistWidget )
     {
-        playlistWidget = new PlaylistWidget( p_intf, this );
+        playlistWidget = new PlaylistWidget( p_intf );
 
         i_pl_dock = PL_UNDOCKED;
 /*        i_pl_dock = (pl_dock_e)getSettings()
@@ -733,15 +735,12 @@ void MainInterface::togglePlaylist()
 
         if( i_pl_dock == PL_UNDOCKED )
         {
-            playlistWidget->setParent( this, Qt::Window );
+            playlistWidget->setWindowFlags( Qt::Window );
 
             /* This will restore the geometry but will not work for position,
                because of parenting */
             QVLCTools::restoreWidgetPosition( p_intf, "Playlist",
                     playlistWidget, QSize( 600, 300 ) );
-            /* Move it correctly then */
-            playlistWidget->move(
-                    getSettings()->value( "Playlist/GlobalPos" ).toPoint() );
         }
         else
         {