Changeset 14886 in josm for trunk/src


Ignore:
Timestamp:
2019-03-15T09:14:57+01:00 (6 years ago)
Author:
GerdP
Message:

fix #17354: Relation list is not always updated

The problem was that RelationListDialog.otherDatasetChange(AbstractDatasetChangedEvent event) did nothing.
The dialog therefore misses events of type PRIMITIVE_FLAGS_CHANGED and if the flags of a relation are changed this should change the list.
When the dialog is build from scratch it looks at the relations with status complete and shows them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r14709 r14886  
    5151import org.openstreetmap.josm.data.osm.Relation;
    5252import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent;
     53import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent.DatasetEventType;
    5354import org.openstreetmap.josm.data.osm.event.DataChangedEvent;
    5455import org.openstreetmap.josm.data.osm.event.DataSetListener;
     
    737738    @Override
    738739    public void otherDatasetChange(AbstractDatasetChangedEvent event) {
    739         /* ignore */
     740        if (event.getType() == DatasetEventType.PRIMITIVE_FLAGS_CHANGED
     741                && event.getPrimitives().stream().anyMatch(Relation.class::isInstance)) {
     742            initFromData(MainApplication.getLayerManager().getActiveData());
     743        }
    740744    }
    741745
Note: See TracChangeset for help on using the changeset viewer.