-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: QT Positioning #285
fix: QT Positioning #285
Conversation
TODO: Add the magic part for updating the config. |
yin_yang/position.py
Outdated
"""Track the position provided by the service.""" | ||
self._lastPosition = position | ||
|
||
# TODO: Here trigger a refresh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you still figuring that out? If so, please mark this PR as a draft
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, just read the comment in the PR.
The location in the config file is never changed automatically, it's always the user-defined value. If the location is automatically determined, we use the functions directly instead of the value in the file. If the detection fails, we use the user-defined value as a fallback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe a good thing would be to update the value in the config too.
At least, that is what I would expect if I select the "auto" option...
However, the choice is yours and if you say "no", then the code is complete and I just need to remove the comment 😉
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. 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? 😄 |
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 :) |
Well, life has been even busier! |
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 oskarsh#274
Remove the TODO and the hackish code for updating the position. Didn't work, plus it is better to have a safe default.
1d8fec9
to
4fb491e
Compare
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