|
|
Home » Developing U++ » U++ Developers corner » What improvements for Upp on Linux to comply with freedesktop?
Re: What improvements for Upp on Linux to comply with freedesktop? [message #10759 is a reply to message #10754] |
Fri, 27 July 2007 19:24 |
Zardos
Messages: 62 Registered: April 2007
|
Member |
|
|
Regarding config files in general:
Comming mainly from windows I seperate storing a config file and loading a config file.
There are three main locations for a config file:
1.) The user profile app directory (home/<user>/.<app> under unix)
2.) An all user profile app directory (etc/<app> under unix)
3.) The application directory <install_path>/config (same on unix)
... when loading a config file the three locations above are searched for a config file in the order 1, 2, 3:
If a config file is not found in the user profile (home), all user profile is checked for a config file (etc). If not found there the app directory is checked for a config file.
This way you can:
1.) Deliver some default settings in the app directory
2.) A corporation can place a coporate config file in the all user profile (etc) - without fear it is overwritten with a new version of the app.
3.) Users can overwrite the default application settings and the coporate settings
=> A config file is always saved in the user profile (home).
While this of course does not match all possible scenarios it is ok for most common cases.
... All this does not solve the problem that a new version may have an incompatible new config file format. So this have to be handled seperately by the app. For examples serializing maps instead of member vars directly.
Finally for windows it is sometimes important to make use of "user local settings" (for example temp is located at this place). Under windows in a corporate network the user profile is often replicated via network when the user logs on to different workstations. And usually there is a quota on the user profile (always to small 10MB at our place). So for "cache data" like a browser cache it is important to store the data NOT in the normal user profile. Instead the local user profile should be used.
Does this map to /var/local/app/<user> under unix?
Never store config file in the app directory (defaults are ok). Even under windows it is possible that more users share one computer...
This is the reason why I have four functions for config management.
Last Edit: I have a special "usbstick / pendrive mode". All above is ignored and everything is stored in the app directory -> Keep the app with all you settings on the pendrive.
- Ralf
[Updated on: Fri, 27 July 2007 19:31] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 11 14:20:13 CEST 2024
Total time taken to generate the page: 0.03094 seconds
|
|
|