Zandronum Chat @ irc.zandronum.com
#zandronum
Get the latest version: 3.0
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003233Doomseeker[All Projects] Bugpublic2017-09-01 10:582017-10-07 08:55
ReporterWubTheCaptain 
Assigned ToBlzut3 
PrioritynormalSeverityfeatureReproducibilityalways
StatusassignedResolutionopen 
Platformx86_64 (really cross-platform)OSDebian GNU/LinuxOS Versionbuster/sid
Product Version1.1 
Target Version1.2Fixed in Version 
Summary0003233: Add support for the XDG Base Directory Specification and default to it
DescriptionDoomseeker creates a config directory to /home/<username>/.doomseeker (Note: Not $HOME, username hard-written in config) and sets default Wadseeker and IWAD/PWAD paths to it.

To avoid polluting $HOME, the XDG Base Directory Specification should be implemented.

User-specific config files should be written to $XDG_CONFIG_HOME (default: $HOME/.config), e.g. $HOME/.config/doomseeker.

User-specific Wadseeker and IWAD/PWAD paths should default to $XDG_DATA_HOME (default: $HOME/.local/share), e.g. $HOME/.local/share/doomseeker.
Steps To Reproduce

  1. Ensure no existing user-specific configuration is present (e.g. remove $HOME/.doomseeker).

  2. Run Doomseeker. A message should popup about first-time configuration check.

  3. $HOME/.doomseeker is automatically created.

Additional Informationhttps://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html [^]

/home/<username>/ may be hardcoded to many config files, including server browser and server configuration may fail to load if the username is changed.
Attached Files

- Relationships
related to 0003247assignedWubTheCaptain Doomseeker's manual page (mdoc/nroff) is missing or incomplete 
child of 0003279acknowledged List of Debian issues (misc/non-policy) 

-  Notes
User avatar (0018250)
Zalewa (developer)
2017-09-09 18:53
edited on: 2017-09-09 18:58

If we're about to recognize $HOME as an expression expanding to the user, well, $HOME, should we also allow any env variable to be used? Someone might have $MY_SECRET_DOOM_FOLDER, after all.

On Windows env variables are used by wrapping them in percent signs, like this: %HOMEDRIVE%%HOMEPATH%:


C:\>echo %HOMEDRIVE%%HOMEPATH%
C:\Users\Robert


Do we consider $HOME a special variable that will expand to $HOME on Linux and %USERPROFILE% on Windows or do we disable this feature for Windows builds? (by this I mean that we should probably be using QStandardPaths)

QDir::homePath() documentation presents how the path should be seeked on Windows:http://doc.qt.io/qt-5/qdir.html#homePath [^]

I haven't checked if Qt will expand '~' automatically - maybe that's the correct venue here?

User avatar (0018381)
WubTheCaptain (developer)
2017-09-25 14:13

In example: "If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used." It is safe to assume QStandardPaths::HomeLocation or QDir::homePath() to match $HOME.

I guess $XDG_CONFIG_HOME may indeed have any other environment variable in it. Stricly speaking this would have to be supported in the specification with my interpretation, but I wouldn't mind partial support emulating only the defaults in $HOME.

XDG basedirs don't seem to concern with Windows, it is undefined there and only an Unix-like thing. I'm not familiar how Windows handles configuration, probably the AppData folder.

Quote from Zalewa
I haven't checked if Qt will expand '~' automatically - maybe that's the correct venue here?


Not automatically, to my awareness. There's also use cases where you may have a path "/home/wub/foo/~bar/baz", which shouldn't expand to /home/bar/baz, but without quotes or escaping it would from a shell expand to /home/bar/baz. The mad men.
User avatar (0018382)
WubTheCaptain (developer)
2017-09-25 14:16

Do note the $PATH variable doesn't have $HOME in it, but a hardwritten home path like /home/wub/.local/bin.
User avatar (0018383)
WubTheCaptain (developer)
2017-09-25 14:20

Seems like you want to use QStandardPaths::AppConfigLocation.
User avatar (0018384)
WubTheCaptain (developer)
2017-09-25 14:27

https://wiki.debian.org/XDGBaseDirectorySpecification [^] (see: libqtxdg)

Issue Community Support
Only registered users can voice their support. Click here to register, or here to log in.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2017-09-01 10:58 WubTheCaptain New Issue
2017-09-01 16:29 Zalewa Relationship added child of 0003246
2017-09-06 02:34 Blzut3 Assigned To => Blzut3
2017-09-06 02:34 Blzut3 Status new => assigned
2017-09-06 02:34 Blzut3 Target Version => 1.2
2017-09-09 18:53 Zalewa Note Added: 0018250
2017-09-09 18:58 Zalewa Note Edited: 0018250 View Revisions
2017-09-09 18:58 Zalewa Note Edited: 0018250 View Revisions
2017-09-25 14:13 WubTheCaptain Note Added: 0018381
2017-09-25 14:16 WubTheCaptain Note Added: 0018382
2017-09-25 14:20 WubTheCaptain Note Added: 0018383
2017-09-25 14:27 WubTheCaptain Note Added: 0018384
2017-09-27 21:59 WubTheCaptain Relationship added child of 0003279
2017-09-27 22:00 WubTheCaptain Relationship deleted child of 0003246
2017-10-07 08:55 WubTheCaptain Relationship added related to 0003247






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker