Skip to content

Commit 76b0bcf

Browse files
committed
again more coverity fixes
1 parent 5160d46 commit 76b0bcf

File tree

3 files changed

+22
-32
lines changed

3 files changed

+22
-32
lines changed

src/app/qgsrasterlayerproperties.cpp

+19-30
Original file line numberDiff line numberDiff line change
@@ -884,47 +884,36 @@ void QgsRasterLayerProperties::apply()
884884
// pixmapLegend->repaint();
885885

886886
QgsRasterResampleFilter* resampleFilter = mRasterLayer->resampleFilter();
887-
888-
QgsRasterResampler* zoomedInResampler = 0;
889-
QString zoomedInResamplingMethod = mZoomedInResamplingComboBox->currentText();
890-
if ( zoomedInResamplingMethod == tr( "Bilinear" ) )
891-
{
892-
zoomedInResampler = new QgsBilinearRasterResampler();
893-
}
894-
else if ( zoomedInResamplingMethod == tr( "Cubic" ) )
895-
{
896-
zoomedInResampler = new QgsCubicRasterResampler();
897-
}
898-
899887
if ( resampleFilter )
900888
{
889+
QgsRasterResampler *zoomedInResampler = 0;
890+
QString zoomedInResamplingMethod = mZoomedInResamplingComboBox->currentText();
891+
if ( zoomedInResamplingMethod == tr( "Bilinear" ) )
892+
{
893+
zoomedInResampler = new QgsBilinearRasterResampler();
894+
}
895+
else if ( zoomedInResamplingMethod == tr( "Cubic" ) )
896+
{
897+
zoomedInResampler = new QgsCubicRasterResampler();
898+
}
899+
901900
resampleFilter->setZoomedInResampler( zoomedInResampler );
902-
}
903901

904-
//raster resampling
905-
QgsRasterResampler* zoomedOutResampler = 0;
906-
QString zoomedOutResamplingMethod = mZoomedOutResamplingComboBox->currentText();
907-
if ( zoomedOutResamplingMethod == tr( "Average" ) )
908-
{
909-
zoomedOutResampler = new QgsBilinearRasterResampler();
910-
}
902+
//raster resampling
903+
QgsRasterResampler *zoomedOutResampler = 0;
904+
QString zoomedOutResamplingMethod = mZoomedOutResamplingComboBox->currentText();
905+
if ( zoomedOutResamplingMethod == tr( "Average" ) )
906+
{
907+
zoomedOutResampler = new QgsBilinearRasterResampler();
908+
}
911909

912-
if ( resampleFilter )
913-
{
914910
resampleFilter->setZoomedOutResampler( zoomedOutResampler );
915-
}
916-
else
917-
{
918-
delete zoomedOutResampler;
919-
}
920911

921-
if ( resampleFilter )
922-
{
923912
resampleFilter->setMaxOversampling( mMaximumOversamplingSpinBox->value() );
924913
}
925914

926915
// Hue and saturation controls
927-
QgsHueSaturationFilter* hueSaturationFilter = mRasterLayer->hueSaturationFilter();
916+
QgsHueSaturationFilter *hueSaturationFilter = mRasterLayer->hueSaturationFilter();
928917
if ( hueSaturationFilter )
929918
{
930919
hueSaturationFilter->setSaturation( sliderSaturation->value() );

src/providers/mssql/qgsmssqldataitems.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ QVector<QgsDataItem*> QgsMssqlConnectionItem::createChildren()
147147
layer.srid = q.value( 3 ).toString();
148148
layer.type = q.value( 4 ).toString();
149149
layer.pkCols = QStringList(); //TODO
150+
layer.isGeography = false;
150151

151152
// skip layers which are added already
152153
bool skip = false;

tests/src/core/testqgsdatadefined.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <QString>
1818
#include <QStringList>
1919
#include <QSettings>
20+
#include <QSharedPointer>
2021

2122
#include <qgsdatadefined.h>
2223

@@ -63,12 +64,11 @@ void TestQgsDataDefined::cleanup()
6364

6465
void TestQgsDataDefined::create()
6566
{
66-
QgsDataDefined* dd = new QgsDataDefined( true, true, QString( "exp" ), QString( "field" ) );
67+
QSharedPointer<QgsDataDefined> dd( new QgsDataDefined( true, true, QString( "exp" ), QString( "field" ) ) );
6768
QVERIFY( dd->isActive() );
6869
QVERIFY( dd->useExpression() );
6970
QCOMPARE( dd->expressionString(), QString( "exp" ) );
7071
QCOMPARE( dd->field(), QString( "field" ) );
71-
delete dd;
7272
}
7373

7474
void TestQgsDataDefined::gettersSetters()

0 commit comments

Comments
 (0)