[gui][processing] Fix inconsistent behavior with the map layer widget's selected features only checkbox #60197
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
This PR fixes #60108 whereas the processing map layer parameter widget's [x] selected features only checkbox was behaving inconsistently and would sporadically fail to reflect the selection state of the active layer assigned to the map layer combobox when opening an alg. dialog.
There are two fixes in there:
Now, there's still an issue with the map layer combobox whereas the combobox will emit a layerChanged( nullptr ) when a model's project has changed and is removing all of its layers, whereas it won't re-emit a signal when the model has reloaded since we are adding more than one row and the rowsChanged count will be greater than 0.
The problematic logic is here: https://github.com/qgis/QGIS/blob/master/src/gui/qgsmaplayercombobox.cpp#L156-L167
Since the two patches above fix processing's algorithm dialog, I'm inclined not to touch the map layer combobox logic as it's used in a lot of other places.