]> git.sesse.net Git - vlc/commitdiff
Qt: remove code duplication.
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 7 Feb 2009 19:57:30 +0000 (20:57 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 7 Feb 2009 19:57:54 +0000 (20:57 +0100)
modules/gui/qt4/components/controller_widget.cpp

index 7aa960c5464879f8fb52460e9b6a68e4ed82f579..8cad93a81bf51c7dffce232c889265bba3f879dc 100644 (file)
@@ -55,20 +55,18 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
     /* We might need a subLayout too */
     QVBoxLayout *subLayout;
 
+    volMuteLabel->installEventFilter( this );
+
     /* Normal View, click on icon mutes */
     if( !b_special )
     {
-        volMuteLabel->installEventFilter( this );
-        volumeMenu = NULL;
-        subLayout = NULL;
+        volumeMenu = NULL; subLayout = NULL;
     }
     else
     {
         /* Special view, click on button shows the slider */
         b_shiny = false;
 
-        volMuteLabel->installEventFilter( this );
-
         QFrame *volumeControlWidget = new QFrame;
         subLayout = new QVBoxLayout( volumeControlWidget );
         subLayout->setLayoutMargins( 4, 4, 4, 4, 4 );
@@ -77,7 +75,6 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
         QWidgetAction *widgetAction = new QWidgetAction( volumeControlWidget );
         widgetAction->setDefaultWidget( volumeControlWidget );
         volumeMenu->addAction( widgetAction );
-
     }
 
     /* And add the label */