Martin Dobias 289f47690d
Refactor QgsMapLayer's encodedSource()/decodedSource() (#51901)
Conversion between relative and absolute paths when reading/writing project files
has been inconveniently done in subclasses of QgsMapLayer in encodedSource() and
decodedSource() methods, with a lot of provider specific code.

This is a refactoring to finally fix this - there is a new pair of functions added
to QgsProviderMetadata and QgsProviderRegistry:
- absoluteToRelativeUri()
- relativeToAbsoluteUri()

This new pair of functions delegates the actual conversion between absolute and
relative path to provider code - where it belongs.

The existing code from encodedSource() and decodedSource() functions has been moved
to providers. Unit tests were added to confirm the existing behavior.

There should be no change of behavior apart from removal of old compatibility code
for WMS provider for projects from QGIS < 1.9 (10 years ago).
2023-02-22 17:53:44 +10:00
..