From 988e3cf0c022a9b378140e768efc44a0ed912f58 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 14 Jan 2018 17:12:43 +0200 Subject: [PATCH 1/2] Fix #4897 --- OsmAnd-java/src/net/osmand/data/City.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd-java/src/net/osmand/data/City.java b/OsmAnd-java/src/net/osmand/data/City.java index f27d7fc5e0..264fc455b6 100644 --- a/OsmAnd-java/src/net/osmand/data/City.java +++ b/OsmAnd-java/src/net/osmand/data/City.java @@ -10,7 +10,7 @@ public class City extends MapObject { public enum CityType { // that's tricky way to play with that numbers (to avoid including suburbs in city & vice verse) // district special type and it is not registered as a city - CITY(10000), TOWN(5000), VILLAGE(1300), HAMLET(1000), SUBURB(400), DISTRICT(400), NEIGHBOURHOOD(300); + CITY(10000), TOWN(4000), VILLAGE(1300), HAMLET(1000), SUBURB(400), DISTRICT(400), NEIGHBOURHOOD(300); private double radius; From de4d6979452d1947f3f69a8dda7f7bb5c26d5c64 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 14 Jan 2018 19:14:50 +0200 Subject: [PATCH 2/2] Fix #4895 --- .../net/osmand/plus/activities/SavingTrackHelper.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java b/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java index d874cf108f..ce1f6355ee 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java +++ b/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java @@ -200,25 +200,23 @@ public class SavingTrackHelper extends SQLiteOpenHelper { File fout = new File(dir, f + ".gpx"); //$NON-NLS-1$ if (!data.get(f).isEmpty()) { WptPt pt = data.get(f).findPointToShow(); - + File targetDir = dir; if (ctx.getSettings().STORE_TRACKS_IN_MONTHLY_DIRECTORIES.get()) { SimpleDateFormat dateDirFormat = new SimpleDateFormat("yyyy-MM"); dateDirFormat.setTimeZone(TimeZone.getTimeZone("UTC")); String dateDirName = dateDirFormat.format(new Date(pt.time)); - File dateDir = new File(dir, dateDirName); dateDir.mkdirs(); - if (dateDir.exists()) { - dir = dateDir; + targetDir = dateDir; } } String fileName = f + "_" + new SimpleDateFormat("HH-mm_EEE", Locale.US).format(new Date(pt.time)); //$NON-NLS-1$ - fout = new File(dir, fileName + ".gpx"); //$NON-NLS-1$ + fout = new File(targetDir, fileName + ".gpx"); //$NON-NLS-1$ int ind = 1; while (fout.exists()) { - fout = new File(dir, fileName + "_" + (++ind) + ".gpx"); //$NON-NLS-1$ //$NON-NLS-2$ + fout = new File(targetDir, fileName + "_" + (++ind) + ".gpx"); //$NON-NLS-1$ //$NON-NLS-2$ } }