Failing to store data on mobile

Miika Turkia miika.turkia at
Mon Oct 29 08:54:22 PDT 2018

On Mon, Oct 29, 2018 at 5:32 PM Dirk Hohndel <dirk at> wrote:

> On Oct 29, 2018, at 8:17 AM, Miika Turkia <miika.turkia at> wrote:
> On Mon, Oct 29, 2018 at 4:34 PM Dirk Hohndel <dirk at> wrote:
>> > On Oct 28, 2018, at 9:40 PM, Miika Turkia <miika.turkia at>
>> wrote:
>> >
>> > I have tried to implement copy-paste functionality for the
>> Subsurface-mobile. The current branch (mobile-copy) seems to be working but
>> when re-opening Subsurface, nothing has been saved. So what is the trick to
>> actually save data when using QML? So far, I have tried to mark the
>> divelist changed and manually save to cloud, and what not, but am I
>> manipulating wrong data or what, as nothing seems to actually save what I
>> have changed?
>> Call QMLManager::changesNeedSaving()
>> The problem is that right now on Android we only save the changes locally
>> and the logic that we had in place to save them to the cloud when the app
>> switches to the background may no longer be working.
>> But at least this function should get them saved to the local git repo
> I am calling that, but still nothing gets saved. Not locally and not on
> cloud.
> That's strange, because that function calls mark_divelist_changed(true) -
> so anything that is in the divelist should be saved to the local repo.
> After you call that function, what is added to your log?
> asked to save changes but no unsaved changes
> or
> save operation in progress already
> would explain why nothing gets saved.
> Otherwise you should get a "Save changes to local cache".
> And then there are a bunch more possible reasons why it wouldn't update
> things - look at the awkwardly named "loadDivesWithValidCredentials()"
> function (which is, in fact, where we save things...)

Log seems like everything gets saved:
INFO: "14.123: Save changes to local cache"
INFO: "14.127: Synchronising data file"
INFO: "14.128: Preparing to save data"
INFO: "14.129: Start saving data"
INFO: "14.130: Start saving dives"
INFO: "14.132: Done creating local cache"

Anyway, it seems to be that Linus' hint of calling invalidate_dive_cache()
did the trick.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the subsurface mailing list