Skip to content
Permalink
Browse files

Rename setDeleteCascade/isDeleteCascade in setCascadedDelete/hasCasca…

…dedDelete
  • Loading branch information
pblottiere committed Aug 28, 2017
1 parent 97ad226 commit 8b70d7fa4b29decf5dd0c22f136c7e8248b894f3
@@ -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.
@@ -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() )
{
@@ -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() )
@@ -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 ) );
}
@@ -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() )
@@ -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() )
{
@@ -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() )
@@ -40,7 +40,7 @@ void QgsVectorLayerJoinInfo::setEditable( bool enabled )

if ( ! mEditable )
{
setDeleteCascade( false );
setCascadedDelete( false );
setUpsertOnEdit( false );
}
}
@@ -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
@@ -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;

0 comments on commit 8b70d7f

Please sign in to comment.
You can’t perform that action at this time.