FC 0.19 ... How can I prevent the automatic save to (change of) user.cfg?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
lutz_dd
Posts: 92
Joined: Thu Jul 31, 2014 5:10 am

FC 0.19 ... How can I prevent the automatic save to (change of) user.cfg?

Post by lutz_dd »

How can I prevent the automatic save to (change of) the file user.cfg?

---

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18760 (Git)
Build type: Release
Branch: master
Hash: ef73ab5f3a330d3c44138f23290f8c9f7a334caf
Python version: 3.7.3
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: FC 0.19 ... How can I prevent the automatic save to (change of) user.cfg?

Post by openBrain »

Run FC inside a script that saves user.cfg before launching and restores it at closing ?
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FC 0.19 ... How can I prevent the automatic save to (change of) user.cfg?

Post by Kunda1 »

This is an interesting topic. An aside, several months back I was wondering about this in a different way which was: when does FC save changes to user.cfg ? I used Meld diff tool to monitor this. I backed up the user.cfg and then opened both original and backup in Meld, then I started FreeCAD. The non-technical answer (i didn't search the code to see where but through pure observation and trial and error) is when the user either opens the Preferences - changes something and accepts the changes AND/OR when the program quits. The latter will save any changes made during the usage of FreeCAD that were either novel (like downloading a new workbench) to trivial. Right before the program exits these changes are written to the user.cfg
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: FC 0.19 ... How can I prevent the automatic save to (change of) user.cfg?

Post by openBrain »

Kunda1 wrote: Thu Jan 02, 2020 2:09 pm The non-technical answer (i didn't search the code to see where but through pure observation and trial and error) is when the user either opens the Preferences - changes something and accepts the changes AND/OR when the program quits. The latter will save any changes made during the usage of FreeCAD that were either novel (like downloading a new workbench) to trivial. Right before the program exits these changes are written to the user.cfg
I'd bet that the 'Save to disk' button of Parameter editor also triggers a write to user.cfg. ;)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FC 0.19 ... How can I prevent the automatic save to (change of) user.cfg?

Post by Kunda1 »

openBrain wrote: Thu Jan 02, 2020 2:16 pm
Kunda1 wrote: Thu Jan 02, 2020 2:09 pm The non-technical answer (i didn't search the code to see where but through pure observation and trial and error) is when the user either opens the Preferences - changes something and accepts the changes AND/OR when the program quits. The latter will save any changes made during the usage of FreeCAD that were either novel (like downloading a new workbench) to trivial. Right before the program exits these changes are written to the user.cfg
I'd bet that the 'Save to disk' button of Parameter editor also triggers a write to user.cfg. ;)
True
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
lutz_dd
Posts: 92
Joined: Thu Jul 31, 2014 5:10 am

Re: FC 0.19 ... How can I prevent the automatic save to (change of) user.cfg?

Post by lutz_dd »

Just FYI why I'm asking ....

Jumping across 0.17/0.18/0.19/0.19latest
+ openFoam, Assembly2, As2p, Plot-WB installed
+ running multiple FC's at the same time
hase silently (step-by-step) over time deleted the content of my Part-WB Custom-Toolbar using icons of the mentioned installed WB's. The issues seems to be related to the issues of the Workbenches (eg. Py2 vs Py3). It seems run/keep older FC version +outdated AddOns a difficult task.

For this reason my user.cfg is now Git-controlled, but it is difficult to separate the wanted changes from the unwanted stuff.

Thx. folks ... will go with a wrapper script as described by openBrain.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: FC 0.19 ... How can I prevent the automatic save to (change of) user.cfg?

Post by openBrain »

Maybe just setting user.cfg as read-only can be safely handled by FC without crashing, but I'm not sure of that. ;)
Post Reply