<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 29, 2018, at 8:17 AM, Miika Turkia <<a href="mailto:miika.turkia@gmail.com" class="">miika.turkia@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Oct 29, 2018 at 4:34 PM Dirk Hohndel <<a href="mailto:dirk@hohndel.org" class="">dirk@hohndel.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">
> On Oct 28, 2018, at 9:40 PM, Miika Turkia <<a href="mailto:miika.turkia@gmail.com" target="_blank" class="">miika.turkia@gmail.com</a>> wrote:<br class="">
> <br class="">
> 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?<br class="">
<br class="">
Call QMLManager::changesNeedSaving()<br class="">
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.<br class="">
But at least this function should get them saved to the local git repo<br class=""></blockquote><div class=""><br class=""></div><div class="">I am calling that, but still nothing gets saved. Not locally and not on cloud.<br class=""></div></div></div></div></blockquote><br class=""></div><div>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.</div><div><br class=""></div><div>After you call that function, what is added to your log?</div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">asked to save changes but no unsaved changes</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">or</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">save operation in progress already</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">would explain why nothing gets saved.</span></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Otherwise you should get a "Save changes to local cache".</span></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">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...)</span></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></span></span></div></div><div>/D</div><br class=""></body></html>