Skip to content

Commit 8c38bc9

Browse files
committedJan 4, 2016
More nullptr conversions
1 parent 8df09a6 commit 8c38bc9

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed
 

‎src/gui/qgsgroupwmsdatadialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class GUI_EXPORT QgsGroupWMSDataDialog: public QDialog, private Ui::QgsGroupWMSD
2828

2929
public:
3030
//! Constructor
31-
QgsGroupWMSDataDialog( QWidget *parent = 0, const Qt::WindowFlags& fl = QgisGui::ModalDialogFlags );
31+
QgsGroupWMSDataDialog( QWidget *parent = nullptr, const Qt::WindowFlags& fl = QgisGui::ModalDialogFlags );
3232
//~QgsGroupWMSDataDialog();
3333

3434
//! return group WMS title

‎src/providers/virtual/qgsvirtuallayerprovider.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ class QgsVirtualLayerProvider: public QgsVectorDataProvider
9999
// underlying vector layers
100100
struct SourceLayer
101101
{
102-
SourceLayer(): layer( 0 ) {}
102+
SourceLayer(): layer( nullptr ) {}
103103
SourceLayer( QgsVectorLayer *l, const QString& n = "" ) : layer( l ), name( n ) {}
104104
SourceLayer( const QString& p, const QString& s, const QString& n, const QString& e = "UTF-8" ) :
105-
layer( 0 ), name( n ), source( s ), provider( p ), encoding( e ) {}
105+
layer( nullptr ), name( n ), source( s ), provider( p ), encoding( e ) {}
106106
// non-null if it refers to a live layer
107107
QgsVectorLayer* layer;
108108
QString name;

‎src/providers/virtual/qgsvirtuallayerqueryparser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace QgsVirtualLayerQueryParser
2323
while ( true )
2424
{
2525
char *errMsg = nullptr;
26-
int r = sqlite3_exec( db.get(), query.toLocal8Bit().constData(), NULL, NULL, &errMsg );
26+
int r = sqlite3_exec( db.get(), query.toLocal8Bit().constData(), nullptr, nullptr, &errMsg );
2727
QString err = errMsg;
2828
if ( r && err.startsWith( noSuchError ) )
2929
{
@@ -32,7 +32,7 @@ namespace QgsVirtualLayerQueryParser
3232

3333
// create a dummy table to skip this error
3434
QString createStr = QString( "CREATE TABLE \"%1\" (id int)" ).arg( tableName.replace( "\"", "\"\"" ) );
35-
( void )sqlite3_exec( db.get(), createStr.toLocal8Bit().constData(), NULL, NULL, NULL );
35+
( void )sqlite3_exec( db.get(), createStr.toLocal8Bit().constData(), nullptr, NULL, NULL );
3636
}
3737
else
3838
{

‎src/providers/virtual/qgsvirtuallayersqlitehelper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace Sqlite
8787
Query::Query( sqlite3* db, const QString& q ) : db_( db ), nBind_( 1 )
8888
{
8989
QByteArray ba( q.toLocal8Bit() );
90-
int r = sqlite3_prepare_v2( db, ba.constData(), ba.size(), &stmt_, NULL );
90+
int r = sqlite3_prepare_v2( db, ba.constData(), ba.size(), &stmt_, nullptr );
9191
if ( r )
9292
{
9393
QString err = QString( "Query preparation error on %1" ).arg( q );
@@ -121,7 +121,7 @@ namespace Sqlite
121121
void Query::exec( sqlite3* db, const QString& sql )
122122
{
123123
char *errMsg = nullptr;
124-
int r = sqlite3_exec( db, sql.toLocal8Bit().constData(), NULL, NULL, &errMsg );
124+
int r = sqlite3_exec( db, sql.toLocal8Bit().constData(), nullptr, nullptr, &errMsg );
125125
if ( r )
126126
{
127127
QString err = QString( "Query execution error on %1: %2 - %3" ).arg( sql ).arg( r ).arg( errMsg );

‎src/providers/virtual/qgsvirtuallayersqlitehelper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extern "C"
3232
class QgsScopedSqlite
3333
{
3434
public:
35-
QgsScopedSqlite() : db_( 0 ) {}
35+
QgsScopedSqlite() : db_( nullptr ) {}
3636

3737
explicit QgsScopedSqlite( const QString& path, bool withExtension = true );
3838

‎src/providers/virtual/qgsvirtuallayersqlitemodule.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void initVirtualLayerMetadata( sqlite3* db )
5555

5656
sqlite3_stmt *stmt;
5757
int r;
58-
r = sqlite3_prepare_v2( db, "SELECT name FROM sqlite_master WHERE name='_meta'", -1, &stmt, NULL );
58+
r = sqlite3_prepare_v2( db, "SELECT name FROM sqlite_master WHERE name='_meta'", -1, &stmt, nullptr );
5959
if ( r )
6060
{
6161
throw std::runtime_error( sqlite3_errmsg( db ) );
@@ -66,7 +66,7 @@ void initVirtualLayerMetadata( sqlite3* db )
6666
char *errMsg;
6767
if ( create_meta )
6868
{
69-
r = sqlite3_exec( db, QString( "CREATE TABLE _meta (version INT, url TEXT); INSERT INTO _meta (version) VALUES(%1);" ).arg( VIRTUAL_LAYER_VERSION ).toLocal8Bit().constData(), NULL, NULL, &errMsg );
69+
r = sqlite3_exec( db, QString( "CREATE TABLE _meta (version INT, url TEXT); INSERT INTO _meta (version) VALUES(%1);" ).arg( VIRTUAL_LAYER_VERSION ).toLocal8Bit().constData(), nullptr, nullptr, &errMsg );
7070
if ( r )
7171
{
7272
throw std::runtime_error( errMsg );
@@ -485,7 +485,7 @@ int vtable_bestindex( sqlite3_vtab *pvtab, sqlite3_index_info* index_info )
485485
index_info->idxNum = 1; // PK filter
486486
index_info->estimatedCost = 1.0; // ??
487487
//index_info->estimatedRows = 1;
488-
index_info->idxStr = NULL;
488+
index_info->idxStr = nullptr;
489489
index_info->needToFreeIdxStr = 0;
490490
return SQLITE_OK;
491491
}
@@ -500,15 +500,15 @@ int vtable_bestindex( sqlite3_vtab *pvtab, sqlite3_index_info* index_info )
500500
index_info->idxNum = 2; // RTree filter
501501
index_info->estimatedCost = 1.0; // ??
502502
//index_info->estimatedRows = 1;
503-
index_info->idxStr = NULL;
503+
index_info->idxStr = nullptr;
504504
index_info->needToFreeIdxStr = 0;
505505
return SQLITE_OK;
506506
}
507507
}
508508
index_info->idxNum = 0;
509509
index_info->estimatedCost = 10.0;
510510
//index_info->estimatedRows = 10;
511-
index_info->idxStr = NULL;
511+
index_info->idxStr = nullptr;
512512
index_info->needToFreeIdxStr = 0;
513513
return SQLITE_OK;
514514
}
@@ -685,15 +685,15 @@ int qgsvlayer_module_init( sqlite3 *db, char **pzErrMsg, void * unused /*const s
685685
module.xRowid = vtable_rowid;
686686
module.xRename = vtable_rename;
687687

688-
module.xUpdate = NULL;
689-
module.xBegin = NULL;
690-
module.xSync = NULL;
691-
module.xCommit = NULL;
692-
module.xRollback = NULL;
693-
module.xFindFunction = NULL;
694-
module.xSavepoint = NULL;
695-
module.xRelease = NULL;
696-
module.xRollbackTo = NULL;
688+
module.xUpdate = nullptr;
689+
module.xBegin = nullptr;
690+
module.xSync = nullptr;
691+
module.xCommit = nullptr;
692+
module.xRollback = nullptr;
693+
module.xFindFunction = nullptr;
694+
module.xSavepoint = nullptr;
695+
module.xRelease = nullptr;
696+
module.xRollbackTo = nullptr;
697697

698698
ModuleContext* context = new ModuleContext;
699699
sqlite3_create_module_v2( db, "QgsVLayer", &module, context, module_destroy );

0 commit comments

Comments
 (0)
Please sign in to comment.