Skip to content

Commit 5ed02a7

Browse files
committedOct 1, 2018
Use qgsVariantEqual in some places
1 parent b48a429 commit 5ed02a7

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed
 

‎src/core/qgis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ bool qgsVariantLessThan( const QVariant &lhs, const QVariant &rhs )
189189
const QList<QVariant> &rhsl = rhs.toList();
190190

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

195195
if ( i == n )

‎src/core/qgsfeaturefiltermodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ QVariant QgsFeatureFilterModel::extraIdentifierValue() const
533533

534534
void QgsFeatureFilterModel::setExtraIdentifierValue( const QVariant &extraIdentifierValue )
535535
{
536-
if ( extraIdentifierValue == mExtraIdentifierValue && extraIdentifierValue.isNull() == mExtraIdentifierValue.isNull() && mExtraIdentifierValue.isValid() )
536+
if ( qgsVariantEqual( extraIdentifierValue, mExtraIdentifierValue ) && mExtraIdentifierValue.isValid() )
537537
return;
538538

539539
if ( mIsSettingExtraIdentifierValue )

‎src/gui/qgsattributeform.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,9 @@ bool QgsAttributeForm::saveEdits()
357357
int n = 0;
358358
for ( int i = 0; i < dst.count(); ++i )
359359
{
360-
if ( ( dst.at( i ) == src.at( i ) && dst.at( i ).isNull() == src.at( i ).isNull() ) // If field is not changed...
361-
|| !dst.at( i ).isValid() // or the widget returns invalid (== do not change)
362-
|| !fieldIsEditable( i ) ) // or the field cannot be edited ...
360+
if ( qgsVariantEqual( dst.at( i ), src.at( i ) ) // If field is not changed...
361+
|| !dst.at( i ).isValid() // or the widget returns invalid (== do not change)
362+
|| !fieldIsEditable( i ) ) // or the field cannot be edited ...
363363
{
364364
continue;
365365
}

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2118,7 +2118,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist, Flags flags )
21182118

21192119
if ( i == flist.size() )
21202120
{
2121-
if ( v == defVal && defVal.isNull() == v.isNull() )
2121+
if ( qgsVariantEqual( v, defVal ) )
21222122
{
21232123
if ( defVal.isNull() )
21242124
{

0 commit comments

Comments
 (0)
Please sign in to comment.