Rename methods

This commit is contained in:
Blottiere Paul 2017-09-05 07:44:59 +01:00
parent 76b2b8eed3
commit 456ca000a7
4 changed files with 13 additions and 13 deletions

@ -785,7 +785,7 @@ Returns the number of registered layers.
:rtype: QgsCoordinateReferenceSystem :rtype: QgsCoordinateReferenceSystem
%End %End
void setTrust( bool trust ); void setTrustLayerMetadata( bool trust );
%Docstring %Docstring
Sets the trust option allowing to indicate if the extent has to be 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 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 .. versionadded:: 3.0
%End %End
bool trust() const; bool trustLayerMetadata() const;
%Docstring %Docstring
Returns true if the trust option is activated, false otherwise. This Returns true if the trust option is activated, false otherwise. This
option allows indicateing if the extent has to be read from the XML option allows indicateing if the extent has to be read from the XML

@ -708,7 +708,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa
mAutoTransaction->setChecked( QgsProject::instance()->autoTransaction() ); mAutoTransaction->setChecked( QgsProject::instance()->autoTransaction() );
mEvaluateDefaultValues->setChecked( QgsProject::instance()->evaluateDefaultValues() ); mEvaluateDefaultValues->setChecked( QgsProject::instance()->evaluateDefaultValues() );
mTrustProjectCheckBox->setChecked( QgsProject::instance()->trust() ); mTrustProjectCheckBox->setChecked( QgsProject::instance()->trustLayerMetadata() );
// Variables editor // Variables editor
mVariableEditor->context()->appendScope( QgsExpressionContextUtils::globalScope() ); mVariableEditor->context()->appendScope( QgsExpressionContextUtils::globalScope() );
@ -765,7 +765,7 @@ void QgsProjectProperties::apply()
QgsProject::instance()->setTitle( title() ); QgsProject::instance()->setTitle( title() );
QgsProject::instance()->setAutoTransaction( mAutoTransaction->isChecked() ); QgsProject::instance()->setAutoTransaction( mAutoTransaction->isChecked() );
QgsProject::instance()->setEvaluateDefaultValues( mEvaluateDefaultValues->isChecked() ); QgsProject::instance()->setEvaluateDefaultValues( mEvaluateDefaultValues->isChecked() );
QgsProject::instance()->setTrust( mTrustProjectCheckBox->isChecked() ); QgsProject::instance()->setTrustLayerMetadata( mTrustProjectCheckBox->isChecked() );
// set the mouse display precision method and the // set the mouse display precision method and the
// number of decimal places for the manual option // number of decimal places for the manual option

@ -480,7 +480,7 @@ void QgsProject::clear()
mAutoTransaction = false; mAutoTransaction = false;
mEvaluateDefaultValues = false; mEvaluateDefaultValues = false;
mDirty = false; mDirty = false;
mTrust = false; mTrustLayerMetadata = false;
mCustomVariables.clear(); mCustomVariables.clear();
mEmbeddedLayers.clear(); mEmbeddedLayers.clear();
@ -722,7 +722,7 @@ bool QgsProject::addLayer( const QDomElement &layerElem, QList<QDomNode> &broken
// apply specific settings to vector layer // apply specific settings to vector layer
if ( QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( mapLayer ) ) if ( QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( mapLayer ) )
{ {
vl->setReadExtentFromXml( mTrust ); vl->setReadExtentFromXml( mTrustLayerMetadata );
} }
} }
else if ( type == QLatin1String( "raster" ) ) else if ( type == QLatin1String( "raster" ) )
@ -904,7 +904,7 @@ bool QgsProject::readProjectFile( const QString &filename )
{ {
QDomElement trustElement = nl.at( 0 ).toElement(); QDomElement trustElement = nl.at( 0 ).toElement();
if ( trustElement.attribute( QStringLiteral( "active" ), QStringLiteral( "0" ) ).toInt() == 1 ) if ( trustElement.attribute( QStringLiteral( "active" ), QStringLiteral( "0" ) ).toInt() == 1 )
mTrust = true; mTrustLayerMetadata = true;
} }
// read the layer tree from project file // read the layer tree from project file
@ -1312,7 +1312,7 @@ bool QgsProject::writeProjectFile( const QString &filename )
qgisNode.appendChild( evaluateDefaultValuesNode ); qgisNode.appendChild( evaluateDefaultValuesNode );
QDomElement trustNode = doc->createElement( QStringLiteral( "trust" ) ); QDomElement trustNode = doc->createElement( QStringLiteral( "trust" ) );
trustNode.setAttribute( QStringLiteral( "active" ), mTrust ? "1" : "0" ); trustNode.setAttribute( QStringLiteral( "active" ), mTrustLayerMetadata ? "1" : "0" );
qgisNode.appendChild( trustNode ); qgisNode.appendChild( trustNode );
QDomText titleText = doc->createTextNode( title() ); // XXX why have title TWICE? QDomText titleText = doc->createTextNode( title() ); // XXX why have title TWICE?
@ -2280,9 +2280,9 @@ QgsCoordinateReferenceSystem QgsProject::defaultCrsForNewLayers() const
return defaultCrs; return defaultCrs;
} }
void QgsProject::setTrust( bool trust ) void QgsProject::setTrustLayerMetadata( bool trust )
{ {
mTrust = trust; mTrustLayerMetadata = trust;
Q_FOREACH ( QgsMapLayer *layer, mapLayers().values() ) Q_FOREACH ( QgsMapLayer *layer, mapLayers().values() )
{ {

@ -766,7 +766,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
* *
* \since QGIS 3.0 * \since QGIS 3.0
*/ */
void setTrust( bool trust ); void setTrustLayerMetadata( bool trust );
/** /**
* Returns true if the trust option is activated, false otherwise. This * 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 * \since QGIS 3.0
*/ */
bool trust() const { return mTrust; } bool trustLayerMetadata() const { return mTrustLayerMetadata; }
signals: signals:
//! emitted when project is being read //! emitted when project is being read
@ -1107,7 +1107,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
bool mEvaluateDefaultValues; // evaluate default values immediately bool mEvaluateDefaultValues; // evaluate default values immediately
QgsCoordinateReferenceSystem mCrs; QgsCoordinateReferenceSystem mCrs;
bool mDirty; // project has been modified since it has been read or saved 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 /** Return the version string found in the given DOM document