Bugfix/hide private layers from dropdown#4600
Open
xkello wants to merge 2 commits into
Open
Conversation
📦 Build Artifacts Ready
|
1 similar comment
📦 Build Artifacts Ready
|
Withalion
reviewed
Jul 17, 2026
| if ( layer->readOnly() ) | ||
| return false; | ||
|
|
||
| if ( layer ) |
Collaborator
There was a problem hiding this comment.
this condition is always true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Layers set to private in QGIS were still visible in the add feature layer dropdown, which was inconsistent with the Layers tab, where private layers are correctly hidden.
Fixes: #4486
Problem
Users could still record new features on layers marked as private. This caused issues for admins who wanted to restrict users to adding features only as children of parent features, since the private-layer restriction was effectively bypassed in the recording flow.
What changed
recordinglayersproxymodel-bool isPrivate = layer->flags() & QgsMapLayer::LayerFlag::Private- for each layer. The app now checks whether a layer is private and excludes it from the dropdown if so.activeproject'srecordingAllowed. Even though the dropdown itself was filtering correctly, the app still fetched all layers on init - meaning a private layer could still be auto-selected as the active layer if it was the only layer present, or if it happened to be first in the layer list.Behaviour
On startup, the app now filters out private layers when iterating through available layers. When the add button is tapped, private layers no longer appear in the dropdown, matching the behavior of the Layers tab. If no eligible layers remain after filtering, the app shows the existing "No editable layers found" message.