Skip to content

QEP 82: Unified Application Profiles #82

Closed

Description

@NathanW2

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

  1. added this to the 3.0 milestone on Nov 12, 2016
  2. self-assigned this
    on Nov 12, 2016
  3. changed the title [-]User Profiles and Unified Settings.[/-] [+]Application Profiles and Unified Settings.[/+] on Nov 12, 2016
  4. pcav commented on Nov 12, 2016

    @pcav
    Member

    Agreed. Very good improvement. Thanks Nathan.

  5. nyalldawson commented on Nov 24, 2016

    @nyalldawson
    Contributor

    All profiles would live in a single top level folder, maybe in ~, %HOME% to
    make it easy for the admins and users to find if needed. A link the about
    screen would also have the option to locate the current profile folder.

    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.

  6. nyalldawson commented on Nov 24, 2016

    @nyalldawson
    Contributor

    Just so I understand this fully - this means no more registry use on windows?

  7. NathanW2 commented on Nov 24, 2016

    @NathanW2
    MemberAuthor
  8. NathanW2 commented on Nov 24, 2016

    @NathanW2
    MemberAuthor

    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.

  9. nyalldawson commented on Nov 25, 2016

    @nyalldawson
    Contributor

    When would someone need to jump to this folder? For backups or something?

  10. NathanW2 commented on Nov 25, 2016

    @NathanW2
    MemberAuthor
  11. pcav commented on Nov 25, 2016

    @pcav
    Member

    +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?

  12. NathanW2 commented on Nov 25, 2016

    @NathanW2
    MemberAuthor
  13. ninsbl commented on Nov 25, 2016

    @ninsbl

    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...

  14. 42 remaining items

  15. dakcarto commented on Jan 30, 2017

    @dakcarto
    Member

    Or, do you mean the install-relative defaults config would actually be a directory, instead of a single config file?

  16. NathanW2 commented on Jan 30, 2017

    @NathanW2
    MemberAuthor
  17. dakcarto commented on Jan 30, 2017

    @dakcarto
    Member

    Ok. So if one were to just want to set defaults, add [QGIS]/QGIS3 to the QgsApplication::pkgDataPath()/<some standard name for defaults>/ directory? Or, some variation on that?

  18. NathanW2 commented on Jan 30, 2017

    @NathanW2
    MemberAuthor
  19. dakcarto commented on Jan 30, 2017

    @dakcarto
    Member

    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?

  20. NathanW2 commented on Jan 30, 2017

    @NathanW2
    MemberAuthor
  21. dakcarto commented on Jan 30, 2017

    @dakcarto
    Member

    Ah, ok, good point. Yeah, seems like a good idea to me.

  22. elpaso commented on Feb 3, 2017

    @elpaso
    Contributor

    @NathanW2 @dakcarto I've updated the dev branch with a full implementation with bindings and tests for the QgsSettings class: https://github.com/boundlessgeo/QGIS/tree/qgssettings-prototype
    https://github.com/boundlessgeo/QGIS/blob/qgssettings-prototype/src/core/qgssettings.h

    doxigen comments are still missing and I'd probably add some more shortcuts.

  23. changed the title [-]QEP 82: Unified Application Configuration[/-] [+]QEP 82: Unified Application Profiles[/+] on Mar 16, 2017
  24. haubourg commented on Aug 31, 2017

    @haubourg
    Member

    I just had a look of current master's status concerning profiles management.
    --configpath has 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 ?

  25. NathanW2 commented on Sep 1, 2017

    @NathanW2
    MemberAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions