fixed saving of gpx tracks (my stupid mistake...)

This commit is contained in:
Pavol Zibrita 2011-10-11 23:43:55 +02:00
parent 470ee5b29a
commit 234e909176

View file

@ -136,15 +136,15 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
collectDBTracks(db, data); collectDBTracks(db, data);
// save file // save file
for (String f : data.keySet()) { for (final String f : data.keySet()) {
File fout = new File(dir, f + ".gpx"); //$NON-NLS-1$ File fout = new File(dir, f + ".gpx"); //$NON-NLS-1$
if (fout.exists() && !data.get(f).isEmpty()) { if (fout.exists() && !data.get(f).isEmpty()) {
f = f + "_" + new SimpleDateFormat("HH-mm.EEEE").format(new Date(data.get(f).findPointToShow().time)); //$NON-NLS-1$ String fileName = f + "_" + new SimpleDateFormat("HH-mm-ss_EEEE").format(new Date(data.get(f).findPointToShow().time)); //$NON-NLS-1$
fout = new File(dir, f + ".gpx"); //$NON-NLS-1$ fout = new File(dir, fileName + ".gpx"); //$NON-NLS-1$
int ind = 1; int ind = 1;
while (fout.exists()) { while (fout.exists()) {
fout = new File(dir, f + "_" + (++ind) + ".gpx"); //$NON-NLS-1$ //$NON-NLS-2$ fout = new File(dir, fileName + "_" + (++ind) + ".gpx"); //$NON-NLS-1$ //$NON-NLS-2$
} }
} }