Changeset 18443 in josm for trunk/src/org
- Timestamp:
- 2022-05-10T18:42:34+02:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/upload/UploadNotesTask.java
r16438 r18443 5 5 6 6 import java.io.IOException; 7 import java.util.Collection; 7 8 import java.util.HashMap; 8 9 import java.util.Map; 10 import java.util.Optional; 9 11 import java.util.stream.Collectors; 10 12 … … 64 66 @Override 65 67 protected void realRun() throws SAXException, IOException, OsmTransferException { 66 ProgressMonitor monitor = progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false);67 68 OsmApi api = OsmApi.getOsmApi(); 68 for (Note note : noteData.getNotes()) { 69 final Collection<Note> modifiedNotes = noteData.getNotes().stream() 70 .filter(note -> Optional.ofNullable(note.getLastComment()).map(NoteComment::isNew).orElse(false)) 71 .collect(Collectors.toList()); 72 getProgressMonitor().setTicksCount(modifiedNotes.size()); 73 for (Note note : modifiedNotes) { 74 getProgressMonitor().setCustomText(tr("Uploading notes {0}/{1}", getProgressMonitor().getTicks(), 75 getProgressMonitor().getTicksCount())); 69 76 if (isCanceled) { 70 77 Logging.info("Note upload interrupted by user"); … … 74 81 if (comment.isNew()) { 75 82 Logging.debug("found note change to upload"); 76 processNoteComment( monitor, api, note, comment);83 processNoteComment(getProgressMonitor(), api, note, comment); 77 84 } 78 85 } 86 getProgressMonitor().worked(1); 79 87 } 80 88 }
Note:
See TracChangeset
for help on using the changeset viewer.