| | 228 | // This comes before the other changeset tags, so that they can be overridden |
| | 229 | if (args.containsKey("changeset_tags")) { |
| | 230 | MainApplication.worker.submit(() -> { |
| | 231 | DataSet ds = MainApplication.getLayerManager().getEditDataSet(); |
| | 232 | if (ds != null) { |
| | 233 | // This logic is (largely) stolen from the AddTagsDialog. |
| | 234 | args.get("changeset_tags"); |
| | 235 | Set<String> tagSet = new LinkedHashSet<>(); |
| | 236 | for (String tag : args.get("changeset_tags").split("\\|")) { |
| | 237 | if (!tag.trim().isEmpty() && tag.contains("=")) { |
| | 238 | tagSet.add(tag.trim()); |
| | 239 | } |
| | 240 | } |
| | 241 | if (!tagSet.isEmpty()) { |
| | 242 | for (String tag : tagSet) { |
| | 243 | // support a = b===c as "a"="b===c" |
| | 244 | String[] pair = tag.split("\\s*=\\s*", 2); |
| | 245 | ds.addChangeSetTag(pair[0], pair.length < 2 ? "" : pair[1]); |
| | 246 | } |
| | 247 | } |
| | 248 | } |
| | 249 | }); |
| | 250 | } |
| | 251 | |