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] Fix save vector features to file algorithm's handling of pre-existing files #54367

Merged
merged 2 commits into from
Aug 30, 2023

Conversation

nirvn
Copy link
Contributor

@nirvn nirvn commented Aug 25, 2023

Description

This PR harmonize handling of preexisting files by the save vector features to file algorithm by informing users of default action (file overwrite) and allow to switch to other action/behavior (keep file, overwrite layer, keep file and layer, etc.).

image

Fixes #54333 .

@github-actions github-actions bot added this to the 3.34.0 milestone Aug 25, 2023
@DelazJ
Copy link
Contributor

DelazJ commented Aug 25, 2023

@nirvn the [not selected] entry in the screenshot... is a leftover from previous design? It is not an option, right?

@DelazJ DelazJ added Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Aug 25, 2023
@qgis-bot
Copy link
Collaborator

@nirvn
This pull request has been tagged as requiring documentation.

A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged.

Please update the description (not the comments) with helpful description and screenshot to help the work from documentors.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@qgis-bot
Copy link
Collaborator

@nirvn

This pull request has been tagged for the changelog.

  • The description will be harvested so please provide a "nearly-ready" text for the final changelog
  • If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
  • If you can, it's better to give credits to your sponsor, see below for different formats.

You can edit the description.

Format available for credits
  • Funded by NAME
  • Funded by URL
  • Funded by NAME URL
  • Sponsored by NAME
  • Sponsored by URL
  • Sponsored by NAME URL

Thank you!

}

QVariantMap outputs;
outputs.insert( QStringLiteral( "OUTPUT" ), dest );
outputs.insert( QStringLiteral( "OUTPUT" ), destination );
outputs.insert( QStringLiteral( "FILE_PATH" ), filePath );
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
outputs.insert( QStringLiteral( "FILE_PATH" ), filePath );
outputs.insert( QStringLiteral( "FILE_PATH" ), finalFileName );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nyalldawson , addressed.

@nirvn nirvn force-pushed the save_as_file_fix branch from 780f89e to bbad20b Compare August 29, 2023 03:49
@nirvn
Copy link
Contributor Author

nirvn commented Aug 29, 2023

@DelazJ , it was an "option" until just now. The "[Not selected]" item is automatically added as the first option of an optional enum parameter. That's a hard-coded QGIS processing behavior.

That said, I've just made the enum non-optional after a discussion with Nyall. While we needed the enum parameter to be optional to avoid API breakage, other forthcoming changes in the way QGIS processing handles things will improve things on that front.

@nyalldawson nyalldawson merged commit d8bdb57 into qgis:master Aug 30, 2023
@github-actions
Copy link

@nirvn
A documentation ticket has been opened at qgis/QGIS-Documentation#8486
It is your responsibility to visit this ticket and add as much detail as possible for the documentation team to correctly document this change.
Thank you!

@dlejay
Copy link

dlejay commented Aug 30, 2023

@nirvn Why have you chosen “overwrite file” as default behaviour ?

@nirvn
Copy link
Contributor Author

nirvn commented Aug 30, 2023

@dlejay , to retain previously established behavior as the default one.

@zacharlie zacharlie added ChangelogHarvested This PR description has been harvested in the Changelog already. and removed Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Oct 22, 2023
@agiudiceandrea
Copy link
Contributor

Hi @nirvn, please see #56517.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ChangelogHarvested This PR description has been harvested in the Changelog already. Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save features to files overwrites whole GeoPackage
7 participants