Skip to content

Commit

Permalink
Fix #333: Change exported GPX filenames to 'YYYY-MM-DD_hh-mm-ss_OSMTr…
Browse files Browse the repository at this point in the history
…acker.gpx'
  • Loading branch information
Kevin-Salazar-itcr committed Dec 9, 2024
1 parent 140538a commit 9488714
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.database.Cursor;
import android.util.Log;

import net.osmtracker.db.DataHelper;
import net.osmtracker.exception.ExportTrackException;

import java.io.File;
Expand All @@ -25,9 +26,10 @@ public abstract class ExportToTempFileTask extends ExportTrackTask {
public ExportToTempFileTask(Context context, long trackId) {
super(context, trackId);
try {
tmpFile = File.createTempFile("osm-upload", ".gpx", context.getCacheDir());
tmpFile = new File(context.getCacheDir(), new DataHelper(context).getTrackById(trackId).getName()+"_OSMTracker.gpx");
Log.d(TAG, "Temporary file: " + tmpFile.getAbsolutePath());
} catch (IOException ioe) {

} catch (Exception ioe) {
Log.e(TAG, "Could not create temporary file", ioe);
throw new IllegalStateException("Could not create temporary file", ioe);
}
Expand Down

0 comments on commit 9488714

Please sign in to comment.