Commit 72852e3b authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: fix a misconception and a leak.

parent a78e7a5c
...@@ -289,7 +289,7 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, const QString text ) ...@@ -289,7 +289,7 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, const QString text )
setContextMenuPolicy ( Qt::CustomContextMenu ); setContextMenuPolicy ( Qt::CustomContextMenu );
/* Create the Speed Control Widget */ /* Create the Speed Control Widget */
speedControl = new SpeedControlWidget( p_intf ); speedControl = new SpeedControlWidget( p_intf, this );
speedControlMenu = new QMenu( this ); speedControlMenu = new QMenu( this );
QWidgetAction *widgetAction = new QWidgetAction( speedControl ); QWidgetAction *widgetAction = new QWidgetAction( speedControl );
...@@ -304,8 +304,7 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, const QString text ) ...@@ -304,8 +304,7 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, const QString text )
/* Change the SpeedRate in the Status Bar */ /* Change the SpeedRate in the Status Bar */
CONNECT( THEMIM->getIM(), rateChanged( int ), this, setRate( int ) ); CONNECT( THEMIM->getIM(), rateChanged( int ), this, setRate( int ) );
// FIXME this is wrong but will work for some time. CONNECT( THEMIM, inputChanged( input_thread_t * ),
CONNECT( THEMIM->getIM(), statusChanged( int ),
speedControl, activateOnState() ); speedControl, activateOnState() );
} }
...@@ -331,8 +330,8 @@ void SpeedLabel::setRate( int rate ) ...@@ -331,8 +330,8 @@ void SpeedLabel::setRate( int rate )
/********************************************************************** /**********************************************************************
* Speed control widget * Speed control widget
**********************************************************************/ **********************************************************************/
SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i ) : SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i, QWidget *_parent )
QFrame( NULL ), p_intf( _p_i ) : QFrame( _parent ), p_intf( _p_i )
{ {
QSizePolicy sizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed ); QSizePolicy sizePolicy( QSizePolicy::Maximum, QSizePolicy::Fixed );
sizePolicy.setHorizontalStretch( 0 ); sizePolicy.setHorizontalStretch( 0 );
...@@ -523,8 +522,8 @@ TimeLabel::TimeLabel( intf_thread_t *_p_intf ) :QLabel(), p_intf( _p_intf ) ...@@ -523,8 +522,8 @@ TimeLabel::TimeLabel( intf_thread_t *_p_intf ) :QLabel(), p_intf( _p_intf )
setToolTip( qtr( "Toggle between elapsed and remaining time" ) ); setToolTip( qtr( "Toggle between elapsed and remaining time" ) );
CONNECT( THEMIM->getIM(), statusChanged( int ), /* CONNECT( THEMIM->getIM(), statusChanged( int ),
this, setStatus( int ) ); this, setStatus( int ) ); Remove */
CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ), CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ),
this, setDisplayPosition( float, int, int ) ); this, setDisplayPosition( float, int, int ) );
} }
...@@ -549,7 +548,7 @@ void TimeLabel::toggleTimeDisplay() ...@@ -549,7 +548,7 @@ void TimeLabel::toggleTimeDisplay()
{ {
b_remainingTime = !b_remainingTime; b_remainingTime = !b_remainingTime;
} }
/* This is wrong remove */
void TimeLabel::setStatus( int i_status ) void TimeLabel::setStatus( int i_status )
{ {
msg_Warn( p_intf, "Status: %i", i_status ); msg_Warn( p_intf, "Status: %i", i_status );
......
...@@ -175,7 +175,7 @@ class SpeedControlWidget : public QFrame ...@@ -175,7 +175,7 @@ class SpeedControlWidget : public QFrame
{ {
Q_OBJECT Q_OBJECT
public: public:
SpeedControlWidget( intf_thread_t *); SpeedControlWidget( intf_thread_t *, QWidget * );
void updateControls( int ); void updateControls( int );
private: private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment