diff --git a/python/core/qgsproject.sip b/python/core/qgsproject.sip index 441bc8f13e4..d9b03e6db1e 100644 --- a/python/core/qgsproject.sip +++ b/python/core/qgsproject.sip @@ -785,7 +785,7 @@ Returns the number of registered layers. :rtype: QgsCoordinateReferenceSystem %End - void setTrust( bool trust ); + void setTrustLayerMetadata( bool trust ); %Docstring Sets the trust option allowing to indicate if the extent has to be read from the XML document when data source has no metadata or if the @@ -798,7 +798,7 @@ Returns the number of registered layers. .. versionadded:: 3.0 %End - bool trust() const; + bool trustLayerMetadata() const; %Docstring Returns true if the trust option is activated, false otherwise. This option allows indicateing if the extent has to be read from the XML diff --git a/src/app/qgsprojectproperties.cpp b/src/app/qgsprojectproperties.cpp index 3e404a0e21d..2f0a132a2ee 100644 --- a/src/app/qgsprojectproperties.cpp +++ b/src/app/qgsprojectproperties.cpp @@ -708,7 +708,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa mAutoTransaction->setChecked( QgsProject::instance()->autoTransaction() ); mEvaluateDefaultValues->setChecked( QgsProject::instance()->evaluateDefaultValues() ); - mTrustProjectCheckBox->setChecked( QgsProject::instance()->trust() ); + mTrustProjectCheckBox->setChecked( QgsProject::instance()->trustLayerMetadata() ); // Variables editor mVariableEditor->context()->appendScope( QgsExpressionContextUtils::globalScope() ); @@ -765,7 +765,7 @@ void QgsProjectProperties::apply() QgsProject::instance()->setTitle( title() ); QgsProject::instance()->setAutoTransaction( mAutoTransaction->isChecked() ); QgsProject::instance()->setEvaluateDefaultValues( mEvaluateDefaultValues->isChecked() ); - QgsProject::instance()->setTrust( mTrustProjectCheckBox->isChecked() ); + QgsProject::instance()->setTrustLayerMetadata( mTrustProjectCheckBox->isChecked() ); // set the mouse display precision method and the // number of decimal places for the manual option diff --git a/src/core/qgsproject.cpp b/src/core/qgsproject.cpp index f8cb3bcef82..f3ce3e5c775 100644 --- a/src/core/qgsproject.cpp +++ b/src/core/qgsproject.cpp @@ -480,7 +480,7 @@ void QgsProject::clear() mAutoTransaction = false; mEvaluateDefaultValues = false; mDirty = false; - mTrust = false; + mTrustLayerMetadata = false; mCustomVariables.clear(); mEmbeddedLayers.clear(); @@ -722,7 +722,7 @@ bool QgsProject::addLayer( const QDomElement &layerElem, QList &broken // apply specific settings to vector layer if ( QgsVectorLayer *vl = qobject_cast( mapLayer ) ) { - vl->setReadExtentFromXml( mTrust ); + vl->setReadExtentFromXml( mTrustLayerMetadata ); } } else if ( type == QLatin1String( "raster" ) ) @@ -904,7 +904,7 @@ bool QgsProject::readProjectFile( const QString &filename ) { QDomElement trustElement = nl.at( 0 ).toElement(); if ( trustElement.attribute( QStringLiteral( "active" ), QStringLiteral( "0" ) ).toInt() == 1 ) - mTrust = true; + mTrustLayerMetadata = true; } // read the layer tree from project file @@ -1312,7 +1312,7 @@ bool QgsProject::writeProjectFile( const QString &filename ) qgisNode.appendChild( evaluateDefaultValuesNode ); QDomElement trustNode = doc->createElement( QStringLiteral( "trust" ) ); - trustNode.setAttribute( QStringLiteral( "active" ), mTrust ? "1" : "0" ); + trustNode.setAttribute( QStringLiteral( "active" ), mTrustLayerMetadata ? "1" : "0" ); qgisNode.appendChild( trustNode ); QDomText titleText = doc->createTextNode( title() ); // XXX why have title TWICE? @@ -2280,9 +2280,9 @@ QgsCoordinateReferenceSystem QgsProject::defaultCrsForNewLayers() const return defaultCrs; } -void QgsProject::setTrust( bool trust ) +void QgsProject::setTrustLayerMetadata( bool trust ) { - mTrust = trust; + mTrustLayerMetadata = trust; Q_FOREACH ( QgsMapLayer *layer, mapLayers().values() ) { diff --git a/src/core/qgsproject.h b/src/core/qgsproject.h index bebe9f18345..ec517555640 100644 --- a/src/core/qgsproject.h +++ b/src/core/qgsproject.h @@ -766,7 +766,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera * * \since QGIS 3.0 */ - void setTrust( bool trust ); + void setTrustLayerMetadata( bool trust ); /** * Returns true if the trust option is activated, false otherwise. This @@ -778,7 +778,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera * * \since QGIS 3.0 */ - bool trust() const { return mTrust; } + bool trustLayerMetadata() const { return mTrustLayerMetadata; } signals: //! emitted when project is being read @@ -1107,7 +1107,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera bool mEvaluateDefaultValues; // evaluate default values immediately QgsCoordinateReferenceSystem mCrs; bool mDirty; // project has been modified since it has been read or saved - bool mTrust = false; + bool mTrustLayerMetadata = false; }; /** Return the version string found in the given DOM document