Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
If a project is missing a layer dependancy, don't abort out loading it
Otherwise we've effectively destroyed the project. Rather, continue
to load whatever layers we possibly can

Fixes #38562
  • Loading branch information
nyalldawson committed Sep 6, 2020
1 parent 08561d3 commit dd82478
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/qgsproject.cpp
Expand Up @@ -1068,9 +1068,13 @@ bool QgsProject::_getMapLayers( const QDomDocument &doc, QList<QDomNode> &broken
// order layers based on their dependencies
QgsScopedRuntimeProfile profile( tr( "Sorting layers" ), QStringLiteral( "projectload" ) );
QgsLayerDefinition::DependencySorter depSorter( doc );
if ( depSorter.hasCycle() || depSorter.hasMissingDependency() )
if ( depSorter.hasCycle() )
return false;

// Missing a dependency? We still load all the layers, otherwise the project is completely broken!
if ( depSorter.hasMissingDependency() )
returnStatus = false;

emit layerLoaded( 0, nl.count() );

const QVector<QDomNode> sortedLayerNodes = depSorter.sortedLayerNodes();
Expand Down

0 comments on commit dd82478

Please sign in to comment.