Skip to content

Commit

Permalink
Address some clazy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 5, 2018
1 parent 3d5badf commit d142794
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/core/processing/qgsprocessingparameters.cpp
Expand Up @@ -264,7 +264,6 @@ QList<int> QgsProcessingParameters::parameterAsEnums( const QgsProcessingParamet
if ( !definition )
return QList<int>();

QVariantList resultList;
return parameterAsEnums( definition, parameters.value( definition->name() ), context );
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsprojectstorageregistry.cpp
Expand Up @@ -20,7 +20,7 @@

QgsProjectStorageRegistry::~QgsProjectStorageRegistry()
{
qDeleteAll( mBackends.values() );
qDeleteAll( mBackends );
}

QgsProjectStorage *QgsProjectStorageRegistry::projectStorageFromType( const QString &type )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -810,7 +810,7 @@ void QgsAttributeTableModel::bulkEditCommandEnded()
if ( fullModelUpdate )
{
// Invalidates the cache (there is no API for doing this directly)
mLayerCache->layer()->dataChanged();
emit mLayerCache->layer()->dataChanged();
emit dataChanged( createIndex( 0, 0 ), createIndex( rowCount() - 1, columnCount() - 1 ) );
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/providers/gdal/qgsgdalprovider.cpp
Expand Up @@ -472,12 +472,12 @@ QgsGdalProvider::~QgsGdalProvider()
{
// Check if already a PAM (persistent auxiliary metadata) file exists
QString pamFile = dataSourceUri( true ) + QLatin1String( ".aux.xml" );
bool pamFileAlreadyExists = QFileInfo( pamFile ).exists();
bool pamFileAlreadyExists = QFileInfo::exists( pamFile );

GDALClose( mGdalDataset );

// If GDAL created a PAM file right now by using estimated metadata, delete it right away
if ( !mStatisticsAreReliable && !pamFileAlreadyExists && QFileInfo( pamFile ).exists() )
if ( !mStatisticsAreReliable && !pamFileAlreadyExists && QFileInfo::exists( pamFile ) )
QFile( pamFile ).remove();
}

Expand Down
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspgtablemodel.cpp
Expand Up @@ -287,7 +287,7 @@ bool QgsPgTableModel::setData( const QModelIndex &idx, const QVariant &value, in
{
QSet<QString> s0( idx.sibling( idx.row(), DbtmPkCol ).data( Qt::UserRole + 2 ).toStringList().toSet() );
QSet<QString> s1( pkCols.toSet() );
if ( s0.intersect( s1 ).isEmpty() )
if ( !s0.intersects( s1 ) )
tip = tr( "Select columns in the '%1' column that uniquely identify features of this layer" ).arg( tr( "Feature id" ) );
}

Expand Down Expand Up @@ -342,7 +342,7 @@ QString QgsPgTableModel::layerURI( const QModelIndex &index, const QString &conn
QStandardItem *pkItem = itemFromIndex( index.sibling( index.row(), DbtmPkCol ) );
QSet<QString> s0( pkItem->data( Qt::UserRole + 1 ).toStringList().toSet() );
QSet<QString> s1( pkItem->data( Qt::UserRole + 2 ).toStringList().toSet() );
if ( !s0.isEmpty() && s0.intersect( s1 ).isEmpty() )
if ( !s0.isEmpty() && !s0.intersects( s1 ) )
{
// no valid primary candidate selected
QgsDebugMsg( QStringLiteral( "no pk candidate selected" ) );
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/wms/qgswmsparameters.cpp
Expand Up @@ -523,7 +523,7 @@ namespace QgsWms
const QRegExp composerParamRegExp( QStringLiteral( "^MAP\\d+:" ) );
if ( key.contains( composerParamRegExp ) )
{
const int mapId = key.mid( 3, key.indexOf( ':' ) - 3 ).toInt();
const int mapId = key.midRef( 3, key.indexOf( ':' ) - 3 ).toInt();
const QString theKey = key.mid( key.indexOf( ':' ) + 1 );
const QgsWmsParameter::Name name = QgsWmsParameter::name( theKey );

Expand Down

0 comments on commit d142794

Please sign in to comment.