Skip to content

Commit b20b831

Browse files
committed
0/NULL -> nullptr
Using clang-tidy modernize-use-nullptr
1 parent 904aaef commit b20b831

14 files changed

+40
-40
lines changed

src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8600,7 +8600,7 @@ void QgisApp::layerSubsetString()
86008600

86018601
if ( !vlayer->vectorJoins().isEmpty() )
86028602
{
8603-
if ( QMessageBox::question( NULL, tr( "Filter on joined fields" ),
8603+
if ( QMessageBox::question( nullptr, tr( "Filter on joined fields" ),
86048604
tr( "You are about to set a subset filter on a layer that has joined fields. "
86058605
"Joined fields cannot be filtered, unless you convert the layer to a virtual layer first. "
86068606
"Would you like to create a virtual layer out of this layer first?" ),

src/app/qgsbookmarks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ QAbstractTableModel *QgsMergedBookmarksTableModel::qgisModel()
660660
void QgsMergedBookmarksTableModel::moveBookmark( QAbstractTableModel &modelFrom, QAbstractTableModel &modelTo, int row )
661661
{
662662
QSqlTableModel *qgisModel = dynamic_cast<QSqlTableModel *>( &modelTo );
663-
if ( qgisModel == NULL )
663+
if ( qgisModel == nullptr )
664664
{
665665
modelTo.insertRow( -1 );
666666
for ( int column = 1 ; column < modelFrom.columnCount() ; column++ )

src/app/qgslayerstylingwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
361361
{
362362
if ( !mLabelingWidget )
363363
{
364-
mLabelingWidget = new QgsLabelingWidget( 0, mMapCanvas, mWidgetStack );
364+
mLabelingWidget = new QgsLabelingWidget( nullptr, mMapCanvas, mWidgetStack );
365365
mLabelingWidget->setDockMode( true );
366366
connect( mLabelingWidget, &QgsLabelingWidget::widgetChanged, this, &QgsLayerStylingWidget::autoApply );
367367
}

src/core/geometry/qgsabstractgeometry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,6 @@ QgsAbstractGeometry *QgsAbstractGeometry::segmentize( double tolerance, Segmenta
271271

272272
QgsAbstractGeometry *QgsAbstractGeometry::toCurveType() const
273273
{
274-
return 0;
274+
return nullptr;
275275
}
276276

src/core/layout/qgslayoutitem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
QgsLayoutItem::QgsLayoutItem( QgsLayout *layout )
2929
: QgsLayoutObject( layout )
30-
, QGraphicsRectItem( 0 )
30+
, QGraphicsRectItem( nullptr )
3131
, mUuid( QUuid::createUuid().toString() )
3232
{
3333
setZValue( QgsLayout::ZItem );

src/core/qgscoordinatetransform_p.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ QString QgsCoordinateTransformPrivate::datumTransformString( int datumTransform
236236
QString transformString;
237237

238238
sqlite3 *db = nullptr;
239-
int openResult = sqlite3_open_v2( QgsApplication::srsDatabaseFilePath().toUtf8().constData(), &db, SQLITE_OPEN_READONLY, 0 );
239+
int openResult = sqlite3_open_v2( QgsApplication::srsDatabaseFilePath().toUtf8().constData(), &db, SQLITE_OPEN_READONLY, nullptr );
240240
if ( openResult != SQLITE_OK )
241241
{
242242
sqlite3_close( db );

src/core/qgsziputils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ bool QgsZipUtils::unzip( const QString &zipFilename, const QString &dir, QString
6868
int rc = 0;
6969
struct zip *z = zip_open( zipFilename.toStdString().c_str(), ZIP_CHECKCONS, &rc );
7070

71-
if ( rc == ZIP_ER_OK && z != NULL )
71+
if ( rc == ZIP_ER_OK && z != nullptr )
7272
{
7373
int count = zip_get_num_files( z );
7474
if ( count != -1 )
@@ -130,7 +130,7 @@ bool QgsZipUtils::zip( const QString &zipFilename, const QStringList &files )
130130
int rc = 0;
131131
struct zip *z = zip_open( zipFilename.toStdString().c_str(), ZIP_CREATE, &rc );
132132

133-
if ( rc == ZIP_ER_OK && z != NULL )
133+
if ( rc == ZIP_ER_OK && z != nullptr )
134134
{
135135
for ( const auto &file : files )
136136
{
@@ -144,7 +144,7 @@ bool QgsZipUtils::zip( const QString &zipFilename, const QStringList &files )
144144
}
145145

146146
zip_source *src = zip_source_file( z, file.toStdString().c_str(), 0, 0 );
147-
if ( src != NULL )
147+
if ( src != nullptr )
148148
{
149149
#if LIBZIP_VERSION_MAJOR < 1
150150
int rc = ( int ) zip_add( z, fileInfo.fileName().toStdString().c_str(), src );

src/gui/qgsmapcanvastracer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ QgsMapCanvasTracer::~QgsMapCanvasTracer()
5656

5757
QgsMapCanvasTracer *QgsMapCanvasTracer::tracerForCanvas( QgsMapCanvas *canvas )
5858
{
59-
return sTracers.value( canvas, 0 );
59+
return sTracers.value( canvas, nullptr );
6060
}
6161

6262
void QgsMapCanvasTracer::reportError( QgsTracer::PathError err, bool addingVertex )

src/gui/raster/qgsrasterhistogramwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ void QgsRasterHistogramWidget::refreshHistogram()
502502
mypCurve->setPen( QPen( mHistoColors.at( myIteratorInt ) ) );
503503
}
504504

505-
QwtPlotHistogram *mypHisto = 0;
505+
QwtPlotHistogram *mypHisto = nullptr;
506506
if ( ! myDrawLines )
507507
{
508508
mypHisto = new QwtPlotHistogram( tr( "Band %1" ).arg( myIteratorInt ) );

src/providers/gdal/qgsgdalprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ bool QgsGdalProvider::hasHistogram( int bandNo,
12711271
double myMinVal, myMaxVal;
12721272
int myBinCount;
12731273

1274-
GUIntBig *myHistogramArray = 0;
1274+
GUIntBig *myHistogramArray = nullptr;
12751275
CPLErr myError = GDALGetDefaultHistogramEx( myGdalBand, &myMinVal, &myMaxVal,
12761276
&myBinCount, &myHistogramArray, false,
12771277
nullptr, nullptr );

0 commit comments

Comments
 (0)