I realized one thing that will help the issue we were discussing yesterday…

Authored by lancaster on Apr 15 2018, 6:43 AM.

Description

I realized one thing that will help the issue we were discussing yesterday about files being copied into Application Support. So my current solution was to recursively copy whole directories if they don’t exist and not copy anything if they do exist. This did not work if files got added into the kstars, locale, notifications, or sounds directories in a later version of kstars because the user had kstars installed before, so that means the directories already existed and the new files wouldn’t get copied.

But, I realized that the algorithm I was using to recursively copy the file directories could be modified ever so slightly and it would then recursively go over the directories and TRY to copy the files even if they do already exist. The QFile copy method does not overwrite files by default, so if it attempts to copy the file and there is already one there, nothing will happen to it. Thus the user’s edits will be preserved and new files that are added in kstars in later versions will be added to Application Support on startup.

This will still not solve files getting changed or improved in later versions of Kstars, but at least it would solve the issue of missing files.

Details