Skip to content
Permalink
Browse files

Fix project load task never completes when project fails layer

dependancy tests

Refs #38562
  • Loading branch information
nyalldawson committed Sep 6, 2020
1 parent dd3cc12 commit 08561d37175bef7b6d6f2fe2ce7bccfa09ac9391
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/qgsproject.cpp
@@ -1065,14 +1065,14 @@ bool QgsProject::_getMapLayers( const QDomDocument &doc, QList<QDomNode> &broken

bool returnStatus = true;

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

// order layers based on their dependencies
QgsScopedRuntimeProfile profile( tr( "Sorting layers" ), QStringLiteral( "projectload" ) );
QgsLayerDefinition::DependencySorter depSorter( doc );
if ( depSorter.hasCycle() || depSorter.hasMissingDependency() )
return false;

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

const QVector<QDomNode> sortedLayerNodes = depSorter.sortedLayerNodes();
const int totalLayerCount = sortedLayerNodes.count();

0 comments on commit 08561d3

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