Skip to content
Permalink
Browse files

Merge pull request #38621 from qgis-bot/backport-38594-to-release-3_10

[Backport release-3_10] Fix project never completes loading layers when a layer has a missing dependancy
  • Loading branch information
m-kuhn committed Sep 12, 2020
2 parents 962bbff + 5b55cad commit 1c72a696e494dce4255c5832081946bc2c644f2f
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/core/qgsproject.cpp
@@ -951,13 +951,17 @@ bool QgsProject::_getMapLayers( const QDomDocument &doc, QList<QDomNode> &broken

bool returnStatus = true;

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

// order layers based on their dependencies
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();
const int totalLayerCount = sortedLayerNodes.count();

0 comments on commit 1c72a69

Please sign in to comment.
You can’t perform that action at this time.