Repository navigation
Description
QGIS Enhancement 82: Unified Application Configuration
Date 2016/11/12
Author Nathan Woodrow @NathanW2
Contact woodrow.nathan@gmail.com
maintainer @NathanW2
Version QGIS 3.0
Summary
This QEP is to add and expand Unified Application Configuration support into core QGIS. The main idea is to bundle everything that is normally in .qgis2 and settings (registry on
windows, config files on OS X/*nix, etc) into a single folder in the users platform based settings folder. This would allow the creation of saved config folder, you can think of them like profiles in Chrome/Firebreak, etc
The config folder would be a single folder with all .qgis2 and settings files which currently the result of doing the following in QGIS 2:
qgis --configpath folder\qgis
As saved configs contain isolated settings and plugins they can be great for different workflows, demos, users of the same machine, or testing settings, etc.
Proposal includes removing the use of current .qgis2 and settings paths (registry on Windows) in QGIS 3.x in favour of new profiles folder setup.
I think this method of storing settings and plugins, etc, could remove a lot of current confusion in how QGIS stores settings, as well as increase the flexibility in enterprise style deployments of QGIS.
Backups of user profiles also because very easy. A simple copy the profile folder to make a backup.
Proposed Solution
This proposal is to add new option --profile, as well as UI related to creating and switching saved configs.
All configs would live in a single top level folder in the platform dependent location e.g appdata on windows, etc, A link the about screen would also have the option to locate the current profile folder in the OS file manager.
An example of profile layout:
%APPDATA%
- \QGIS
- \configs
- .default
- \config1
- \config2
- \config3
By default, QGIS would run using the default config which is found in .default, e.g profile1
Part of this QEP is also loading machine-wide settings that are installed in the QGIS install folder. These should be loaded and then joined with the users saved config settings. Settings will follow the same format as the a users folder setup however there is only one.
Affected Files.
main() of QGIS would be altered to load configs from the settings folder.
A new class will also be introduced called QgsSettings which hides the implementation of config loading away from the code base. QgsSettings will be used in place of QSettings though out the core code base.
QgsSettings will have an API similar to QSettings in order to be a drop in replacement. The current implementation is to just be a wrapper for QSettings however in the future this could hold other logic for finding settings.
Performance Implications
None.
Further Considerations/Improvements
Cloud config
By hiding any implementation details inside QgsSettings we can also add loading config from a database and webserver in the future.
Webserver could expose endpoints to download/upload zip files of the user's config folder into a hosted environment. This is out of the scope of this QEP, however, this can be used as a building block for that function in future.
Backups
Built in backup process to allow rollbacks of settings. As the settings file is simply text files each change and is backed up and compressed for later rollback.
Backwards Compatibility
If QGIS 3.0 will inherit the settings of QGIS 2.x would migrate any existing settings and plugins into the new profile folder layout.
Issue Tracking ID(s)
(optional)
Activity
[-]User Profiles and Unified Settings.[/-][+]Application Profiles and Unified Settings.[/+]pcav commentedon Nov 12, 2016
Agreed. Very good improvement. Thanks Nathan.
nyalldawson commentedon Nov 24, 2016
I think we should respect the standard folder locations here. So Appdata\Roaming (or local?) for windows, and ~/.config/qgis for linux. Not sure what the OSX standard is.
We've been abusing people's home folders with the .qgis2 folder for a long time, it'd be good to start following the standard now that we've got the chance.
See also http://hub.qgis.org/issues/11926
At the same time we could also should split up config and cache folders, so users aren't unnecessarily backing up temporary files when they are saving their qgis settings.
nyalldawson commentedon Nov 24, 2016
Just so I understand this fully - this means no more registry use on windows?
NathanW2 commentedon Nov 24, 2016
NathanW2 commentedon Nov 24, 2016
If we provide a way to jump to the folder from inside QGIS it doesn't really matter the location it's saved. So happy to match what the standard is for each platform.
nyalldawson commentedon Nov 25, 2016
When would someone need to jump to this folder? For backups or something?
NathanW2 commentedon Nov 25, 2016
pcav commentedon Nov 25, 2016
+1 for getting rid of win registry
+1 for a standard location
unsure about designing our way to manage the config folder: what other major sw do? Can't we leave this to the OS file manager?
NathanW2 commentedon Nov 25, 2016
ninsbl commentedon Nov 25, 2016
Yes, indeed very nice to get rid of registry use, which several others already wished for on the mailinglists!
Not sure if that can be within the scope of this QEP, but in an (our) organizational setting, we have some settings (e.g. connections to OWS) which are frequently used by almost all users. These were put into a default setting, which is the copied into the user-homer. Users then can adjust the settings and add more OWS and so on. However, OWS-url get updated now and then and the question arises how to update the URL in all user settings without overwriting changes/adjustments users made to their QGIS.ini.
What I would like to have would be the flexibility, that users can change the settings as they like, but that "central" settings can be updated by an administrator (and not every user has to do that himself). A kind of versioning of the QGIS.ini. Splitting up the Settings into different sections seems to be helpful in that direction.
But maybe that is something for a Python-Macro...
42 remaining items
dakcarto commentedon Jan 30, 2017
Or, do you mean the install-relative defaults config would actually be a directory, instead of a single config file?
NathanW2 commentedon Jan 30, 2017
dakcarto commentedon Jan 30, 2017
Ok. So if one were to just want to set defaults, add
[QGIS]/QGIS3to theQgsApplication::pkgDataPath()/<some standard name for defaults>/directory? Or, some variation on that?NathanW2 commentedon Jan 30, 2017
dakcarto commentedon Jan 30, 2017
Seems like the install-relative defaults wouldn't necessarily be something you would want copied over to a user config directory, if the referenced directory is also the template for such a user config.
Or, maybe you do, as a starting point for editing, since, in user space, those settings are just user overrides, not defaults?
NathanW2 commentedon Jan 30, 2017
dakcarto commentedon Jan 30, 2017
Ah, ok, good point. Yeah, seems like a good idea to me.
elpaso commentedon Feb 3, 2017
@NathanW2 @dakcarto I've updated the dev branch with a full implementation with bindings and tests for the
QgsSettingsclass: https://github.com/boundlessgeo/QGIS/tree/qgssettings-prototypehttps://github.com/boundlessgeo/QGIS/blob/qgssettings-prototype/src/core/qgssettings.h
doxigen comments are still missing and I'd probably add some more shortcuts.
[-]QEP 82: Unified Application Configuration[/-][+]QEP 82: Unified Application Profiles[/+]haubourg commentedon Aug 31, 2017
I just had a look of current master's status concerning profiles management.
--configpathhas no more effect and is replaced by the profiles-path and profile-name.Shouldn't we raise a message if a qgis session is launched with deprecated options ?
NathanW2 commentedon Sep 1, 2017