Commit 88d39cee authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Qt4: use explicit direct connections when passing VLC pointers...

...without reference. With a direct connection, the call stack ensures
that the pointer remains valid until the slot returns. This is not the
case for asynchronous ("queued" in Qt4 documentation) signals.

Obviously, this means we have to emit the signals from the Qt4 main loop
thread, *or* alternatively not touch any Qt4 UI stuff fromt he slot.
Hopefully, any such bug would be easier to find this ways.
parent 9bd636a7
......@@ -682,8 +682,8 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, QWi
vlc_mutex_init_recursive( &lock );
CONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ),
this, setVoutList( vout_thread_t **, int ) );
DCONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ),
this, setVoutList( vout_thread_t **, int ) );
/* First Move */
QRect rect1 = getSettings()->value( "FullScreen/screen" ).toRect();
......
......@@ -429,8 +429,8 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, const QString& text,
/* Change the SpeedRate in the Status Bar */
CONNECT( THEMIM->getIM(), rateChanged( int ), this, setRate( int ) );
CONNECT( THEMIM, inputChanged( input_thread_t * ),
speedControl, activateOnState() );
DCONNECT( THEMIM, inputChanged( input_thread_t * ),
speedControl, activateOnState() );
}
SpeedLabel::~SpeedLabel()
......
......@@ -96,8 +96,8 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
rightPanel = new StandardPLPanel( this, p_intf, THEPL, p_root );
/* Connect the activation of the selector to a redefining of the PL */
CONNECT( selector, activated( playlist_item_t * ),
rightPanel, setRoot( playlist_item_t * ) );
DCONNECT( selector, activated( playlist_item_t * ),
rightPanel, setRoot( playlist_item_t * ) );
rightPanel->setRoot( p_root );
......
......@@ -89,10 +89,10 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
#undef ADD_ICON
rebuild( p_root );
CONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
this, processInputItemUpdate( input_item_t *) );
CONNECT( THEMIM, inputChanged( input_thread_t * ),
this, processInputItemUpdate( input_thread_t* ) );
DCONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
this, processInputItemUpdate( input_item_t *) );
DCONNECT( THEMIM, inputChanged( input_thread_t * ),
this, processInputItemUpdate( input_thread_t* ) );
CONNECT( THEMIM, playlistItemAppended( int, int ),
this, processItemAppend( int, int ) );
CONNECT( THEMIM, playlistItemRemoved( int ),
......
......@@ -132,8 +132,8 @@ PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf )
this, plItemAdded( int, int ) );
CONNECT( THEMIM, playlistItemRemoved( int ),
this, plItemRemoved( int ) );
CONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
this, inputItemUpdate( input_item_t * ) );
DCONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
this, inputItemUpdate( input_item_t * ) );
createItems();
CONNECT( this, itemActivated( QTreeWidgetItem *, int ),
......
......@@ -123,8 +123,8 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
getSettings()->endGroup();
CONNECT( THEMIM, leafBecameParent( input_item_t *),
this, browseInto( input_item_t * ) );
DCONNECT( THEMIM, leafBecameParent( input_item_t *),
this, browseInto( input_item_t * ) );
CONNECT( model, currentChanged( const QModelIndex& ),
this, handleExpansion( const QModelIndex& ) );
......
......@@ -100,14 +100,14 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf,
* Connects on the various signals of input_Manager
* For the currently playing element
**/
CONNECT( THEMIM->getIM(), infoChanged( input_item_t* ),
IP, update( input_item_t* ) );
CONNECT( THEMIM->getIM(), currentMetaChanged( input_item_t* ),
MP, update( input_item_t* ) );
CONNECT( THEMIM->getIM(), currentMetaChanged( input_item_t* ),
EMP, update( input_item_t* ) );
CONNECT( THEMIM->getIM(), statisticsUpdated( input_item_t* ),
ISP, update( input_item_t* ) );
DCONNECT( THEMIM->getIM(), infoChanged( input_item_t* ),
IP, update( input_item_t* ) );
DCONNECT( THEMIM->getIM(), currentMetaChanged( input_item_t* ),
MP, update( input_item_t* ) );
DCONNECT( THEMIM->getIM(), currentMetaChanged( input_item_t* ),
EMP, update( input_item_t* ) );
DCONNECT( THEMIM->getIM(), statisticsUpdated( input_item_t* ),
ISP, update( input_item_t* ) );
if( THEMIM->getInput() )
p_item = input_GetItem( THEMIM->getInput() );
......
......@@ -48,8 +48,8 @@ ExtensionsManager::ExtensionsManager( intf_thread_t *_p_intf, QObject *parent )
menuMapper = new QSignalMapper( this );
CONNECT( menuMapper, mapped( int ), this, triggerMenu( int ) );
CONNECT( THEMIM->getIM(), statusChanged( int ), this, playingChanged( int ) );
CONNECT( THEMIM, inputChanged( input_thread_t* ),
this, inputChanged( input_thread_t* ) );
DCONNECT( THEMIM, inputChanged( input_thread_t* ),
this, inputChanged( input_thread_t* ) );
b_unloading = false;
b_failed = false;
}
......
......@@ -918,8 +918,8 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
var_AddCallback( THEPL, "volume-muted", SoundMuteChanged, this );
/* Warn our embedded IM about input changes */
CONNECT( this, inputChanged( input_thread_t * ),
im, setInput( input_thread_t * ) );
DCONNECT( this, inputChanged( input_thread_t * ),
im, setInput( input_thread_t * ) );
/* emit check if playlist has already started playing */
input_thread_t *p_input = playlist_CurrentInput( THEPL );
......
......@@ -94,7 +94,10 @@ struct intf_sys_t
#define qtr( i ) QString::fromUtf8( vlc_gettext(i) )
#define qtu( i ) ((i).toUtf8().constData())
#define CONNECT( a, b, c, d ) connect( a, SIGNAL( b ), c, SLOT(d) )
#define CONNECT( a, b, c, d ) \
connect( a, SIGNAL( b ), c, SLOT(d) )
#define DCONNECT( a, b, c, d ) \
connect( a, SIGNAL( b ), c, SLOT(d), Qt::DirectConnection )
#define BUTTONACT( b, a ) connect( b, SIGNAL( clicked() ), this, SLOT(a) )
#define BUTTON_SET( button, text, tooltip ) \
......
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