Skip to content

#14558 3D filters: Reconnect filter signals after project load - #14610

Open
magnesj wants to merge 1 commit into
OPM:devfrom
magnesj:filter-tree-refresh-14558
Open

#14558 3D filters: Reconnect filter signals after project load#14610
magnesj wants to merge 1 commit into
OPM:devfrom
magnesj:filter-tree-refresh-14558

Conversation

@magnesj

@magnesj magnesj commented Aug 25, 2026

Copy link
Copy Markdown
Member

Fixes #14558

Problem

After saving a project, closing it and loading it again, creating a cell filter (e.g. an I slice filter) does not update the project tree. The Filters node stays empty until the filter collection is toggled on/off, after which the new filter shows up.

Root cause

RimFilterInViewCollection holds the three filter collections in caf::PdmPtrFields and refreshes its tree node when they emit filtersChanged / wrappersChanged. The connections are established once, from RimEclipseView's constructor, via setSourceCollections().

Fix

Reconnect the source signals in RimFilterInViewCollection::initAfterRead(), which runs after resolveReferencesRecursively() during project load. This is the same pattern already used by RimDataFilterInViewCollection::initAfterRead(). Cell filters, Eclipse property filters and per-view data filter wrappers are all covered.

Tests

Added RimFilterInViewCollection-Test.cpp, verifying that the facade observes all three source collections both in a new view and after an XML write/read/resolve round trip. The round trip test fails without the fix.

Reading a caf::PdmPtrField sets the pointer to null before the reference string is resolved, and clearing a ptr field disconnects all signals between the referenced object and the field owner. The signal connections established by RimFilterInViewCollection::setSourceCollections() in the view constructor were therefore lost when a project was loaded, and adding a cell filter, property filter or data filter no longer refreshed the Filters node in the project tree. Reconnect in initAfterRead, which runs after the references have been resolved.
@magnesj
magnesj requested a review from jonjenssen August 26, 2026 05:34
@magnesj magnesj self-assigned this Aug 26, 2026
/// setSourceCollections() in the view constructor are therefore lost when a project is loaded.
/// Reconnect here, after the references have been resolved, so the tree keeps refreshing when a
/// filter is added.
//--------------------------------------------------------------------------------------------------

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3D filters: missing refresh after filter is created

2 participants