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] handle Processing.TEMPORARY_OUTPUT for folder parameters #8998

Merged
merged 3 commits into from Jan 29, 2019
Merged

[processing] handle Processing.TEMPORARY_OUTPUT for folder parameters #8998

merged 3 commits into from Jan 29, 2019

Conversation

alexbruy
Copy link
Contributor

@alexbruy alexbruy commented Jan 27, 2019

Description

Follow up #8979. Seems we missed that QgsProcessingParameterFolderDestination also needs to handle temporaty outputs.

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 contain 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

@alexbruy
Copy link
Contributor Author

@nyalldawson not sure that this is the best solution, probably we need to introduce special method for directory outputs, like we already have for files.

Copy link
Collaborator

@nyalldawson nyalldawson left a comment

Choose a reason for hiding this comment

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

Looks good, can we get a unit test covering this?

@nyalldawson nyalldawson added this to the 3.6.0 milestone Jan 29, 2019
@nyalldawson nyalldawson added the Requires Tests! Waiting on the submitter to add unit tests before eligible for merging label Jan 29, 2019
parameterAsString() method which is used also for folder outputs
@alexbruy
Copy link
Contributor Author

@nyalldawson on the second though, we can use parameterAsFileOutput() for directories to retrieve path. So looks like this fix is not really necessary, we just need to fix few algorithms by replacing parameterAsString() with parameterAsFileOutput() where needed.

I tend to close this and use parameterAsFileOutput() to get directory path.

@nyalldawson
Copy link
Collaborator

@alexbruy I think we need this PR and it's safer to continue here -- there's potentially external plugins using parameterAsString for this which would have broken with the change.

@@ -695,7 +701,7 @@ QString QgsProcessingParameters::parameterAsFileOutput( const QgsProcessingParam
if ( dest == QgsProcessing::TEMPORARY_OUTPUT )
{
if ( const QgsProcessingDestinationParameter *destParam = dynamic_cast< const QgsProcessingDestinationParameter * >( definition ) )
val = destParam->generateTemporaryDestination();
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 not 100% sure, but seems there is a typo here and temporary file was never resolved to the correct path. Fixed it too, when adding test for temporary directory output.

@alexbruy
Copy link
Contributor Author

Test added. Also seems we missed a typo in the #8979, so fixed it too.

@nyalldawson
Copy link
Collaborator

Thanks!

@alexbruy alexbruy removed the Requires Tests! Waiting on the submitter to add unit tests before eligible for merging label Jan 29, 2019
@alexbruy alexbruy merged commit b57c0fa into qgis:master Jan 29, 2019
@alexbruy alexbruy deleted the processing-tempdir branch January 29, 2019 13:27
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

2 participants