Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#18160 closed enhancement (fixed)

[PATCH] Ask layers for source, don't hardcode source for layer types

Reported by: taylor.smock Owned by: Don-vip
Priority: normal Milestone: 19.09
Component: Core Version:
Keywords: upload, source Cc:

Description


Attachments (4)

18160.patch (4.4 KB ) - added by taylor.smock 5 years ago.
Initial patch. Adds getChangesetSourceTag to Layer class and overrides it in GpxLayer, ImageryLayer, and GeoImageLayer.
18160.1.patch (4.8 KB ) - added by taylor.smock 5 years ago.
Use streams to build the set (uses distinct to avoid duplicates)
18160.2.patch (5.0 KB ) - added by taylor.smock 5 years ago.
Add checks for layer visibility
18160.3.patch (4.9 KB ) - added by taylor.smock 5 years ago.
Alternative method to 18160.2.patch for only getting visible layer changeset source comments

Download all attachments as: .zip

Change History (14)

by taylor.smock, 5 years ago

Attachment: 18160.patch added

Initial patch. Adds getChangesetSourceTag to Layer class and overrides it in GpxLayer, ImageryLayer, and GeoImageLayer.

comment:1 by Don-vip, 5 years ago

Milestone: 19.09

by taylor.smock, 5 years ago

Attachment: 18160.1.patch added

Use streams to build the set (uses distinct to avoid duplicates)

comment:2 by Don-vip, 5 years ago

the layer visibility condition is missing in the patch.

by taylor.smock, 5 years ago

Attachment: 18160.2.patch added

Add checks for layer visibility

comment:3 by taylor.smock, 5 years ago

Alternatively, the stream could be changed from layerManager.getLayers().stream() to layerManager.getVisibleLayersInZOrder().stream().

by taylor.smock, 5 years ago

Attachment: 18160.3.patch added

Alternative method to 18160.2.patch for only getting visible layer changeset source comments

comment:4 by Don-vip, 5 years ago

Owner: changed from team to Don-vip
Status: newassigned

Nice!

comment:5 by Don-vip, 5 years ago

Resolution: fixed
Status: assignedclosed

In 15371/josm:

fix #18160 - Ask layers for source, don't hardcode source for layer types (patch by taylor.smock)

comment:6 by Klumbumbus, 5 years ago

Has this any impact on end users?

comment:7 by stoecker, 5 years ago

Not directly ;-)

comment:8 by Don-vip, 5 years ago

No, it's just a much better way of coding this. It will have an impact however if some plugins define a "changeset source tag" for their custom layers. I could probably make use of the feature in the cadastre-fr and opendata plugins.

comment:9 by taylor.smock, 5 years ago

It shouldn't have any direct impact. I actually filed the bug and patch because I wanted to report the source for a data layer for a plugin I'm working on. For that plugin, I should check and see if there is a way to tell if the layer has been uploaded since the plugin data was last used, so I can programmatically return null or the source from the plugin, to more accurately reflect the data usage.

I didn't see one in my quick grep through the source code, and if I can't find one that is being called on upload, I'll probably implement that as well.

comment:10 by Klumbumbus, 5 years ago

Ok, I wasn't sure if something should be added to wiki:/Changelog.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.