Skip to content

Commit

Permalink
Load embedded group from qgz project
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Nov 18, 2019
1 parent 9a9778a commit 35c2a9a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/qgsproject.cpp
Expand Up @@ -2563,8 +2563,16 @@ bool QgsProject::createEmbeddedLayer( const QString &layerId, const QString &pro

QgsLayerTreeGroup *QgsProject::createEmbeddedGroup( const QString &groupName, const QString &projectFilePath, const QStringList &invisibleLayers, QgsProject::ReadFlags flags )
{
QString qgsProjectFile = projectFilePath;
QgsProjectArchive archive;
if ( projectFilePath.endsWith( QLatin1String( ".qgz" ), Qt::CaseInsensitive ) )
{
archive.unzip( projectFilePath );
qgsProjectFile = archive.projectFile();
}

// open project file, get layer ids in group, add the layers
QFile projectFile( projectFilePath );
QFile projectFile( qgsProjectFile );
if ( !projectFile.open( QIODevice::ReadOnly ) )
{
return nullptr;
Expand Down

0 comments on commit 35c2a9a

Please sign in to comment.