Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[processing] native save selected features algorithm #5204

Merged
merged 2 commits into from
Sep 16, 2017

Conversation

nirvn
Copy link
Contributor

@nirvn nirvn commented Sep 15, 2017

Description

The collateral "damage" of an experiment: native save selected features algorithm.

@nyalldawson , all good?

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and containt sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit

@nyalldawson
Copy link
Collaborator

Code looks good!

I'm wondering about this behaviour though "If the selected layer has no selected features, all features will be added to the resulting feature". I realise the old alg does that too, but is it really what we want here? Doesn't this behaviour potentially make model behaviour random? (e.g. if a model does a 'select by expression' and nothing matches, then it saves the result and gets everything output)

QString QgsSaveSelectedFeatures::shortHelpString() const
{
return QObject::tr( "This algorithm creates a new layer with all the selected features in a given vector layer.\n\n"
"If the selected layer has no selected features, all features will be added to the resulting feature." );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • If the selected input(?) layer (just to avoid too much selection in the sentence)
  • added to the resulting feature layer

@nyalldawson
Copy link
Collaborator

Good move

selected features algorithm if no features are selected
@nirvn nirvn merged commit 01468d0 into qgis:master Sep 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants