Skip to content

Commit

Permalink
Rename methods
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Sep 6, 2017
1 parent 76b2b8e commit 456ca00
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions python/core/qgsproject.sip
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsprojectproperties.cpp
Expand Up @@ -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() );
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgsproject.cpp
Expand Up @@ -480,7 +480,7 @@ void QgsProject::clear()
mAutoTransaction = false;
mEvaluateDefaultValues = false;
mDirty = false;
mTrust = false;
mTrustLayerMetadata = false;
mCustomVariables.clear();

mEmbeddedLayers.clear();
Expand Down Expand Up @@ -722,7 +722,7 @@ bool QgsProject::addLayer( const QDomElement &layerElem, QList<QDomNode> &broken
// apply specific settings to vector layer
if ( QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( mapLayer ) )
{
vl->setReadExtentFromXml( mTrust );
vl->setReadExtentFromXml( mTrustLayerMetadata );
}
}
else if ( type == QLatin1String( "raster" ) )
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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() )
{
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsproject.h
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 456ca00

Please sign in to comment.