- Timestamp:
- 2020-11-17T01:15:05+01:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r17238 r17318 298 298 if (!keepSourceComment) { 299 299 tags.put("source", getLastChangesetSourceFromHistory()); 300 tags.put("comment", get LastChangesetCommentFromHistory());300 tags.put("comment", getCommentWithDataSetHashTag(getLastChangesetCommentFromHistory(), dataSet)); 301 301 } 302 302 … … 330 330 if (keepSourceComment) { 331 331 tags.put("source", changesetSourceModel.getComment()); 332 tags.put("comment", changesetCommentModel.getComment());332 tags.put("comment", getCommentWithDataSetHashTag(changesetCommentModel.getComment(), dataSet)); 333 333 } 334 334 … … 336 336 pnlTagSettings.tableChanged(null); 337 337 pnlBasicUploadSettings.discardAllUndoableEdits(); 338 } 339 340 /** 341 * Returns the given comment with appended hashtags from dataset changeset tags, if not already present. 342 * @param comment changeset comment 343 * @param dataSet optional dataset, which can contain hashtags in its changeset tags 344 * @return comment with dataset changesets tags, if any, not duplicated 345 */ 346 private static String getCommentWithDataSetHashTag(String comment, DataSet dataSet) { 347 String result = comment; 348 if (dataSet != null) { 349 String hashtags = dataSet.getChangeSetTags().get("hashtags"); 350 if (hashtags != null) { 351 for (String hashtag : hashtags.split(";")) { 352 String sanitizedHashtag = hashtag.startsWith("#") ? hashtag : "#" + hashtag; 353 if (!result.contains(sanitizedHashtag)) { 354 result = result + " " + sanitizedHashtag; 355 } 356 } 357 } 358 } 359 return result; 338 360 } 339 361 -
trunk/src/org/openstreetmap/josm/gui/tagging/TagModel.java
r16913 r17318 144 144 return values.size(); 145 145 } 146 147 @Override 148 public String toString() { 149 return name + "=" + values; 150 } 146 151 }
Note:
See TracChangeset
for help on using the changeset viewer.