Skip to content

Commit

Permalink
Fix coverity issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 9, 2015
1 parent 0287daf commit 7d59be8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -9904,7 +9904,7 @@ QgsRasterLayer* QgisApp::addRasterLayerPrivate(
{
QFileInfo fileInfo( uri );
QString dirName = fileInfo.path();
layer = new QgsRasterLayer( dirName, QFileInfo( dirName ).completeBaseName(), "gdal" );
layer = new QgsRasterLayer( dirName, QFileInfo( dirName ).completeBaseName(), QString( "gdal" ) );
}
else if ( providerKey.isEmpty() )
layer = new QgsRasterLayer( uri, baseName ); // fi.completeBaseName());
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsguivectorlayertools.cpp
Expand Up @@ -38,7 +38,7 @@ bool QgsGuiVectorLayerTools::addFeature( QgsVectorLayer* layer, const QgsAttribu
if ( !feat )
f = new QgsFeature();

feat->setGeometry( defaultGeometry );
f->setGeometry( defaultGeometry );

This comment has been minimized.

Copy link
@nyalldawson

nyalldawson Dec 9, 2015

Author Collaborator

@m-kuhn pretty sure this was the original intention here, but can you confirm?

This comment has been minimized.

Copy link
@m-kuhn

m-kuhn Dec 9, 2015

Member

Yeah, absolutely.

QgsFeatureAction a( tr( "Add feature" ), *f, layer );
bool added = a.addFeature( defaultValues );
if ( !feat )
Expand Down
2 changes: 0 additions & 2 deletions src/core/qgseditformconfig.h
Expand Up @@ -622,8 +622,6 @@ class CORE_EXPORT QgsEditFormConfig : public QObject

QgsFields mFields;

bool mUseInitCode;

friend class QgsVectorLayer;
};

Expand Down
2 changes: 2 additions & 0 deletions tests/src/core/testqgslayertree.cpp
Expand Up @@ -396,6 +396,7 @@ void TestQgsLayerTree::testRendererLegend( QgsFeatureRendererV2* renderer )
}
//try changing a symbol's color
QgsSymbolV2LegendNode* symbolNode = dynamic_cast< QgsSymbolV2LegendNode* >( m->findLegendNode( vl->id(), symbolList.at( 1 ).ruleKey() ) );
QVERIFY( symbolNode );
QgsSymbolV2* newSymbol = symbolNode->symbol()->clone();
newSymbol->setColor( QColor( 255, 255, 0 ) );
symbolNode->setSymbol( newSymbol );
Expand All @@ -410,6 +411,7 @@ void TestQgsLayerTree::testRendererLegend( QgsFeatureRendererV2* renderer )
renderer->setLegendSymbolItem( symbolList.at( 2 ).ruleKey(), QgsMarkerSymbolV2::createSimple( props ) );
m->refreshLayerLegend( n );
symbolNode = dynamic_cast< QgsSymbolV2LegendNode* >( m->findLegendNode( vl->id(), symbolList.at( 2 ).ruleKey() ) );
QVERIFY( symbolNode );
QCOMPARE( symbolNode->symbol()->color(), QColor( 0, 255, 255 ) );

//cleanup
Expand Down

0 comments on commit 7d59be8

Please sign in to comment.