Skip to content

Commit

Permalink
Fix 'redundantCondition' cppcheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and nyalldawson committed Jun 15, 2020
1 parent 21bc22f commit 6480810
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/app/labeling/qgsmaptoollabel.cpp
Expand Up @@ -808,7 +808,7 @@ bool QgsMapToolLabel::createAuxiliaryFields( LabelDetails &details, QgsPalIndexe
{
index = vlayer->fields().lookupField( prop.field() );
}
else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty || ( prop.propertyType() == QgsProperty::ExpressionBasedProperty && overwriteExpression ) )
else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty || overwriteExpression )
{
index = QgsAuxiliaryLayer::createProperty( p, vlayer );
changed = true;
Expand Down Expand Up @@ -860,7 +860,7 @@ bool QgsMapToolLabel::createAuxiliaryFields( LabelDetails &details, QgsDiagramIn
{
index = vlayer->fields().lookupField( prop.field() );
}
else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty || ( prop.propertyType() == QgsProperty::ExpressionBasedProperty && overwriteExpression ) )
else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty || overwriteExpression )
{
index = QgsAuxiliaryLayer::createProperty( p, vlayer );
changed = true;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributetabledialog.cpp
Expand Up @@ -79,7 +79,7 @@ void QgsAttributeTableDialog::updateMultiEditButtonState()

mActionToggleMultiEdit->setEnabled( mLayer->isEditable() );

if ( !mLayer->isEditable() || ( mLayer->isEditable() && mMainView->view() != QgsDualView::AttributeEditor ) )
if ( !mLayer->isEditable() || mMainView->view() != QgsDualView::AttributeEditor )
{
mActionToggleMultiEdit->setChecked( false );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -787,7 +787,7 @@ QgsVectorLayerFeatureCounter *QgsVectorLayer::countSymbolFeatures( bool storeSym
return mFeatureCounter;
}

if ( !mFeatureCounter || ( mFeatureCounter && ( storeSymbolFids && mSymbolFeatureIdMap.isEmpty() ) ) )
if ( !mFeatureCounter || ( storeSymbolFids && mSymbolFeatureIdMap.isEmpty() ) )
{
mFeatureCounter = new QgsVectorLayerFeatureCounter( this, QgsExpressionContext(), storeSymbolFids );
connect( mFeatureCounter, &QgsTask::taskCompleted, this, &QgsVectorLayer::onFeatureCounterCompleted, Qt::UniqueConnection );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qtermwidget/TerminalDisplay.cpp
Expand Up @@ -1825,7 +1825,7 @@ void TerminalDisplay::mousePressEvent( QMouseEvent *ev )
}
else if ( ev->button() == Qt::MidButton )
{
if ( _mouseMarks || ( !_mouseMarks && ( ev->modifiers() & Qt::ShiftModifier ) ) )
if ( _mouseMarks || ( ev->modifiers() & Qt::ShiftModifier ) )
emitSelection( true, ev->modifiers() & Qt::ControlModifier );
else
emit mouseSignal( 1, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum(), 0 );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -1015,7 +1015,7 @@ void QgsSpatiaLiteProvider::insertDefaultValue( int fieldIndex, QString defaultV
{
QVariant defaultVariant = defaultVal;

if ( mAttributeFields.at( fieldIndex ).name() != mPrimaryKey || ( mAttributeFields.at( fieldIndex ).name() == mPrimaryKey && !mPrimaryKeyAutoIncrement ) )
if ( mAttributeFields.at( fieldIndex ).name() != mPrimaryKey || !mPrimaryKeyAutoIncrement )
{
bool ok;
switch ( mAttributeFields.at( fieldIndex ).type() )
Expand Down

0 comments on commit 6480810

Please sign in to comment.