Skip to content

Commit c733b36

Browse files
committedSep 9, 2017
Use auto for const complex vars in for loop
1 parent 9d7273d commit c733b36

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎src/providers/ogr/qgsgeopackagedataitems.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ QgsGeoPackageConnectionItem::QgsGeoPackageConnectionItem( QgsDataItem *parent, Q
137137
QVector<QgsDataItem *> QgsGeoPackageConnectionItem::createChildren()
138138
{
139139
QVector<QgsDataItem *> children;
140-
QList<QgsOgrDbLayerInfo *> layers = QgsOgrLayerItem::subLayers( mPath, QStringLiteral( "GPKG" ) );
141-
for ( const QgsOgrDbLayerInfo *info : qgsAsConst( layers ) )
140+
const auto layers = QgsOgrLayerItem::subLayers( mPath, QStringLiteral( "GPKG" ) );
141+
for ( const QgsOgrDbLayerInfo *info : layers )
142142
{
143143
if ( info->layerType() == QgsLayerItem::LayerType::Raster )
144144
{
@@ -197,7 +197,7 @@ bool QgsGeoPackageConnectionItem::handleDrop( const QMimeData *data, Qt::DropAct
197197
QStringList importResults;
198198
bool hasError = false;
199199

200-
const QgsMimeDataUtils::UriList lst = QgsMimeDataUtils::decodeUriList( data );
200+
const auto lst = QgsMimeDataUtils::decodeUriList( data );
201201
for ( const QgsMimeDataUtils::Uri &dropUri : lst )
202202
{
203203
// Check that we are not copying over self
@@ -239,8 +239,8 @@ bool QgsGeoPackageConnectionItem::handleDrop( const QMimeData *data, Qt::DropAct
239239

240240
// check if the destination layer already exists
241241
bool exists = false;
242-
const QVector< QgsDataItem *> c( children() );
243-
for ( const auto child : c )
242+
const auto c( children() );
243+
for ( const QgsDataItem *child : c )
244244
{
245245
if ( child->name() == dropUri.name )
246246
{
@@ -495,7 +495,7 @@ void QgsGeoPackageAbstractLayerItem::deleteLayer()
495495
{
496496
// Check if the layer is in the registry
497497
const QgsMapLayer *projectLayer = nullptr;
498-
const QMap<QString, QgsMapLayer *> mapLayers( QgsProject::instance()->mapLayers() );
498+
const auto mapLayers( QgsProject::instance()->mapLayers() );
499499
for ( const QgsMapLayer *layer : mapLayers )
500500
{
501501
if ( layer->publicSource() == mUri )

0 commit comments

Comments
 (0)
Please sign in to comment.