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

Fix layer paths resolving to matching CWD names #60109

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vsydorov
Copy link

@vsydorov vsydorov commented Jan 10, 2025

Description

In short, this addresses the issue outlined here: #60100

  • Remove redundant second call to absoluteToRelativeUri in QgsMapLayer::writeLayerXml which was the cause of the original bug
  • Add a guard in QgsPathResolver::writePath to prevent this happening again. Now, if absoluteToRelativeUri is called on the relative path, the function will return early
  • Remove redundant second call to relativeToAbsoluteUri. QgsPathResolver::readPath already contains a guard that returns early when absolute path is supplied. Still, makes sense to remove the call, as it tries to call relativeToAbsoluteUri with an absolute path argument and was introduced in the same commit b9c1c2c as the redundant call causing issues above.
  • Add a regression test, replicating the scenario outlined in the issue.

I think that the PR should be backported to the latest version, as this is an annoying bug for Linux users (#60100, possibly #59282).

- Remove redundant second call to absoluteToRelativeUri in QgsMapLayer::writeLayerXml
- Add a guard in QgsPathResolver::writePath to prevent this
  happening again when absoluteToRelativeUri is called two times.
- Add a regression test
@github-actions github-actions bot added this to the 3.42.0 milestone Jan 10, 2025
pre-commit-ci bot and others added 2 commits January 10, 2025 13:15
- The b9c1c2c commit introduced redundant absoluteToRelativeUri AND
  relativeToAbsoluteUri calls. First one was removed earlier, stopping
  the qgis#60100 issue. Remove the latter for completeness too.
- Minor indentation fix
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.

1 participant