Skip to content

Commit

Permalink
unset deprecated of setIdentifierValuesToNull and setExtraIdentifierV…
Browse files Browse the repository at this point in the history
…aluesToNull because they at least help to set the list to null
  • Loading branch information
signedav committed Jan 14, 2020
1 parent c7af6f0 commit f3d14f9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 18 deletions.
5 changes: 1 addition & 4 deletions python/core/auto_generated/qgsfeaturefiltermodel.sip.in
Expand Up @@ -174,15 +174,12 @@ still be available in the model.
.. versionadded:: 3.10
%End

void setExtraIdentifierValuesToNull() /Deprecated/;
void setExtraIdentifierValuesToNull();
%Docstring
Allows specifying one value that does not need to match the filter criteria but will
still be available in the model as NULL value(s).

.. versionadded:: 3.10

.. deprecated:: QGIS 3.12
use setExtraIdentifierValues( QVariantList() ) instead
%End

int extraIdentifierValueIndex() const;
Expand Down
5 changes: 1 addition & 4 deletions python/gui/auto_generated/qgsfeaturelistcombobox.sip.in
Expand Up @@ -116,14 +116,11 @@ identifierFields.
.. versionadded:: 3.10
%End

void setIdentifierValuesToNull() /Deprecated/;
void setIdentifierValuesToNull();
%Docstring
Sets the identifier values of the currently selected feature to NULL value(s).

.. versionadded:: 3.10

.. deprecated:: QGIS 3.12
use setIdentifierValues( QVariantList() ) instead
%End

QgsFeatureRequest currentFeatureRequest() const;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsfeaturefiltermodel.cpp
Expand Up @@ -581,7 +581,7 @@ void QgsFeatureFilterModel::setIdentifierFields( const QStringList &identifierFi

mIdentifierFields = identifierFields;
emit identifierFieldChanged();
setExtraIdentifierValues( QVariantList() );
setExtraIdentifierValuesToNull();
}

void QgsFeatureFilterModel::reload()
Expand Down Expand Up @@ -612,7 +612,7 @@ QVariantList QgsFeatureFilterModel::extraIdentifierValues() const
void QgsFeatureFilterModel::setExtraIdentifierValue( const QVariant &extraIdentifierValue )
{
if ( extraIdentifierValue.isNull() )
setExtraIdentifierValues( QVariantList() );
setExtraIdentifierValuesToNull();
else
setExtraIdentifierValues( QVariantList() << extraIdentifierValue );
}
Expand Down
3 changes: 1 addition & 2 deletions src/core/qgsfeaturefiltermodel.h
Expand Up @@ -196,9 +196,8 @@ class CORE_EXPORT QgsFeatureFilterModel : public QAbstractItemModel
* Allows specifying one value that does not need to match the filter criteria but will
* still be available in the model as NULL value(s).
* \since QGIS 3.10
* \deprecated since QGIS 3.12 use setExtraIdentifierValues( QVariantList() ) instead
*/
Q_DECL_DEPRECATED void setExtraIdentifierValuesToNull() SIP_DEPRECATED;
void setExtraIdentifierValuesToNull();

/**
* The index at which the extra identifier value is available within the model.
Expand Down
4 changes: 2 additions & 2 deletions src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Expand Up @@ -391,7 +391,7 @@ void QgsRelationReferenceWidget::deleteForeignKeys()
}
else
{
mComboBox->setIdentifierValues( QVariantList() );
mComboBox->setIdentifierValuesToNull();
}
mRemoveFKButton->setEnabled( false );
updateAttributeEditorFrame( QgsFeature() );
Expand Down Expand Up @@ -426,7 +426,7 @@ void QgsRelationReferenceWidget::showIndeterminateState()
}
else
{
whileBlocking( mComboBox )->setIdentifierValues( QVariantList() );
whileBlocking( mComboBox )->setIdentifierValuesToNull();
}
mRemoveFKButton->setEnabled( false );
updateAttributeEditorFrame( QgsFeature() );
Expand Down
3 changes: 1 addition & 2 deletions src/gui/qgsfeaturelistcombobox.h
Expand Up @@ -137,9 +137,8 @@ class GUI_EXPORT QgsFeatureListComboBox : public QComboBox
/**
* Sets the identifier values of the currently selected feature to NULL value(s).
* \since QGIS 3.10
* \deprecated since QGIS 3.12 use setIdentifierValues( QVariantList() ) instead
*/
Q_DECL_DEPRECATED void setIdentifierValuesToNull() SIP_DEPRECATED;
void setIdentifierValuesToNull();

/**
* Shorthand for getting a feature request to query the currently selected
Expand Down
4 changes: 2 additions & 2 deletions tests/src/gui/testqgsfeaturelistcombobox.cpp
Expand Up @@ -156,7 +156,7 @@ void TestQgsFeatureListComboBox::testMultipleForeignKeys()
cb->setIdentifierValues( QVariantList() << "gold" << 777 << "rush" );
QCOMPARE( cb->identifierValues(), QVariantList() << "gold" << 777 << "rush" );

cb->setIdentifierValues( QVariantList() );
cb->setIdentifierValuesToNull();
QCOMPARE( cb->identifierValues().count(), 3 );
QCOMPARE( cb->identifierValues(), QVariantList() << QVariant() << QVariant() << QVariant() );

Expand All @@ -175,7 +175,7 @@ void TestQgsFeatureListComboBox::testMultipleForeignKeys()
QCOMPARE( cb->identifierValues().count(), 2 );
QCOMPARE( cb->identifierValues(), QVariantList() << "gold" << "fish" );

cb->setIdentifierValues( QVariantList() );
cb->setIdentifierValuesToNull();
QCOMPARE( cb->identifierValues().count(), 2 );
QCOMPARE( cb->identifierValues(), QVariantList() << QVariant() << QVariant() );
}
Expand Down

0 comments on commit f3d14f9

Please sign in to comment.