Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 22, 2018
1 parent 635f8ad commit feea121
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/core/qgsproject.cpp
Expand Up @@ -612,7 +612,7 @@ void QgsProject::clear()
// basically a debugging tool to dump property list values
void dump_( const QgsProjectPropertyKey &topQgsPropertyKey )
{
QgsDebugMsg( "current properties:" );
QgsDebugMsg( QStringLiteral( "current properties:" ) );
topQgsPropertyKey.dump();
}

Expand Down Expand Up @@ -660,13 +660,13 @@ void _getProperties( const QDomDocument &doc, QgsProjectPropertyKey &project_pro

if ( scopes.count() < 1 )
{
QgsDebugMsg( "empty ``properties'' XML tag ... bailing" );
QgsDebugMsg( QStringLiteral( "empty ``properties'' XML tag ... bailing" ) );
return;
}

if ( ! project_properties.readXml( propertiesElem ) )
{
QgsDebugMsg( "Project_properties.readXml() failed" );
QgsDebugMsg( QStringLiteral( "Project_properties.readXml() failed" ) );
}
}

Expand All @@ -683,23 +683,23 @@ static void _getTitle( const QDomDocument &doc, QString &title )

if ( !nl.count() )
{
QgsDebugMsg( "unable to find title element" );
QgsDebugMsg( QStringLiteral( "unable to find title element" ) );
return;
}

QDomNode titleNode = nl.item( 0 ); // there should only be one, so zeroth element OK

if ( !titleNode.hasChildNodes() ) // if not, then there's no actual text
{
QgsDebugMsg( "unable to find title element" );
QgsDebugMsg( QStringLiteral( "unable to find title element" ) );
return;
}

QDomNode titleTextNode = titleNode.firstChild(); // should only have one child

if ( !titleTextNode.isText() )
{
QgsDebugMsg( "unable to find title element" );
QgsDebugMsg( QStringLiteral( "unable to find title element" ) );
return;
}

Expand All @@ -715,7 +715,7 @@ QgsProjectVersion getVersion( const QDomDocument &doc )

if ( !nl.count() )
{
QgsDebugMsg( " unable to find qgis element in project file" );
QgsDebugMsg( QStringLiteral( " unable to find qgis element in project file" ) );
return QgsProjectVersion( 0, 0, 0, QString() );
}

Expand Down Expand Up @@ -839,7 +839,7 @@ bool QgsProject::addLayer( const QDomElement &layerElem, QList<QDomNode> &broken

if ( !mapLayer )
{
QgsDebugMsg( "Unable to create layer" );
QgsDebugMsg( QStringLiteral( "Unable to create layer" ) );

return false;
}
Expand Down Expand Up @@ -976,7 +976,7 @@ bool QgsProject::readProjectFile( const QString &filename )

// Shows a warning when an old project file is read.
emit oldProjectVersionWarning( fileVersion.text() );
QgsDebugMsg( "Emitting oldProjectVersionWarning(oldVersion)." );
QgsDebugMsg( QStringLiteral( "Emitting oldProjectVersionWarning(oldVersion)." ) );

projectFile.updateRevision( thisVersion );
}
Expand Down Expand Up @@ -1124,7 +1124,7 @@ bool QgsProject::readProjectFile( const QString &filename )
// review the integrity of the retrieved map layers
if ( !clean )
{
QgsDebugMsg( "Unable to get map layers from project file." );
QgsDebugMsg( QStringLiteral( "Unable to get map layers from project file." ) );

if ( !brokenNodes.isEmpty() )
{
Expand Down Expand Up @@ -1551,15 +1551,15 @@ bool QgsProject::writeProjectFile( const QString &filename )
qgisNode.appendChild( titleNode );

QDomElement transactionNode = doc->createElement( QStringLiteral( "autotransaction" ) );
transactionNode.setAttribute( QStringLiteral( "active" ), mAutoTransaction ? "1" : "0" );
transactionNode.setAttribute( QStringLiteral( "active" ), mAutoTransaction ? '1' : '0' );
qgisNode.appendChild( transactionNode );

QDomElement evaluateDefaultValuesNode = doc->createElement( QStringLiteral( "evaluateDefaultValues" ) );
evaluateDefaultValuesNode.setAttribute( QStringLiteral( "active" ), mEvaluateDefaultValues ? "1" : "0" );
evaluateDefaultValuesNode.setAttribute( QStringLiteral( "active" ), mEvaluateDefaultValues ? '1' : '0' );
qgisNode.appendChild( evaluateDefaultValuesNode );

QDomElement trustNode = doc->createElement( QStringLiteral( "trust" ) );
trustNode.setAttribute( QStringLiteral( "active" ), mTrustLayerMetadata ? "1" : "0" );
trustNode.setAttribute( QStringLiteral( "active" ), mTrustLayerMetadata ? '1' : '0' );
qgisNode.appendChild( trustNode );

QDomText titleText = doc->createTextNode( title() ); // XXX why have title TWICE?
Expand Down Expand Up @@ -1643,7 +1643,7 @@ bool QgsProject::writeProjectFile( const QString &filename )

dump_( mProperties );

QgsDebugMsg( QString( "there are %1 property scopes" ).arg( static_cast<int>( mProperties.count() ) ) );
QgsDebugMsg( QStringLiteral( "there are %1 property scopes" ).arg( static_cast<int>( mProperties.count() ) ) );

if ( !mProperties.isEmpty() ) // only worry about properties if we
// actually have any properties
Expand Down Expand Up @@ -2691,6 +2691,7 @@ QSet<QgsMapLayer *> QgsProject::requiredLayers() const
void QgsProject::setRequiredLayers( const QSet<QgsMapLayer *> &layers )
{
QStringList layerIds;
layerIds.reserve( layers.count() );
for ( QgsMapLayer *layer : layers )
{
layerIds << layer->id();
Expand Down

0 comments on commit feea121

Please sign in to comment.