QgsPluginLayer* QgsPluginLayerRegistry::createLayer( QString typeName )
{
  QgsPluginLayerType* type = pluginLayerType( typeName );
  if ( !type )
  {
    QgsDebugMsg( "Unknown plugin layer type: " + typeName );
    return NULL;
  }

  return type->createLayer();
}
QgsPluginLayer* QgsPluginLayerRegistry::createLayer( const QString& typeName, const QString& uri )
{
  QgsPluginLayerType* type = pluginLayerType( typeName );
  if ( !type )
  {
    QgsDebugMsg( "Unknown plugin layer type: " + typeName );
    return nullptr;
  }

  if ( !uri.isEmpty() )
    return type->createLayer( uri );
  else
    return type->createLayer();
}