Skip to content
Permalink
Browse files

Address some clazy warnings

  • Loading branch information
nyalldawson committed Nov 4, 2018
1 parent 3d5badf commit d1427945aa4747d10b2cd6121d9feac42cadbc78
@@ -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 );
}

@@ -20,7 +20,7 @@

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

QgsProjectStorage *QgsProjectStorageRegistry::projectStorageFromType( const QString &type )
@@ -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
@@ -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();
}

@@ -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" ) );
}

@@ -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" ) );
@@ -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 );

0 comments on commit d142794

Please sign in to comment.
You can’t perform that action at this time.