@@ -612,7 +612,7 @@ void QgsProject::clear()
612
612
// basically a debugging tool to dump property list values
613
613
void dump_ ( const QgsProjectPropertyKey &topQgsPropertyKey )
614
614
{
615
- QgsDebugMsg ( " current properties:" );
615
+ QgsDebugMsg ( QStringLiteral ( " current properties:" ) );
616
616
topQgsPropertyKey.dump ();
617
617
}
618
618
@@ -660,13 +660,13 @@ void _getProperties( const QDomDocument &doc, QgsProjectPropertyKey &project_pro
660
660
661
661
if ( scopes.count () < 1 )
662
662
{
663
- QgsDebugMsg ( " empty ``properties'' XML tag ... bailing" );
663
+ QgsDebugMsg ( QStringLiteral ( " empty ``properties'' XML tag ... bailing" ) );
664
664
return ;
665
665
}
666
666
667
667
if ( ! project_properties.readXml ( propertiesElem ) )
668
668
{
669
- QgsDebugMsg ( " Project_properties.readXml() failed" );
669
+ QgsDebugMsg ( QStringLiteral ( " Project_properties.readXml() failed" ) );
670
670
}
671
671
}
672
672
@@ -683,23 +683,23 @@ static void _getTitle( const QDomDocument &doc, QString &title )
683
683
684
684
if ( !nl.count () )
685
685
{
686
- QgsDebugMsg ( " unable to find title element" );
686
+ QgsDebugMsg ( QStringLiteral ( " unable to find title element" ) );
687
687
return ;
688
688
}
689
689
690
690
QDomNode titleNode = nl.item ( 0 ); // there should only be one, so zeroth element OK
691
691
692
692
if ( !titleNode.hasChildNodes () ) // if not, then there's no actual text
693
693
{
694
- QgsDebugMsg ( " unable to find title element" );
694
+ QgsDebugMsg ( QStringLiteral ( " unable to find title element" ) );
695
695
return ;
696
696
}
697
697
698
698
QDomNode titleTextNode = titleNode.firstChild (); // should only have one child
699
699
700
700
if ( !titleTextNode.isText () )
701
701
{
702
- QgsDebugMsg ( " unable to find title element" );
702
+ QgsDebugMsg ( QStringLiteral ( " unable to find title element" ) );
703
703
return ;
704
704
}
705
705
@@ -715,7 +715,7 @@ QgsProjectVersion getVersion( const QDomDocument &doc )
715
715
716
716
if ( !nl.count () )
717
717
{
718
- QgsDebugMsg ( " unable to find qgis element in project file" );
718
+ QgsDebugMsg ( QStringLiteral ( " unable to find qgis element in project file" ) );
719
719
return QgsProjectVersion ( 0 , 0 , 0 , QString () );
720
720
}
721
721
@@ -839,7 +839,7 @@ bool QgsProject::addLayer( const QDomElement &layerElem, QList<QDomNode> &broken
839
839
840
840
if ( !mapLayer )
841
841
{
842
- QgsDebugMsg ( " Unable to create layer" );
842
+ QgsDebugMsg ( QStringLiteral ( " Unable to create layer" ) );
843
843
844
844
return false ;
845
845
}
@@ -976,7 +976,7 @@ bool QgsProject::readProjectFile( const QString &filename )
976
976
977
977
// Shows a warning when an old project file is read.
978
978
emit oldProjectVersionWarning ( fileVersion.text () );
979
- QgsDebugMsg ( " Emitting oldProjectVersionWarning(oldVersion)." );
979
+ QgsDebugMsg ( QStringLiteral ( " Emitting oldProjectVersionWarning(oldVersion)." ) );
980
980
981
981
projectFile.updateRevision ( thisVersion );
982
982
}
@@ -1124,7 +1124,7 @@ bool QgsProject::readProjectFile( const QString &filename )
1124
1124
// review the integrity of the retrieved map layers
1125
1125
if ( !clean )
1126
1126
{
1127
- QgsDebugMsg ( " Unable to get map layers from project file." );
1127
+ QgsDebugMsg ( QStringLiteral ( " Unable to get map layers from project file." ) );
1128
1128
1129
1129
if ( !brokenNodes.isEmpty () )
1130
1130
{
@@ -1551,15 +1551,15 @@ bool QgsProject::writeProjectFile( const QString &filename )
1551
1551
qgisNode.appendChild ( titleNode );
1552
1552
1553
1553
QDomElement transactionNode = doc->createElement ( QStringLiteral ( " autotransaction" ) );
1554
- transactionNode.setAttribute ( QStringLiteral ( " active" ), mAutoTransaction ? " 1 " : " 0 " );
1554
+ transactionNode.setAttribute ( QStringLiteral ( " active" ), mAutoTransaction ? ' 1 ' : ' 0 ' );
1555
1555
qgisNode.appendChild ( transactionNode );
1556
1556
1557
1557
QDomElement evaluateDefaultValuesNode = doc->createElement ( QStringLiteral ( " evaluateDefaultValues" ) );
1558
- evaluateDefaultValuesNode.setAttribute ( QStringLiteral ( " active" ), mEvaluateDefaultValues ? " 1 " : " 0 " );
1558
+ evaluateDefaultValuesNode.setAttribute ( QStringLiteral ( " active" ), mEvaluateDefaultValues ? ' 1 ' : ' 0 ' );
1559
1559
qgisNode.appendChild ( evaluateDefaultValuesNode );
1560
1560
1561
1561
QDomElement trustNode = doc->createElement ( QStringLiteral ( " trust" ) );
1562
- trustNode.setAttribute ( QStringLiteral ( " active" ), mTrustLayerMetadata ? " 1 " : " 0 " );
1562
+ trustNode.setAttribute ( QStringLiteral ( " active" ), mTrustLayerMetadata ? ' 1 ' : ' 0 ' );
1563
1563
qgisNode.appendChild ( trustNode );
1564
1564
1565
1565
QDomText titleText = doc->createTextNode ( title () ); // XXX why have title TWICE?
@@ -1643,7 +1643,7 @@ bool QgsProject::writeProjectFile( const QString &filename )
1643
1643
1644
1644
dump_ ( mProperties );
1645
1645
1646
- QgsDebugMsg ( QString ( " there are %1 property scopes" ).arg ( static_cast <int >( mProperties .count () ) ) );
1646
+ QgsDebugMsg ( QStringLiteral ( " there are %1 property scopes" ).arg ( static_cast <int >( mProperties .count () ) ) );
1647
1647
1648
1648
if ( !mProperties .isEmpty () ) // only worry about properties if we
1649
1649
// actually have any properties
@@ -2691,6 +2691,7 @@ QSet<QgsMapLayer *> QgsProject::requiredLayers() const
2691
2691
void QgsProject::setRequiredLayers ( const QSet<QgsMapLayer *> &layers )
2692
2692
{
2693
2693
QStringList layerIds;
2694
+ layerIds.reserve ( layers.count () );
2694
2695
for ( QgsMapLayer *layer : layers )
2695
2696
{
2696
2697
layerIds << layer->id ();
0 commit comments