mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 00:24:12 +02:00
* Fixed mutex deadlock in SourceList.
This commit is contained in:
@@ -83,15 +83,17 @@ SourceList::loadSources()
|
|||||||
void
|
void
|
||||||
SourceList::setSources( const QList<Tomahawk::source_ptr>& sources )
|
SourceList::setSources( const QList<Tomahawk::source_ptr>& sources )
|
||||||
{
|
{
|
||||||
QMutexLocker lock( &m_mut );
|
|
||||||
|
|
||||||
m_isReady = true;
|
|
||||||
foreach( const source_ptr& src, sources )
|
|
||||||
{
|
{
|
||||||
add( src );
|
QMutexLocker lock( &m_mut );
|
||||||
}
|
|
||||||
|
|
||||||
tLog() << Q_FUNC_INFO << "- Total sources now:" << m_sources.size();
|
m_isReady = true;
|
||||||
|
foreach( const source_ptr& src, sources )
|
||||||
|
{
|
||||||
|
add( src );
|
||||||
|
}
|
||||||
|
|
||||||
|
tLog() << Q_FUNC_INFO << "- Total sources now:" << m_sources.size();
|
||||||
|
}
|
||||||
emit ready();
|
emit ready();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,11 +36,7 @@ RecentPlaylistsModel::RecentPlaylistsModel( unsigned int maxPlaylists, QObject*
|
|||||||
: QAbstractListModel( parent )
|
: QAbstractListModel( parent )
|
||||||
, m_maxPlaylists( maxPlaylists )
|
, m_maxPlaylists( maxPlaylists )
|
||||||
{
|
{
|
||||||
|
connect( SourceList::instance(), SIGNAL( ready() ), SLOT( onReady() ) );
|
||||||
if ( Servent::instance()->isReady() )
|
|
||||||
onReady();
|
|
||||||
else
|
|
||||||
connect( Servent::instance(), SIGNAL( ready() ), this, SLOT( onReady() ) );
|
|
||||||
|
|
||||||
// Load recent playlists initially
|
// Load recent playlists initially
|
||||||
refresh();
|
refresh();
|
||||||
|
Reference in New Issue
Block a user