Skip to content
Permalink
Browse files

Use qgsVariantEqual in some places

  • Loading branch information
elpaso committed Oct 1, 2018
1 parent b48a429 commit 5ed02a7ae9080d6d17d02dca3e4891db485aa4eb
@@ -189,7 +189,7 @@ bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs )
const QList<QVariant> &rhsl = rhs.toList();

int i, n = std::min( lhsl.size(), rhsl.size() );
for ( i = 0; i < n && lhsl[i].type() == rhsl[i].type() && lhsl[i].isNull() == rhsl[i].isNull() && lhsl[i] == rhsl[i]; i++ )
for ( i = 0; i < n && lhsl[i].type() == rhsl[i].type() && qgsVariantEqual( lhsl[i], rhsl[i] ); i++ )
;

if ( i == n )
@@ -533,7 +533,7 @@ QVariant QgsFeatureFilterModel::extraIdentifierValue() const

void QgsFeatureFilterModel::setExtraIdentifierValue( const QVariant &extraIdentifierValue )
{
if ( extraIdentifierValue == mExtraIdentifierValue && extraIdentifierValue.isNull() == mExtraIdentifierValue.isNull() && mExtraIdentifierValue.isValid() )
if ( qgsVariantEqual( extraIdentifierValue, mExtraIdentifierValue ) && mExtraIdentifierValue.isValid() )
return;

if ( mIsSettingExtraIdentifierValue )
@@ -357,9 +357,9 @@ bool QgsAttributeForm::saveEdits()
int n = 0;
for ( int i = 0; i < dst.count(); ++i )
{
if ( ( dst.at( i ) == src.at( i ) && dst.at( i ).isNull() == src.at( i ).isNull() ) // If field is not changed...
|| !dst.at( i ).isValid() // or the widget returns invalid (== do not change)
|| !fieldIsEditable( i ) ) // or the field cannot be edited ...
if ( qgsVariantEqual( dst.at( i ), src.at( i ) ) // If field is not changed...
|| !dst.at( i ).isValid() // or the widget returns invalid (== do not change)
|| !fieldIsEditable( i ) ) // or the field cannot be edited ...
{
continue;
}
@@ -2118,7 +2118,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist, Flags flags )

if ( i == flist.size() )
{
if ( v == defVal && defVal.isNull() == v.isNull() )
if ( qgsVariantEqual( v, defVal ) )
{
if ( defVal.isNull() )
{

0 comments on commit 5ed02a7

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