Skip to content

Commit

Permalink
Rename setDeleteCascade/isDeleteCascade in setCascadedDelete/hasCasca…
Browse files Browse the repository at this point in the history
…dedDelete
  • Loading branch information
pblottiere committed Aug 28, 2017
1 parent 97ad226 commit 8b70d7f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions python/core/qgsvectorlayerjoininfo.sip
Expand Up @@ -132,15 +132,15 @@ Returns whether values from the joined layer should be cached in memory to speed
.. versionadded:: 3.0
%End

bool isDeleteCascade() const;
bool hasCascadedDelete() const;
%Docstring
Returns whether a feature deleted on the target layer has to impact the
joined layer by deleting the corresponding joined feature.
.. versionadded:: 3.0
:rtype: bool
%End

void setDeleteCascade( bool enabled );
void setCascadedDelete( bool enabled );
%Docstring
Sets whether a feature deleted on the target layer has to impact the
joined layer by deleting the corresponding joined feature.
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsjoindialog.cpp
Expand Up @@ -78,7 +78,7 @@ void QgsJoinDialog::setJoinInfo( const QgsVectorLayerJoinInfo &joinInfo )
mDynamicFormCheckBox->setChecked( joinInfo.isDynamicFormEnabled() );
mEditableJoinLayer->setChecked( joinInfo.isEditable() );
mUpsertOnEditCheckBox->setChecked( joinInfo.hasUpsertOnEdit() );
mDeleteCascadeCheckBox->setChecked( joinInfo.isDeleteCascade() );
mDeleteCascadeCheckBox->setChecked( joinInfo.hasCascadedDelete() );

if ( joinInfo.prefix().isNull() )
{
Expand Down Expand Up @@ -123,7 +123,7 @@ QgsVectorLayerJoinInfo QgsJoinDialog::joinInfo() const
if ( info.isEditable() )
{
info.setUpsertOnEdit( mUpsertOnEditCheckBox->isChecked() );
info.setDeleteCascade( mDeleteCascadeCheckBox->isChecked() );
info.setCascadedDelete( mDeleteCascadeCheckBox->isChecked() );
}

if ( mUseCustomPrefix->isChecked() )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -1251,7 +1251,7 @@ void QgsVectorLayerProperties::addJoinToTreeWidget( const QgsVectorLayerJoinInfo
joinItem->setText( 6, QChar( 0x2714 ) );
}

if ( join.isDeleteCascade() )
if ( join.hasCascadedDelete() )
{
joinItem->setText( 7, QChar( 0x2714 ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -2481,7 +2481,7 @@ bool QgsVectorLayer::deleteFeaturesFromJoinedLayers( QgsFeatureIds fids )
{
Q_FOREACH ( const QgsVectorLayerJoinInfo &info, vectorJoins() )
{
if ( info.isEditable() && info.isDeleteCascade() )
if ( info.isEditable() && info.hasCascadedDelete() )
{
QgsFeature joinFeature = mJoinBuffer->joinedFeatureOf( &info, getFeature( fid ) );
if ( joinFeature.isValid() )
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayerjoinbuffer.cpp
Expand Up @@ -278,7 +278,7 @@ void QgsVectorLayerJoinBuffer::writeXml( QDomNode &layer_node, QDomDocument &doc
joinElem.setAttribute( QStringLiteral( "dynamicForm" ), joinIt->isDynamicFormEnabled() );
joinElem.setAttribute( QStringLiteral( "editable" ), joinIt->isEditable() );
joinElem.setAttribute( QStringLiteral( "upsertOnEdit" ), joinIt->hasUpsertOnEdit() );
joinElem.setAttribute( QStringLiteral( "deleteCascade" ), joinIt->isDeleteCascade() );
joinElem.setAttribute( QStringLiteral( "cascadedDelete" ), joinIt->hasCascadedDelete() );

if ( joinIt->joinFieldNamesSubset() )
{
Expand Down Expand Up @@ -322,7 +322,7 @@ void QgsVectorLayerJoinBuffer::readXml( const QDomNode &layer_node )
info.setDynamicFormEnabled( infoElem.attribute( QStringLiteral( "dynamicForm" ) ).toInt() );
info.setEditable( infoElem.attribute( QStringLiteral( "editable" ) ).toInt() );
info.setUpsertOnEdit( infoElem.attribute( QStringLiteral( "upsertOnEdit" ) ).toInt() );
info.setDeleteCascade( infoElem.attribute( QStringLiteral( "deleteCascade" ) ).toInt() );
info.setCascadedDelete( infoElem.attribute( QStringLiteral( "cascadedDelete" ) ).toInt() );

QDomElement subsetElem = infoElem.firstChildElement( QStringLiteral( "joinFieldsSubset" ) );
if ( !subsetElem.isNull() )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayerjoininfo.cpp
Expand Up @@ -40,7 +40,7 @@ void QgsVectorLayerJoinInfo::setEditable( bool enabled )

if ( ! mEditable )
{
setDeleteCascade( false );
setCascadedDelete( false );
setUpsertOnEdit( false );
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsvectorlayerjoininfo.h
Expand Up @@ -108,13 +108,13 @@ class CORE_EXPORT QgsVectorLayerJoinInfo
* joined layer by deleting the corresponding joined feature.
* \since QGIS 3.0
*/
bool isDeleteCascade() const { return mDeleteCascade; }
bool hasCascadedDelete() const { return mCascadedDelete; }

/** Sets whether a feature deleted on the target layer has to impact the
* joined layer by deleting the corresponding joined feature.
* \since QGIS 3.0
*/
void setDeleteCascade( bool enabled ) { mDeleteCascade = enabled; }
void setCascadedDelete( bool enabled ) { mCascadedDelete = enabled; }

/** Returns the prefixed name of the field.
* \param field the field
Expand Down Expand Up @@ -182,7 +182,7 @@ class CORE_EXPORT QgsVectorLayerJoinInfo

bool mUpsertOnEdit;

bool mDeleteCascade;
bool mCascadedDelete;

//! Cache for joined attributes to provide fast lookup (size is 0 if no memory caching)
QHash< QString, QgsAttributes> cachedAttributes;
Expand Down

0 comments on commit 8b70d7f

Please sign in to comment.