Skip to content
Permalink
Browse files

fix wrong feedback message in case addFeatures had not been successfull

(change from d523eb9 without changing feedback texts)
  • Loading branch information
signedav committed Jul 8, 2020
1 parent 5b01c54 commit 1353bb5b9416d30a3d3fe47ec243b4bbc3645323
Showing with 14 additions and 8 deletions.
  1. +14 −8 src/app/qgisapp.cpp
@@ -10251,19 +10251,25 @@ void QgisApp::pasteFromClipboard( QgsMapLayer *destinationLayer )

void QgisApp::pasteFeatures( QgsVectorLayer *pasteVectorLayer, int invalidGeometriesCount, int nTotalFeatures, QgsFeatureList &features )
{
pasteVectorLayer->addFeatures( features );
QgsFeatureIds newIds;
newIds.reserve( features.size() );
for ( const QgsFeature &f : qgis::as_const( features ) )
int nCopiedFeatures = features.count();
if ( pasteVectorLayer->addFeatures( features ) )
{
newIds << f.id();
}
QgsFeatureIds newIds;
newIds.reserve( features.size() );
for ( const QgsFeature &f : qgis::as_const( features ) )
{
newIds << f.id();
}

pasteVectorLayer->selectByIds( newIds );
pasteVectorLayer->selectByIds( newIds );
}
else
{
nCopiedFeatures = 0;
}
pasteVectorLayer->endEditCommand();
pasteVectorLayer->updateExtents();

int nCopiedFeatures = features.count();
Qgis::MessageLevel level = ( nCopiedFeatures == 0 || invalidGeometriesCount > 0 ) ? Qgis::Warning : Qgis::Info;
QString message;
if ( nCopiedFeatures == 0 )

0 comments on commit 1353bb5

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