#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?
- Add, enable and reverse filter "modified"
- Modify some data
- 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 by , 9 years ago
comment:2 by , 9 years ago
Summary: | Filter "modified" not updating after uploading changes → Filter and MapCSS "modified" not updating after uploading changes |
---|
comment:4 by , 9 years ago
Milestone: | → 16.02 |
---|
follow-up: 6 comment:5 by , 9 years ago
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) { 567 567 boolean locked = writeLock(); 568 568 try { 569 569 super.setModified(modified); 570 dataSet.fireTagsChanged(this, getKeys()); 570 571 clearCachedStyle(); 571 572 } finally { 572 573 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) { 328 328 329 329 @Override 330 330 public void nodeMoved(NodeMovedEvent event) { 331 // Do nothing331 filterModel.executeFilters(event.getPrimitives()); 332 332 } 333 333 334 334 @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) { 520 520 521 521 // if uploaded, clean the modified flags as well 522 522 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 } 526 529 } 530 } finally { 531 data.endUpdate(); 527 532 } 528 533 }
comment:6 by , 9 years ago
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 interfaceDataSetListener
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 by , 9 years ago
Milestone: | 16.02 → 16.03 |
---|
same problem for the mapcss pseudoclass
:modified
(e.g. Styles/Modified)