use last used WMS image encoding when adding WMS layers from Browser dock (fix #57666) #60221
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.
Description
When adding a WMS layer from the Data Source Manager one can choose which image encoding to use. The list of available encodings is generated from the server response and image formats supported by the provider. By default the first image encoding reported by the server is used if it is supported by the provider. Otherwise QGIS will try to use encoding defined by setting
qgis/WMSDefaultFormat
if it is present and supported by the provider.On the other hand, when adding a WMS layer via drag-and-drop from Browser dock, it is always added using
image/png
encoding. Both server capabilities andqgis/WMSDefaultFormat
setting are ignored. This happens not only becauseBrowser picks the first image encoding supported by the provider which is also supported by the server, but also because drop handler in the QGIS app class overwrites it with the last used WMS imnage encoding defined by
/qgis/lastWmsImageEncoding
setting.QGIS/src/app/qgisapp.cpp
Lines 5635 to 5636 in ef0dd03
The setting
/qgis/lastWmsImageEncoding
is not updated anywhere in the codebase and theimage/png
is always used.Proposed PR unifies image encoding selection between WMS source select dialog and Browser in a following way:
/qgis/lastWmsImageEncoding
setting with the used image encodingFixes #57666.