fix comments on 8ff13c62c55e

This commit is contained in:
Jimmy Shih
2011-11-07 09:45:23 -08:00
parent fbd7f1b2b0
commit fde0a4ade1
@@ -55,7 +55,7 @@ public class ImportAllTracks {
private final Activity activity; private final Activity activity;
private FileUtils fileUtils; private FileUtils fileUtils;
private boolean displayTrack; private boolean singleTrackSelected;
private String gpxPath; private String gpxPath;
private WakeLock wakeLock; private WakeLock wakeLock;
private ProgressDialog progress; private ProgressDialog progress;
@@ -79,7 +79,7 @@ public class ImportAllTracks {
Log.i(Constants.TAG, "ImportAllTracks: Starting"); Log.i(Constants.TAG, "ImportAllTracks: Starting");
this.activity = activity; this.activity = activity;
fileUtils = new FileUtils(); fileUtils = new FileUtils();
displayTrack = path != null; singleTrackSelected = path != null;
gpxPath = path == null ? fileUtils.buildExternalDirectoryPath("gpx") : path; gpxPath = path == null ? fileUtils.buildExternalDirectoryPath("gpx") : path;
new Thread(runner).start(); new Thread(runner).start();
} }
@@ -134,7 +134,7 @@ public class ImportAllTracks {
builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
if (displayTrack) { if (singleTrackSelected) {
long lastTrackId = importedTrackIds[importedTrackIds.length - 1]; long lastTrackId = importedTrackIds[importedTrackIds.length - 1];
Uri trackUri = ContentUris.withAppendedId(TracksColumns.CONTENT_URI, lastTrackId); Uri trackUri = ContentUris.withAppendedId(TracksColumns.CONTENT_URI, lastTrackId);
@@ -236,14 +236,14 @@ public class ImportAllTracks {
} }
/** /**
* Gets a list of the GPX files. If displayTrack is true, returns a list * Gets a list of the GPX files. If singleTrackSelected is true, returns a
* containing just the gpxPath file. If displayTrack is false, returns a list * list containing just the gpxPath file. If singleTrackSelected is false,
* of GPX files under the gpxPath directory. * returns a list of GPX files under the gpxPath directory.
*/ */
private List<File> getGpxFiles() { private List<File> getGpxFiles() {
List<File> gpxFiles = new LinkedList<File>(); List<File> gpxFiles = new LinkedList<File>();
File file = new File(gpxPath); File file = new File(gpxPath);
if (displayTrack) { if (singleTrackSelected) {
gpxFiles.add(file); gpxFiles.add(file);
} else { } else {
File[] gpxFileCandidates = file.listFiles(); File[] gpxFileCandidates = file.listFiles();