-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 datasources incorrectly resolving to matching working directory names #60109
Conversation
Great to see such care in describing the PR and writing the tests, thank you ! |
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
dac823c
to
8cd3baf
Compare
Hi! I've fixed the bugs identified by the CI, squashed the commits and rebased to the latest master. This passes all the CI worksflows on my cloned repo now, could you please approve the workflows on this PR? |
@vsydorov can you please resolve the conflict so that we can merge this PR? |
- 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
for more information, see https://pre-commit.ci
- 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
8cd3baf
to
5461e78
Compare
@elpaso thanks for reviewing my PR! I've resolved the conflicts. |
@elpaso thanks! I've just noticed that I forgot to squash my commits, is it fine like this or should I merge into a single commit? |
I squashed them for you. |
Description
In short, this addresses the issue outlined here: #60100
absoluteToRelativeUri
inQgsMapLayer::writeLayerXml
which was the cause of the original bugQgsPathResolver::writePath
to prevent this happening again. Now, ifabsoluteToRelativeUri
is called on the relative path, the function will return earlyrelativeToAbsoluteUri
.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 callrelativeToAbsoluteUri
with an absolute path argument and was introduced in the same commit b9c1c2c as the redundant call causing issues above.I think that the PR should be backported to the latest version, as this is an annoying bug for Linux users (#60100, possibly #59282).