[Development] Naming of path/directory-related environment variables in Qt

Edward Welbourne edward.welbourne at qt.io
Fri Nov 11 16:51:16 CET 2016


Mitch Curtis gave examples and proposed a convention:
> I'd like to establish some kind of convention for naming
> path/directory-related environment variables in Qt, with the hope that
> it could be set in stone with e.g. one of these newfangled QUIPs.
>
> Pelagicore (via Gordan) kindly contributed a patch to Qt Virtual
> Keyboard, where they introduced a QT_VIRTUALKEYBOARD_LAYOUTS_FOLDER
> environment variable:
>
> https://codereview.qt-project.org/#/c/174616/
>
> I then asked Gordan to change this to QT_VIRTUALKEYBOARD_LAYOUTS_DIR,
> as it seemed we had a few other environment variables using this
> naming scheme.
>
> JP then pushed a patch that adds QT_QUICK_CONTROLS_STYLE_PATH to Qt
> Quick Controls 2:
>
> https://codereview.qt-project.org/#/c/176512/
>
> He found more examples of where we've used "PATH" than where we used
> "DIR", so it seems like a good time to continue with that trend so
> that we don't have any more inconsistencies.
>
> My hope is that enough approvers see this email (or QUIP) and its
> conclusion (whatever it may be) and -1 patches that go against the
> convention.
>
> So, can we all agree on using "PATH" when naming environment variables
> that refer to paths?

PATH is also used to indicate a *list* of directory names.  Given its
other meaning (below), however, it might be better to identify such
lists by environment variables ending in DIRS to make clear they're
plural and that each entry is a directory.

When used to identify just one thing on the file system, PATH is
generic: it applies as much to single files as to directories, where DIR
is quite specific about applying only to a directory (or folder, or
whatever else these get called on diverse systems).  There is some value
to being able to distinguish "this variable names a directory" (not
uncommonly: one in which we'll scan for paths of diverse other things)
from "this is where that thing is found" (e.g. a config file or style
sheet).

Is it worth retaining such a distinction between PATH and DIR ?
To what extent do the existing names conform to such a difference ?

	Eddy.



More information about the Development mailing list