@@ -1453,9 +1453,8 @@ void QgsOfflineEditing::committedAttributesAdded( const QString &qgisLayerId, co
1453
1453
int layerId = getOrCreateLayerId ( database.get (), qgisLayerId );
1454
1454
int commitNo = getCommitNo ( database.get () );
1455
1455
1456
- for ( QList< QgsField>::const_iterator it = addedAttributes. begin (); it != addedAttributes. end (); ++it )
1456
+ for ( const QgsField &field : addedAttributes )
1457
1457
{
1458
- QgsField field = *it;
1459
1458
QString sql = QStringLiteral ( " INSERT INTO 'log_added_attrs' VALUES ( %1, %2, '%3', %4, %5, %6, '%7' )" )
1460
1459
.arg ( layerId )
1461
1460
.arg ( commitNo )
@@ -1516,19 +1515,19 @@ void QgsOfflineEditing::committedFeaturesRemoved( const QString &qgisLayerId, co
1516
1515
// insert log
1517
1516
int layerId = getOrCreateLayerId ( database.get (), qgisLayerId );
1518
1517
1519
- for ( QgsFeatureIds::const_iterator it = deletedFeatureIds. begin (); it != deletedFeatureIds. end (); ++it )
1518
+ for ( QgsFeatureId id : deletedFeatureIds )
1520
1519
{
1521
- if ( isAddedFeature ( database.get (), layerId, *it ) )
1520
+ if ( isAddedFeature ( database.get (), layerId, id ) )
1522
1521
{
1523
1522
// remove from added features log
1524
- QString sql = QStringLiteral ( " DELETE FROM 'log_added_features' WHERE \" layer_id\" = %1 AND \" fid\" = %2" ).arg ( layerId ).arg ( *it );
1523
+ QString sql = QStringLiteral ( " DELETE FROM 'log_added_features' WHERE \" layer_id\" = %1 AND \" fid\" = %2" ).arg ( layerId ).arg ( id );
1525
1524
sqlExec ( database.get (), sql );
1526
1525
}
1527
1526
else
1528
1527
{
1529
1528
QString sql = QStringLiteral ( " INSERT INTO 'log_removed_features' VALUES ( %1, %2)" )
1530
1529
.arg ( layerId )
1531
- .arg ( *it );
1530
+ .arg ( id );
1532
1531
sqlExec ( database.get (), sql );
1533
1532
}
1534
1533
}
0 commit comments