Ignore:
Timestamp:
2017-11-11T02:03:41+01:00 (16 months ago)
Author:
Don-vip
Message:

fix #15537 - Support changeset hashtags (hashtags changeset tag, extracted from comment at upload, or set by remote control through new changeset_hashtags parameter)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r12846 r13109  
    66import java.awt.geom.Area;
    77import java.awt.geom.Rectangle2D;
     8import java.util.Arrays;
    89import java.util.Collection;
    910import java.util.Collections;
     
    7778    @Override
    7879    public String[] getOptionalParams() {
    79         return new String[] {"new_layer", "layer_name", "addtags", "select", "zoom_mode", "changeset_comment", "changeset_source", "search"};
     80        return new String[] {"new_layer", "layer_name", "addtags", "select", "zoom_mode",
     81                "changeset_comment", "changeset_source", "changeset_hashtags", "search"};
    8082    }
    8183
     
    213215
    214216        // add changeset tags after download if necessary
    215         if (args.containsKey("changeset_comment") || args.containsKey("changeset_source")) {
     217        if (args.containsKey("changeset_comment") || args.containsKey("changeset_source") || args.containsKey("changeset_hashtags")) {
    216218            MainApplication.worker.submit(() -> {
    217                 if (MainApplication.getLayerManager().getEditDataSet() != null) {
    218                     if (args.containsKey("changeset_comment")) {
    219                         MainApplication.getLayerManager().getEditDataSet().addChangeSetTag("comment", args.get("changeset_comment"));
    220                     }
    221                     if (args.containsKey("changeset_source")) {
    222                         MainApplication.getLayerManager().getEditDataSet().addChangeSetTag("source", args.get("changeset_source"));
     219                DataSet ds = MainApplication.getLayerManager().getEditDataSet();
     220                if (ds != null) {
     221                    for (String tag : Arrays.asList("changeset_comment", "changeset_source", "changeset_hashtags")) {
     222                        if (args.containsKey(tag)) {
     223                            ds.addChangeSetTag(tag.substring("changeset_".length()), args.get(tag));
     224                        }
    223225                    }
    224226                }
Note: See TracChangeset for help on using the changeset viewer.