Skip to content
Permalink
Browse files

In package layers algorithm save all features when layer has no selec…

…tion and onlySaveSelected is enabled
  • Loading branch information
stefancon authored and nyalldawson committed Feb 19, 2021
1 parent fc3eccd commit d7a72a7a7cebeccc1e3f1971e5ef5f2e9ebf6dcb
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/analysis/processing/qgsalgorithmpackage.cpp
@@ -154,8 +154,9 @@ QVariantMap QgsPackageAlgorithm::processAlgorithm( const QVariantMap &parameters
{
case QgsMapLayerType::VectorLayer:
{
if ( !packageVectorLayer( qobject_cast< QgsVectorLayer * >( layer.get() ), packagePath,
context, &multiStepFeedback, saveStyles, selectedFeaturesOnly ) )
QgsVectorLayer *vectorLayer = qobject_cast<QgsVectorLayer *>( layer.get() );
bool onlySaveSelected = vectorLayer->selectedFeatureCount() > 0 && selectedFeaturesOnly;
if ( !packageVectorLayer( vectorLayer, packagePath, context, &multiStepFeedback, saveStyles, onlySaveSelected ) )
errored = true;
else
outputLayers.append( QStringLiteral( "%1|layername=%2" ).arg( packagePath, layer->name() ) );

0 comments on commit d7a72a7

Please sign in to comment.