[vlc-commits] Qt: AspectRatio Box, code style
Jean-Baptiste Kempf
git at videolan.org
Wed Feb 22 00:11:44 CET 2012
vlc/vlc-2.0 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Feb 21 23:59:40 2012 +0100| [fd6840e2c53ef75341f1ea9e65da5700fc1e90a6] | committer: Jean-Baptiste Kempf
Qt: AspectRatio Box, code style
(cherry picked from commit 956e357d52599478042bee88394d723b32a0d42d)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=fd6840e2c53ef75341f1ea9e65da5700fc1e90a6
---
modules/gui/qt4/components/controller_widget.cpp | 19 +++++++++++++------
modules/gui/qt4/components/controller_widget.hpp | 12 ++++++------
2 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/modules/gui/qt4/components/controller_widget.cpp b/modules/gui/qt4/components/controller_widget.cpp
index 9ba998c..a436816 100644
--- a/modules/gui/qt4/components/controller_widget.cpp
+++ b/modules/gui/qt4/components/controller_widget.cpp
@@ -268,25 +268,32 @@ void LoopButton::updateButtonIcons( int value )
: QIcon( ":/buttons/playlist/repeat_all" ) );
}
-void AspectRatioComboBox::updateRatios() {
+void AspectRatioComboBox::updateRatios()
+{
/* Clear the list before updating */
- this->clear();
+ clear();
vlc_value_t val_list, text_list;
vout_thread_t* p_vout = THEMIM->getVout();
+
/* Disable if there is no vout */
- if( p_vout == NULL ) {
+ if( p_vout == NULL )
+ {
addItem( qtr("Aspect Ratio") );
setDisabled( true );
return;
}
+
var_Change( p_vout, "aspect-ratio", VLC_VAR_GETLIST, &val_list, &text_list );
for( int i = 0; i < val_list.p_list->i_count; i++ )
- addItem( qfu( text_list.p_list->p_values[i].psz_string ), QString( val_list.p_list->p_values[i].psz_string ) );
+ addItem( qfu( text_list.p_list->p_values[i].psz_string ),
+ QString( val_list.p_list->p_values[i].psz_string ) );
setEnabled( true );
var_FreeList( &val_list, &text_list );
}
-void AspectRatioComboBox::updateAspectRatio( int x ) {
+void AspectRatioComboBox::updateAspectRatio( int x )
+{
vout_thread_t* p_vout = THEMIM->getVout();
- if( p_vout && x >= 0 ) var_SetString( p_vout, "aspect-ratio", qtu( itemData(x).toString() ) );
+ if( p_vout && x >= 0 )
+ var_SetString( p_vout, "aspect-ratio", qtu( itemData(x).toString() ) );
}
diff --git a/modules/gui/qt4/components/controller_widget.hpp b/modules/gui/qt4/components/controller_widget.hpp
index d56ee4a..c287469 100644
--- a/modules/gui/qt4/components/controller_widget.hpp
+++ b/modules/gui/qt4/components/controller_widget.hpp
@@ -73,21 +73,21 @@ private slots:
class AspectRatioComboBox : public QComboBox
{
Q_OBJECT
- public:
- AspectRatioComboBox( intf_thread_t* _p_intf ) {
- p_intf = _p_intf;
+public:
+ AspectRatioComboBox( intf_thread_t* _p_intf ) : p_intf( _p_intf )
+ {
CONNECT( THEMIM->getIM(), voutChanged( bool ),
this, updateRatios() );
CONNECT( this, currentIndexChanged( int ),
this, updateAspectRatio( int ) );
- this->updateRatios();
+ updateRatios();
}
- public slots:
+public slots:
void updateRatios();
void updateAspectRatio( int );
- private:
+private:
intf_thread_t* p_intf;
};
More information about the vlc-commits
mailing list