Skip to content
Permalink
Browse files

Fix coverity issues

  • Loading branch information
nyalldawson committed Dec 9, 2015
1 parent 0287daf commit 7d59be880a3af28a5cc0b358f84a60a34a75a5d1
@@ -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());
@@ -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 Contributor

@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 )
@@ -622,8 +622,6 @@ class CORE_EXPORT QgsEditFormConfig : public QObject

QgsFields mFields;

bool mUseInitCode;

friend class QgsVectorLayer;
};

@@ -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 );
@@ -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

0 comments on commit 7d59be8

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