Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-34919

XDG_CONFIG_HOME vs. XDG_CONFIG_DIRS in QSettings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.9.0 Alpha
    • 5.1.1
    • Core: I/O, Documentation
    • None
    • Open SuSe / Linux
    • 4758555f3e44af3425f0b691dc38fb40f3c9413d

    Description

      As extracted from the documentation, QSettings tries to read config files for an application "Star Runner" from company "MySoft" from the following locations:

      1. $HOME/.config/MySoft/Star Runner.conf
      2. $HOME/.config/MySoft.conf
      3. $XDG_CONFIG_HOME/MySoft/Star Runner.conf
      4. $XDG_CONFIG_HOME/etc/xdg/MySoft.conf

      (where $XDG_CONFIG_HOME defaults to /etc/xdg).

      I.e. first the user settings (1. and 2.) and then the systen-wide settings (3. and 4.).

      The XDG Base directory specification(http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) states, that user-specific settings are located by XDG_CONFIG_HOME, and additional search paths (system-wide) are stored in XDG_CONFIG_DIRS.

      So, according to this standard, the correct search list would be

      1. $XDG_CONFIG_HOME/MySoft/Star Runner.conf
      2. $XDG_CONFIG_HOME/MySoft.conf
      3. foreach (d, $XDG_CONFIG_DIRS) d/MySoft/Star Runner.conf
      4. foreach (d, $XDG_CONFIG_DIRS) d/MySoft.conf

      Where XDG_CONFIG_HOME defaults to $HOME/.config and XDF_CONDIF_DIRS to /etc/xdg.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            mlangen Marc Langenbach
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes