Skip to content

Commit

Permalink
Fix coverity issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 22, 2016
1 parent e83a7c8 commit bfad753
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -7480,7 +7480,9 @@ void QgisApp::layerSubsetString()
QgsLayerTreeUtils::insertLayerBelow( QgsProject::instance()->layerTreeRoot(), vlayer, newLayer );
mLayerTreeView->setCurrentLayer( newLayer );
// hide the old layer
QgsProject::instance()->layerTreeRoot()->findLayer( vlayer->id() )->setVisible( Qt::Unchecked );
QgsLayerTreeLayer* vLayerTreeLayer = QgsProject::instance()->layerTreeRoot()->findLayer( vlayer->id() );
if ( vLayerTreeLayer )
vLayerTreeLayer->setVisible( Qt::Unchecked );
vlayer = newLayer;
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsprojectproperties.cpp
Expand Up @@ -1788,7 +1788,7 @@ void QgsProjectProperties::checkOWS( QgsLayerTreeGroup* treeGroup, QStringList&
owsNames << shortName;
if ( l->type() == QgsMapLayer::VectorLayer )
{
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer *>( l );
QgsVectorLayer* vl = static_cast<QgsVectorLayer *>( l );
if ( vl->dataProvider()->encoding() == "System" )
encodingMessages << tr( "Update layer \"%1\" encoding" ).arg( l->name() );
}
Expand Down
3 changes: 3 additions & 0 deletions src/core/layertree/qgslayertreeutils.cpp
Expand Up @@ -399,6 +399,9 @@ QgsLayerTreeLayer* QgsLayerTreeUtils::insertLayerBelow( QgsLayerTreeGroup* group
{
// get the index of the reflayer
QgsLayerTreeLayer* inTree = group->findLayer( refLayer->id() );
if ( !inTree )
return nullptr;

int idx = 0;
foreach ( QgsLayerTreeNode* vl, inTree->parent()->children() )
{
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsfilewidget.cpp
Expand Up @@ -38,6 +38,7 @@ QgsFileWidget::QgsFileWidget( QWidget *parent )
, mFilter( QString() )
, mDefaultRoot( QString() )
, mStorageMode( GetFile )
, mRelativeStorage( Absolute )
{
setBackgroundRole( QPalette::Window );
setAutoFillBackground( true );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -4056,7 +4056,7 @@ bool QgsSpatiaLiteProvider::changeGeometryValues( const QgsGeometryMap &geometry
if ( toCommit )
{
// ROLLBACK after some previous error
sqlite3_exec( sqliteHandle, "ROLLBACK", nullptr, nullptr, nullptr );
( void )sqlite3_exec( sqliteHandle, "ROLLBACK", nullptr, nullptr, nullptr );
}

return false;
Expand Down

0 comments on commit bfad753

Please sign in to comment.