Yin-Yang icon indicating copy to clipboard operation
Yin-Yang copied to clipboard

fix: QT Positioning

Open ItachiSan opened this issue 10 months ago • 6 comments

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

ItachiSan avatar Apr 02 '24 16:04 ItachiSan

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:

ItachiSan avatar Apr 02 '24 16:04 ItachiSan

I think updating the config automatically is the best approach here.

oskarsh avatar Apr 03 '24 05:04 oskarsh

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.

l0drex avatar Apr 03 '24 10:04 l0drex

What should I do then? :smile:

ItachiSan avatar Apr 05 '24 14:04 ItachiSan

Go with the recommendation of @l0drex then. He is more in the topic and it defintely makes sense.

oskarsh avatar Apr 09 '24 13:04 oskarsh

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:

ItachiSan avatar May 22 '24 13:05 ItachiSan

Well, life has been even busier! Will push the code in a few minutes. :wink:

ItachiSan avatar Jun 03 '24 19:06 ItachiSan