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

XDG_CONFIG_HOME vs. XDG_CONFIG_DIRS in QSettings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: 5.1.1
    • Fix Version/s: 5.9.0 Alpha
    • Component/s: Core: I/O, Documentation
    • Labels:
      None
    • Environment:
      Open SuSe / Linux
    • Commits:
      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

            Assignee:
            thiago Thiago Macieira
            Reporter:
            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