X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fundo%2FUndoLoad.java;h=d354b9dd8fb7a0e754d86fce62e12e30c1b4dc98;hp=8bf22183c5162c787fa8c7350f602a1da2c5f4df;hb=5625a1abadb5f2ca5f017fe7dbda1d5141cb637b;hpb=23959e65a6a0d581e657b07186d18b7a1ac5afeb diff --git a/tim/prune/undo/UndoLoad.java b/tim/prune/undo/UndoLoad.java index 8bf2218..d354b9d 100644 --- a/tim/prune/undo/UndoLoad.java +++ b/tim/prune/undo/UndoLoad.java @@ -2,6 +2,7 @@ package tim.prune.undo; import tim.prune.I18nManager; import tim.prune.data.DataPoint; +import tim.prune.data.PhotoList; import tim.prune.data.TrackInfo; /** @@ -13,6 +14,7 @@ public class UndoLoad implements UndoOperation private int _numLoaded = -1; private DataPoint[] _contents = null; private String _previousFilename = null; + private PhotoList _photoList = null; /** @@ -33,14 +35,16 @@ public class UndoLoad implements UndoOperation * Constructor for replacing * @param inOldTrack track being replaced * @param inNumLoaded number of points loaded + * @param inPhotoList photo list, if any */ - public UndoLoad(TrackInfo inOldTrackInfo, int inNumLoaded) + public UndoLoad(TrackInfo inOldTrackInfo, int inNumLoaded, PhotoList inPhotoList) { _cropIndex = -1; _numLoaded = inNumLoaded; _contents = inOldTrackInfo.getTrack().cloneContents(); if (inOldTrackInfo.getFileInfo().getNumFiles() == 1) _previousFilename = inOldTrackInfo.getFileInfo().getFilename(); + _photoList = inPhotoList; } @@ -76,6 +80,11 @@ public class UndoLoad implements UndoOperation } else { + // replace photos how they were + if (_photoList != null) + { + inTrackInfo.getPhotoList().restore(_photoList); + } // replace track contents with old if (!inTrackInfo.getTrack().replaceContents(_contents)) {