X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fdata%2FTrackInfo.java;h=f8e3c844b8ac86bc46c7c45bf8b78c7bc976f88e;hp=b987ea9449d6dff66fd52f2af60031752f415413;hb=da0b1f449260a0b4a94318006382a9039726ef3e;hpb=5625a1abadb5f2ca5f017fe7dbda1d5141cb637b diff --git a/tim/prune/data/TrackInfo.java b/tim/prune/data/TrackInfo.java index b987ea9..f8e3c84 100644 --- a/tim/prune/data/TrackInfo.java +++ b/tim/prune/data/TrackInfo.java @@ -1,7 +1,7 @@ package tim.prune.data; -import java.util.List; - +import java.util.Iterator; +import java.util.Set; import tim.prune.UpdateMessageBroker; /** @@ -100,23 +100,24 @@ public class TrackInfo /** - * Add a List of Photos - * @param inList List containing Photo objects + * Add a Set of Photos + * @param inSet Set containing Photo objects * @return array containing number of photos and number of points added */ - public int[] addPhotos(List inList) + public int[] addPhotos(Set inSet) { - // TODO: Should photos be sorted at load-time, either by filename or date? // Firstly count number of points and photos to add int numPhotosToAdd = 0; int numPointsToAdd = 0; - if (inList != null && !inList.isEmpty()) + Iterator iterator = null; + if (inSet != null && !inSet.isEmpty()) { - for (int i=0; i 0) + if (numDeleted > 0) { _selection.clearAll(); + _broker.informSubscribers(); + } return numDeleted; } @@ -261,8 +265,10 @@ public class TrackInfo public int deleteDuplicates() { int numDeleted = _track.deleteDuplicates(); - if (numDeleted > 0) + if (numDeleted > 0) { _selection.clearAll(); + _broker.informSubscribers(); + } return numDeleted; }