File tree 1 file changed +4
-12
lines changed
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -519,30 +519,22 @@ scope. "layers" is a list containing three string values.
519
519
*/
520
520
void _getProperties ( const QDomDocument& doc, QgsProjectPropertyKey& project_properties )
521
521
{
522
- QDomNodeList properties = doc.elementsByTagName ( QStringLiteral ( " properties" ) );
522
+ QDomElement propertiesElem = doc.documentElement (). firstChildElement ( QStringLiteral ( " properties" ) );
523
523
524
- if ( properties.count () > 1 )
525
- {
526
- QgsDebugMsg ( " there appears to be more than one ``properties'' XML tag ... bailing" );
527
- return ;
528
- }
529
- else if ( properties.count () < 1 ) // no properties found, so we're done
524
+ if ( propertiesElem.isNull () ) // no properties found, so we're done
530
525
{
531
526
return ;
532
527
}
533
528
534
- // item(0) because there should only be ONE "properties" node
535
- QDomNodeList scopes = properties.item ( 0 ).childNodes ();
529
+ QDomNodeList scopes = propertiesElem.childNodes ();
536
530
537
531
if ( scopes.count () < 1 )
538
532
{
539
533
QgsDebugMsg ( " empty ``properties'' XML tag ... bailing" );
540
534
return ;
541
535
}
542
536
543
- QDomNode propertyNode = properties.item ( 0 );
544
-
545
- if ( ! project_properties.readXml ( propertyNode ) )
537
+ if ( ! project_properties.readXml ( propertiesElem ) )
546
538
{
547
539
QgsDebugMsg ( " Project_properties.readXml() failed" );
548
540
}
You can’t perform that action at this time.
0 commit comments