[vlc-devel] commit: The default constructor of QSize produce an invalid size, there is no need to do that manually. (Benjamin )

git version control git at videolan.org
Sun Oct 25 17:14:37 CET 2009


vlc | branch: master | Benjamin <ikipou at gmail.com> | Sun Oct 25 16:29:41 2009 +0100| [f10e4010226ad843c5e694acae155d67b2324e17] | committer: Ilkka Ollakka 

The default constructor of QSize produce an invalid size, there is no need to do that manually.

The widget is hidden by default, no need to call hide in the
constructor.

The widget reparentable already has the layout.

Signed-off-by: Ilkka Ollakka <ileoo at videolan.org>

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

 modules/gui/qt4/components/interface_widgets.cpp |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 01c5564..f619624 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -80,15 +80,11 @@ protected:
  * This class handles resize issues
  **********************************************************************/
 
-VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
+VideoWidget::VideoWidget( intf_thread_t *_p_i )
+    : QFrame( NULL )
+      , p_intf( _p_i )
+      , reparentable( NULL )
 {
-    /* Init */
-    reparentable = NULL;
-    videoSize.rwidth() = -1;
-    videoSize.rheight() = -1;
-
-    hide();
-
     /* Set the policy to expand in both directions */
 //    setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
 
@@ -147,7 +143,6 @@ WId VideoWidget::request( int *pi_x, int *pi_y,
 
     innerLayout->addWidget( stable );
 
-    reparentable->setLayout( innerLayout );
     layout->addWidget( reparentable );
 
 #ifdef Q_WS_X11
@@ -178,8 +173,8 @@ void VideoWidget::SetSizing( unsigned int w, unsigned int h )
     if (reparentable->windowState() & Qt::WindowFullScreen )
         return;
     msg_Dbg( p_intf, "Video is resizing to: %i %i", w, h );
-    videoSize.rwidth() = w;
-    videoSize.rheight() = h;
+    videoSize.setWidth( w );
+    videoSize.setHeight( h );
     if( !isVisible() ) show();
     updateGeometry(); // Needed for deinterlace
     videoSync();
@@ -271,8 +266,7 @@ void VideoWidget::release( void )
 
     delete reparentable;
     reparentable = NULL;
-    videoSize.rwidth() = 0;
-    videoSize.rheight() = 0;
+    videoSize = QSize();
     updateGeometry();
     hide();
 }




More information about the vlc-devel mailing list