Modify

Opened 8 weeks ago

Closed 7 weeks ago

Last modified 7 weeks 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 8 weeks 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 8 weeks ago.
Use streams to build the set (uses distinct to avoid duplicates)
18160.2.patch (5.0 KB) - added by taylor.smock 8 weeks ago.
Add checks for layer visibility
18160.3.patch (4.9 KB) - added by taylor.smock 8 weeks ago.
Alternative method to 18160.2.patch for only getting visible layer changeset source comments

Download all attachments as: .zip

Change History (14)

Changed 8 weeks ago by taylor.smock

Attachment: 18160.patch added

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

comment:1 Changed 8 weeks ago by Don-vip

Milestone: 19.09

Changed 8 weeks ago by taylor.smock

Attachment: 18160.1.patch added

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

comment:2 Changed 8 weeks ago by Don-vip

the layer visibility condition is missing in the patch.

Changed 8 weeks ago by taylor.smock

Attachment: 18160.2.patch added

Add checks for layer visibility

comment:3 Changed 8 weeks ago by taylor.smock

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

Changed 8 weeks ago by taylor.smock

Attachment: 18160.3.patch added

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

comment:4 Changed 7 weeks ago by Don-vip

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

Nice!

comment:5 Changed 7 weeks ago by Don-vip

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 Changed 7 weeks ago by Klumbumbus

Has this any impact on end users?

comment:7 Changed 7 weeks ago by stoecker

Not directly ;-)

comment:8 Changed 7 weeks ago by Don-vip

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 Changed 7 weeks ago by taylor.smock

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 Changed 7 weeks ago by Klumbumbus

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.