]> git.sesse.net Git - vlc/commitdiff
Qt: Add a parent to the CoverArtLabel We should add parents to all QWidgets created...
authorJean-Philippe Andre <jpeg@via.ecp.fr>
Fri, 12 Sep 2008 04:24:28 +0000 (00:24 -0400)
committerJean-Philippe Andre <jpeg@via.ecp.fr>
Fri, 12 Sep 2008 05:03:22 +0000 (01:03 -0400)
modules/gui/qt4/components/info_panels.cpp
modules/gui/qt4/components/info_panels.hpp
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/playlist.hpp

index 5b78c9b7665806573681e43f2496aae80de4aeb7..a6c7f88b1ffc9b70c7416e914e6dbb47dfe0f200 100644 (file)
@@ -106,7 +106,7 @@ MetaPanel::MetaPanel( QWidget *parent,
     line++;
 
     /* ART_URL */
-    art_cover = new CoverArtLabel( VLC_OBJECT( p_intf ) );
+    art_cover = new CoverArtLabel( this, VLC_OBJECT( p_intf ) );
     metaLayout->addWidget( art_cover, line, 8, 4, 2, Qt::AlignRight );
 
 /* Settings is unused */
index 5a948e45e92113a3db5f723a103909cbeb787125..ed2d8d51d40418c99d9ba0fd6551e5c8cee9a39b 100644 (file)
@@ -159,13 +159,5 @@ public slots:
     void update( input_item_t * );
     void clear();
 };
-class ArtCover : public QLabel
-{
-    Q_OBJECT
-    void mouseDoubleClickEvent( QMouseEvent *event )
-    {
-        fprintf(stderr, "**************************" );
-    }
-};
 
 #endif
index 2b04e5eb868dfe1528d560bb55945f8af0821ba1..4edc1271f91c44feda4f082077a18eb5f04039f4 100644 (file)
@@ -1467,8 +1467,10 @@ static int downloadCoverCallback( vlc_object_t *p_this,
     return VLC_SUCCESS;
 }
 
-CoverArtLabel::CoverArtLabel( vlc_object_t *_p_this, input_item_t *_p_input )
-        : p_this( _p_this), p_input( _p_input ), prevArt()
+CoverArtLabel::CoverArtLabel( QWidget *parent,
+                              vlc_object_t *_p_this,
+                              input_item_t *_p_input )
+        : QLabel( parent ), p_this( _p_this), p_input( _p_input ), prevArt()
 {
     setContextMenuPolicy( Qt::ActionsContextMenu );
     CONNECT( this, updateRequested(), this, doUpdate() );
index f6dd9240d5f24e1bd06caecd6799884151b9d970..85d50e1ce8102b8250869c84f100231a662a6d90 100644 (file)
@@ -380,8 +380,11 @@ class CoverArtLabel : public QLabel
 {
     Q_OBJECT
 public:
-    CoverArtLabel( vlc_object_t *p_this, input_item_t *p_input = NULL );
-    virtual ~CoverArtLabel() {};
+    CoverArtLabel( QWidget *parent,
+                   vlc_object_t *p_this,
+                   input_item_t *p_input = NULL );
+    virtual ~CoverArtLabel()
+            { if( p_input ) vlc_gc_decref( p_input ); };
 private:
     input_item_t *p_input;
     vlc_object_t *p_this;
index a16d39e81765f8b82b9379edd3bafa3d7a030980..6731356fa8e42b3f92f2c3321cc6b5a23df7915e 100644 (file)
@@ -64,7 +64,7 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i,
     artContainer->setMaximumHeight( 128 );
 
     /* Art label */
-    art = new ArtLabel( p_intf );
+    art = new ArtLabel( artContainer, p_intf );
     art->setToolTip( qtr( "Double click to get media information" ) );
 
     artContLay->addWidget( art, 1 );
index 71180e0c0f36a017fea950a0cfa67b9ee896051c..cb48b9cf9568d8603d957d835ed1a3b9f736a632 100644 (file)
@@ -70,7 +70,8 @@ class ArtLabel : public CoverArtLabel
 {
     Q_OBJECT
 public:
-    ArtLabel( intf_thread_t *intf ) : CoverArtLabel( VLC_OBJECT( intf ) ) {};
+    ArtLabel( QWidget *parent, intf_thread_t *intf )
+            : CoverArtLabel( parent, VLC_OBJECT( intf ) ) {};
     virtual ~ArtLabel() {};
     void mouseDoubleClickEvent( QMouseEvent *event )
     {