Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12457 closed defect (fixed)

Filter and MapCSS "modified" not updating after uploading changes

Reported by: anonymous Owned by: team
Priority: normal Milestone: 16.04
Component: Core Version: latest
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. Add, enable and reverse filter "modified"
  2. Modify some data
  3. Send changes to server (or upload selected changes)

What is the expected result?

Uploaded data should be inactive.

What happens instead?

Uploaded data is still active. I must disable and enable again filter.

Please provide any additional information below. Attach a screenshot if possible.

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-01-30 01:43:42 +0100 (Sat, 30 Jan 2016)
Build-Date:2016-01-30 02:34:22
Revision:9685
Relative:URL: ^/trunk

Identification: JOSM/1.5 (9685 pl) Linux Ubuntu Xenial Xerus (development branch)
Memory Usage: 819 MB / 869 MB (374 MB allocated, but free)
Java version: 1.8.0_72-internal-b15, Oracle Corporation, OpenJDK 64-Bit Server VM
Dataset consistency test: No problems found

Plugins:
- Mapillary (31976)
- OpeningHoursEditor (31772)
- PicLayer (31895)
- apache-commons (31895)
- apache-http (31895)
- ejml (31895)
- geotools (31895)
- jts (31772)
- measurement (31895)
- opendata (31937)
- reverter (32005)
- tag2link (31910)
- tageditor (31772)
- utilsplugin2 (32018)

Attachments (0)

Change History (9)

comment:1 Changed 4 years ago by Klumbumbus

same problem for the mapcss pseudoclass :modified (e.g. Styles/Modified)

comment:2 Changed 4 years ago by simon04

Summary: Filter "modified" not updating after uploading changesFilter and MapCSS "modified" not updating after uploading changes

comment:3 Changed 4 years ago by simon04

In 9695/josm:

see #12457 - MapCSS "modified" not updating after uploading changes

comment:4 Changed 4 years ago by Klumbumbus

Milestone: 16.02

comment:5 Changed 4 years ago by simon04

For the filter it seems more complicated. The following should fix it, however, it's a hack. Unfortunately, we do not have a DatasetChangedEvent for the flags, and extending the often used interface DataSetListener does not seem a good idea neither.

  • src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    diff --git a/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java b/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
    index b43eed2..3ce217e 100644
    a b public void setModified(boolean modified) { 
    567567        boolean locked = writeLock();
    568568        try {
    569569            super.setModified(modified);
     570            dataSet.fireTagsChanged(this, getKeys());
    570571            clearCachedStyle();
    571572        } finally {
    572573            writeUnlock(locked);
  • src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    diff --git a/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java b/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
    index 187e3c2..f667e4a 100644
    a b public void dataChanged(DataChangedEvent event) { 
    328328
    329329    @Override
    330330    public void nodeMoved(NodeMovedEvent event) {
    331         // Do nothing
     331        filterModel.executeFilters(event.getPrimitives());
    332332    }
    333333
    334334    @Override
  • src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    diff --git a/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java b/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
    index 3ea58fc..1dd3f4b 100644
    a b public void cleanupAfterUpload(final Collection<IPrimitive> processed) { 
    520520
    521521        // if uploaded, clean the modified flags as well
    522522        data.cleanupDeletedPrimitives();
    523         for (OsmPrimitive p: data.allPrimitives()) {
    524             if (processed.contains(p)) {
    525                 p.setModified(false);
     523        data.beginUpdate();
     524        try {
     525            for (OsmPrimitive p : data.allPrimitives()) {
     526                if (processed.contains(p)) {
     527                    p.setModified(false);
     528                }
    526529            }
     530        } finally {
     531            data.endUpdate();
    527532        }
    528533    }
Last edited 4 years ago by simon04 (previous) (diff)

comment:6 in reply to:  5 Changed 4 years ago by bastiK

Replying to simon04:

For the filter it seems more complicated. The following should fix it, however, it's a hack. Unfortunately, we do not have a DatasetChangedEvent for the flags, and extending the often used interface DataSetListener does not seem a good idea neither.

Troublesome, but extending DataSetListener seems to be the correct way.

An alternative would be to bend the definition of otherDatasetChange. It could serve as an umbrella event for all kinds of changes to primitives that are not covered by other event types. You can extend the enum DatasetEventType without breaking the plugins.

comment:7 Changed 4 years ago by Don-vip

Milestone: 16.0216.03

comment:8 Changed 4 years ago by simon04

Resolution: fixed
Status: newclosed

In 9941/josm:

fix #12457 - Filter "modified" not updating after uploading changes

comment:9 Changed 4 years ago by Don-vip

Milestone: 16.0316.04

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.