Use QGIS' utility function to detect and copy sidecar files #90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes opengisch/QField#5451 .
Background: until now, libqfieldsync had a limited self-curated detection/handling of sidecar files. The PR retires that code in favor of QGIS'
QgsFileUtils.sidecarFilesForPath(path)
, which does a much better job at returning sidecar files and is future proof (as it relies on individual providers to return sidecar lists, see https://github.com/qgis/QGIS/blob/master/src/core/qgsfileutils.cpp#L457-L475).Practically speaking, not capturing all sidecar files meant that projects both packaged for USB cable transfer as well as cloud projects could have key files missing and break layers (see above-mentioned issue).