Skip to content

Commit f39fbf4

Browse files
committedJun 4, 2015
Some (very minor) coverity fixes
1 parent 10c7d6a commit f39fbf4

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed
 

‎src/gui/editorwidgets/qgsrelationreferencewidget.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ QgsRelationReferenceWidget::QgsRelationReferenceWidget( QWidget* parent )
7979
, mAllowMapIdentification( false )
8080
, mOrderByValue( false )
8181
, mOpenFormButtonVisible( true )
82+
, mChainFilters( false )
8283
{
8384
mTopLayout = new QVBoxLayout( this );
8485
mTopLayout->setContentsMargins( 0, 0, 0, 0 );

‎src/server/qgswmsserver.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )
14011401
//However, in order to make attribute only queries via the FILTER parameter, it is allowed to skip them if the FILTER parameter is there
14021402

14031403
QgsRectangle* featuresRect = 0;
1404-
QgsPoint* infoPoint = 0;
1404+
QScopedPointer<QgsPoint> infoPoint;
14051405

14061406
if ( i == -1 || j == -1 )
14071407
{
@@ -1416,8 +1416,8 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )
14161416
}
14171417
else
14181418
{
1419-
infoPoint = new QgsPoint();
1420-
if ( !infoPointToMapCoordinates( i, j, infoPoint, mMapRenderer ) )
1419+
infoPoint.reset( new QgsPoint() );
1420+
if ( !infoPointToMapCoordinates( i, j, infoPoint.data(), mMapRenderer ) )
14211421
{
14221422
return 5;
14231423
}
@@ -1539,7 +1539,7 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )
15391539

15401540
if ( vectorLayer )
15411541
{
1542-
if ( featureInfoFromVectorLayer( vectorLayer, infoPoint, featureCount, result, layerElement, mMapRenderer, renderContext,
1542+
if ( featureInfoFromVectorLayer( vectorLayer, infoPoint.data(), featureCount, result, layerElement, mMapRenderer, renderContext,
15431543
version, infoFormat, featuresRect ) != 0 )
15441544
{
15451545
continue;
@@ -1556,11 +1556,11 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )
15561556
QgsRasterLayer* rasterLayer = dynamic_cast<QgsRasterLayer*>( currentLayer );
15571557
if ( rasterLayer )
15581558
{
1559-
if ( !infoPoint )
1559+
if ( !infoPoint.data() )
15601560
{
15611561
continue;
15621562
}
1563-
QgsPoint layerInfoPoint = mMapRenderer->mapToLayerCoordinates( currentLayer, *infoPoint );
1563+
QgsPoint layerInfoPoint = mMapRenderer->mapToLayerCoordinates( currentLayer, *(infoPoint.data()) );
15641564
if ( featureInfoFromRasterLayer( rasterLayer, &layerInfoPoint, result, layerElement, version, infoFormat ) != 0 )
15651565
{
15661566
continue;

‎tests/src/core/testqgspainteffect.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ class DummyPaintEffect : public QgsPaintEffect
8686
class TestQgsPaintEffect: public QObject
8787
{
8888
Q_OBJECT
89+
90+
public:
91+
TestQgsPaintEffect();
92+
8993
private slots:
9094
void initTestCase();// will be called before the first testfunction is executed.
9195
void cleanupTestCase();// will be called after the last testfunction was executed.
@@ -121,6 +125,12 @@ class TestQgsPaintEffect: public QObject
121125
};
122126

123127

128+
TestQgsPaintEffect::TestQgsPaintEffect()
129+
: mPicture( 0 )
130+
{
131+
132+
}
133+
124134
void TestQgsPaintEffect::initTestCase()
125135
{
126136
QgsApplication::init();

‎tests/src/core/testqgsstylev2.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ class TestStyleV2 : public QObject
8080

8181
TestStyleV2::TestStyleV2()
8282
: mStyle( NULL )
83+
, mpPointsLayer( 0 )
84+
, mpLinesLayer( 0 )
85+
, mpPolysLayer( 0 )
8386
{
8487

8588
}

0 commit comments

Comments
 (0)
Please sign in to comment.