mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Fix Coverity uninitialized member warnings
This commit is contained in:
parent
5939ae23e7
commit
f84508a35d
@ -34,21 +34,8 @@ QgsZonalStatistics::QgsZonalStatistics( QgsVectorLayer* polygonLayer, QgsRasterL
|
||||
, mRasterBand( rasterBand )
|
||||
, mPolygonLayer( polygonLayer )
|
||||
, mAttributePrefix( attributePrefix )
|
||||
, mInputNodataValue( -1 )
|
||||
, mStatistics( stats )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QgsZonalStatistics::QgsZonalStatistics()
|
||||
: mRasterLayer( nullptr )
|
||||
, mRasterBand( 0 )
|
||||
, mPolygonLayer( nullptr )
|
||||
, mInputNodataValue( -1 )
|
||||
, mStatistics( QgsZonalStatistics::All )
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ class ANALYSIS_EXPORT QgsZonalStatistics
|
||||
int calculateStatistics( QProgressDialog* p );
|
||||
|
||||
private:
|
||||
QgsZonalStatistics();
|
||||
QgsZonalStatistics() = default;
|
||||
|
||||
class FeatureStats
|
||||
{
|
||||
@ -128,15 +128,15 @@ class ANALYSIS_EXPORT QgsZonalStatistics
|
||||
|
||||
QString getUniqueFieldName( const QString& fieldName, const QList<QgsField>& newFields );
|
||||
|
||||
QgsRasterLayer* mRasterLayer;
|
||||
QgsRasterDataProvider* mRasterProvider;
|
||||
//! Raster band to calculate statistics from (defaults to 1)
|
||||
int mRasterBand;
|
||||
QgsVectorLayer* mPolygonLayer;
|
||||
QgsRasterLayer* mRasterLayer = nullptr;
|
||||
QgsRasterDataProvider* mRasterProvider = nullptr;
|
||||
//! Raster band to calculate statistics
|
||||
int mRasterBand = 0;
|
||||
QgsVectorLayer* mPolygonLayer = nullptr;
|
||||
QString mAttributePrefix;
|
||||
//! The nodata value of the input layer
|
||||
float mInputNodataValue;
|
||||
Statistics mStatistics;
|
||||
float mInputNodataValue = -1;
|
||||
Statistics mStatistics = QgsZonalStatistics::All;
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS( QgsZonalStatistics::Statistics )
|
||||
|
@ -30,9 +30,6 @@ class TestQgsZonalStatistics : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TestQgsZonalStatistics();
|
||||
|
||||
private slots:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
@ -42,16 +39,10 @@ class TestQgsZonalStatistics : public QObject
|
||||
void testStatistics();
|
||||
|
||||
private:
|
||||
QgsVectorLayer* mVectorLayer;
|
||||
QgsRasterLayer* mRasterLayer;
|
||||
QgsVectorLayer* mVectorLayer = nullptr;
|
||||
QgsRasterLayer* mRasterLayer = nullptr;
|
||||
};
|
||||
|
||||
TestQgsZonalStatistics::TestQgsZonalStatistics()
|
||||
: mVectorLayer( nullptr )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void TestQgsZonalStatistics::initTestCase()
|
||||
{
|
||||
QgsApplication::init();
|
||||
|
Loading…
x
Reference in New Issue
Block a user