Closed ItachiSan closed 5 months ago
TODO: Add the magic part for updating the config. From my debugging, the configuration reads the value but we cannot set it. Need input from @oskarsh on how he wants to approach this :smile:
I think updating the config automatically is the best approach here.
If we update the config, then the user-defined values will be overwritten. If the position detection fails, the coordinates might be nonsense (f.e. 0, 0
). As we don't know if the user is at 0, 0
or the detection failed, I would prefer if we don't update the config values. Especially since the config values act as a fallback.
Also, the detected position might be inaccurate: If the device has no GPS, then the position is guessed via the IP-address, which in my case is a few hundreds kilometers away. When switching back to the manual position, I expect to see my previously-defined manual position in the UI.
We could add a detected-position entry to the file and use that as a cache, but I don't think that is particularly useful - the position is read two times per day automatically and every time the UI is opened, which shouldn't be that often.
What should I do then? :smile:
Go with the recommendation of @l0drex then. He is more in the topic and it defintely makes sense.
Hi everyone, sorry for the silence. Was busy with life and stuff :) It seems to me that no config update is the way, so that we can keep the user defined value safely. I will thus remove the comments, making the PR ready :wink:
Well, life has been even busier! Will push the code in a few minutes. :wink:
Rather than manually fetching the position, have our background object receive the various updates of the location and magically update the config.
This is because QT needs its loop running in order to have the location working.
Fixes #274