cgeo/c-geo-opensource — Issue #714: Progress bar shows wrong progress when importing gpx with waypoints
Author: stephanme
Created: 2011-10-25 21:59:17+00:00
State: open

When a gpx file from a pocket query is imported that has a waypoints file attached, the progress bar shows correct progress for importing the cache file, wrong progress for the waypoints file and no progress for storing the caches in DB.

Reason is that the progress bar is initialized once with the size of the cache file in cgeogpxes but not updated later for the import of the waypoints file or when storing the caches. Control is handed over to GPXParser that doesn't know about the progress bar.

My proposal is to put control over file handling and storing of caches into cgeogpxes and remove it from GPXParser.
GPXParser gets rid of all the static methods and provides only: Collection parse(InputStream, Handler)
Simple API, nicely testable. Ok, LocParser would need some more rework.

This refactoring would also make it easier to add support for importing pocket query zips directly.

What do you think?