Bug 423807

Summary: KStars is overwriting satellites.dat on the upgrade, killing the user's customization
Product: [Applications] kstars Reporter: Alex Fliker <alex.kdebugzilla>
Component: generalAssignee: Jasem Mutlaq <mutlaqja>
Status: REPORTED ---    
Severity: normal CC: alex.kdebugzilla
Priority: NOR    
Version First Reported In: 3.4.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Alex Fliker 2020-07-02 19:12:48 UTC
Probably a proper approach would be to check on startup if there is file satellites.dat.user and use it instead of the default satellites.dat. So, the idea is that users will copy satellites.dat into satellites.dat.user and modify it to their needs.
Comment 1 Jasem Mutlaq 2020-07-02 19:43:13 UTC
There should be a file for user-added satellites, but this is going to require some work. Do you have any programming experience to help with this?
Comment 2 Alex Fliker 2020-07-02 19:49:50 UTC
Well, there are 2 approaches to this:
1. Reference user-defined file in the satellites.dat. Indeed might be tricky to program it;
2. Make KStars check on the startup the presence of satellites.dat.user file. If present - ignore satellites.dat and load satellites.dat.user instead. Should be rather easy to accomplish.
My personal preference is number 2, as it would allow to remove all the lists I don't need (I know you can disable them from UI, but still).
I am fine with Python and good at Bash, but C/C++ is hard for me, stackoverflow all the way :-D Also, no experience with Qt :-|
Comment 3 Jasem Mutlaq 2020-07-02 20:01:55 UTC
It's always a good time to start. Qt is the most advanced toolkit I've used and highly documented, and quite easy to follow! You can start by creating that file and reading it, and then check the code to see how the default file is loaded and then add a check there (QFile::exists) to see if the .user version exists or not.

Of course, we'd have to let the user know that there is a way to add custom file to begin with as well.
Comment 4 Alex Fliker 2020-07-02 20:11:28 UTC
Well, approach number 2 is just an if clause and that's it (+updating the docs). But where do I start? How to gain the access to repo? I have experience only with GitHub. If you can pinpoint where to start I would be very grateful.
Comment 5 Jasem Mutlaq 2020-07-02 20:17:05 UTC
Good question, check the README here: https://invent.kde.org/education/kstars

It provides instructions for getting started. And if you face any issues, you can send an email to kstars-devel@kde.org or in KStars chat here: https://webchat.kde.org/#/room/#kstars:kde.org
Comment 6 Alex Fliker 2020-07-02 20:22:33 UTC
Thanks, very detailed instructions!