mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
* Check whether GeneratorFactory returned a valid control.
This commit is contained in:
@@ -539,12 +539,16 @@ QList< dyncontrol_ptr >
|
|||||||
DynamicPlaylist::variantsToControl( const QList< QVariantMap >& controlsV )
|
DynamicPlaylist::variantsToControl( const QList< QVariantMap >& controlsV )
|
||||||
{
|
{
|
||||||
QList<dyncontrol_ptr> realControls;
|
QList<dyncontrol_ptr> realControls;
|
||||||
foreach( QVariantMap controlV, controlsV ) {
|
foreach( QVariantMap controlV, controlsV )
|
||||||
|
{
|
||||||
dyncontrol_ptr control = GeneratorFactory::createControl( controlV.value( "type" ).toString(), controlV.value( "selectedType" ).toString() );
|
dyncontrol_ptr control = GeneratorFactory::createControl( controlV.value( "type" ).toString(), controlV.value( "selectedType" ).toString() );
|
||||||
// qDebug() << "Creating control with data:" << controlV;
|
// qDebug() << "Creating control with data:" << controlV;
|
||||||
|
if ( control )
|
||||||
|
{
|
||||||
QJson::QObjectHelper::qvariant2qobject( controlV, control.data() );
|
QJson::QObjectHelper::qvariant2qobject( controlV, control.data() );
|
||||||
realControls << control;
|
realControls << control;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return realControls;
|
return realControls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user