Skip to content

Commit

Permalink
Some (very minor) coverity fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 4, 2015
1 parent 10c7d6a commit f39fbf4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Expand Up @@ -79,6 +79,7 @@ QgsRelationReferenceWidget::QgsRelationReferenceWidget( QWidget* parent )
, mAllowMapIdentification( false )
, mOrderByValue( false )
, mOpenFormButtonVisible( true )
, mChainFilters( false )
{
mTopLayout = new QVBoxLayout( this );
mTopLayout->setContentsMargins( 0, 0, 0, 0 );
Expand Down
12 changes: 6 additions & 6 deletions src/server/qgswmsserver.cpp
Expand Up @@ -1401,7 +1401,7 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )
//However, in order to make attribute only queries via the FILTER parameter, it is allowed to skip them if the FILTER parameter is there

QgsRectangle* featuresRect = 0;
QgsPoint* infoPoint = 0;
QScopedPointer<QgsPoint> infoPoint;

if ( i == -1 || j == -1 )
{
Expand All @@ -1416,8 +1416,8 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )
}
else
{
infoPoint = new QgsPoint();
if ( !infoPointToMapCoordinates( i, j, infoPoint, mMapRenderer ) )
infoPoint.reset( new QgsPoint() );
if ( !infoPointToMapCoordinates( i, j, infoPoint.data(), mMapRenderer ) )
{
return 5;
}
Expand Down Expand Up @@ -1539,7 +1539,7 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )

if ( vectorLayer )
{
if ( featureInfoFromVectorLayer( vectorLayer, infoPoint, featureCount, result, layerElement, mMapRenderer, renderContext,
if ( featureInfoFromVectorLayer( vectorLayer, infoPoint.data(), featureCount, result, layerElement, mMapRenderer, renderContext,
version, infoFormat, featuresRect ) != 0 )
{
continue;
Expand All @@ -1556,11 +1556,11 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )
QgsRasterLayer* rasterLayer = dynamic_cast<QgsRasterLayer*>( currentLayer );
if ( rasterLayer )
{
if ( !infoPoint )
if ( !infoPoint.data() )
{
continue;
}
QgsPoint layerInfoPoint = mMapRenderer->mapToLayerCoordinates( currentLayer, *infoPoint );
QgsPoint layerInfoPoint = mMapRenderer->mapToLayerCoordinates( currentLayer, *(infoPoint.data()) );
if ( featureInfoFromRasterLayer( rasterLayer, &layerInfoPoint, result, layerElement, version, infoFormat ) != 0 )
{
continue;
Expand Down
10 changes: 10 additions & 0 deletions tests/src/core/testqgspainteffect.cpp
Expand Up @@ -86,6 +86,10 @@ class DummyPaintEffect : public QgsPaintEffect
class TestQgsPaintEffect: public QObject
{
Q_OBJECT

public:
TestQgsPaintEffect();

private slots:
void initTestCase();// will be called before the first testfunction is executed.
void cleanupTestCase();// will be called after the last testfunction was executed.
Expand Down Expand Up @@ -121,6 +125,12 @@ class TestQgsPaintEffect: public QObject
};


TestQgsPaintEffect::TestQgsPaintEffect()
: mPicture( 0 )
{

}

void TestQgsPaintEffect::initTestCase()
{
QgsApplication::init();
Expand Down
3 changes: 3 additions & 0 deletions tests/src/core/testqgsstylev2.cpp
Expand Up @@ -80,6 +80,9 @@ class TestStyleV2 : public QObject

TestStyleV2::TestStyleV2()
: mStyle( NULL )
, mpPointsLayer( 0 )
, mpLinesLayer( 0 )
, mpPolysLayer( 0 )
{

}
Expand Down

0 comments on commit f39fbf4

Please sign in to comment.