Skip to content

Commit

Permalink
Merge branch 'osmandapp:master' into hardy_Afa
Browse files Browse the repository at this point in the history
  • Loading branch information
sonora authored Apr 14, 2024
2 parents b8fb242 + 7f46ffc commit 0762082
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions OsmAnd/src/net/osmand/plus/track/helpers/GpxDbHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ public GpxDirItem getGpxDirItem(@NonNull File file) {

@Nullable
public GpxDataItem getItem(@NonNull File file, @Nullable GpxDataItemCallback callback) {
if (file.getPath().isEmpty()) {
return null;
}
GpxDataItem item = dataItems.get(file);
if (GpxDbUtils.isAnalyseNeeded(item) && !isGpxReading(file)) {
readGpxItem(file, item, callback);
Expand Down
4 changes: 2 additions & 2 deletions OsmAnd/src/net/osmand/plus/track/helpers/GpxReaderTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ protected Void doInBackground(Void... voids) {
item.setParameter(DATA_VERSION, GpxDbUtils.createDataVersion(ANALYSIS_VERSION));

if (database.getDataItem(file, conn) != null) {
LOG.error(">>>> updateDataItem file=" + file.getAbsolutePath() + " item=" + item.getClass().getSimpleName() + " item.file=" + item.getFile().getAbsolutePath());
gpxDbHelper.updateDataItem(item);
} else {
LOG.error(">>>> insertItem file=" + file.getAbsolutePath() + " item=" + item.getClass().getSimpleName() + " item.file=" + item.getFile().getAbsolutePath());
database.insertItem(item, conn);
}
}
Expand All @@ -113,6 +111,8 @@ protected Void doInBackground(Void... voids) {
}
file = readingItems.poll();
}
} catch (Exception e) {
LOG.error(e.getMessage());
} finally {
conn.close();
}
Expand Down
3 changes: 3 additions & 0 deletions OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,9 @@ private boolean isUse3DTrackVisualization(@NonNull GPXFile gpxFile) {
return false;
} else if (gpxAppearanceHelper.hasTrackDrawInfoForTrack(gpxFile)) {
return gpxAppearanceHelper.getTrackDrawInfo().isUse3DTrackVisualization();
} else if (gpxFile.showCurrentTrack) {
// TODO: add setting for current track
return false;
} else {
GpxDataItem dataItem = gpxDbHelper.getItem(new File(gpxFile.path));
if (dataItem != null) {
Expand Down

0 comments on commit 0762082

Please sign in to comment.