cgeo/c-geo-opensource — Issue #1196: finalDefined not correctly stored/initialized
Author: Bananeweizen
Created: 2012-02-27 20:59:31+00:00
State: open

The finalDefined flag is not persisted correctly. To reproduce:
* Store an unmodified cache (without GC edited coordinates) for offline use.
* Add a final waypoint. -> Cache is shown with flag in cache list, everything ok.
* Close and kill c:geo (a simple close is not enough to get rid of the process in memory).
* Restart and open the list containing the cache -> Flag is gone, finalDefined=false.
* Open cache details, go back -> Flag is there, finalDefined=true.

To my understanding the reason is the following:
* The flag is set when a waypoint is added. Therefore it is correct after adding a final waypoint or after loading all waypoints from the database.
* But the flag, which was set on adding a waypoint never gets stored, because the cache itself does not get stored after adding a waypoint. Therefore it is not correct after running a new c:geo instance, where only the cache details without waypoints have been loaded.

A possible solution would be to store the cache after modifying waypoints but that may have other bad side effects (like data usage when caching in the wild).