mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
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).