]> git.lyx.org Git - features.git/commit
Rel. path in paths prefs preserved as rel. paths
authorScott Kostyshak <skostysh@lyx.org>
Fri, 29 Jul 2016 17:13:55 +0000 (13:13 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Fri, 29 Jul 2016 17:13:55 +0000 (13:13 -0400)
commit9b64d7bd24d606490c344a548fff4b93f837ccaf
treede6542ddf6a1f1119846b28fea90f6fd332b74df
parent60e89213493cfb4b8b30dc00264db1ca42e0348a
Rel. path in paths prefs preserved as rel. paths

Before this commit, in the paths preferences tab if you put a
relative path, LyX would convert it behind the scenes to an absolute
path by evaluating the relative path with respect to the working
directory of the LyX instance where the preference change is taking
place. This seems confusing because (1) it is done behind the scenes
(after the preferences dialog is closed) and (2) if the user chooses
to enter a relative path, the safest thing to do is to preserve it
as a relative path, instead of making the assumption that the user
intended for it to be expanded to an absolute path.

An explanation of how relative paths are handled is given at the
bottom of the paths tab. Note that the height/width of the
preferences window is not changed as a result of adding this
explanatory comment because the height of the preferences dialog is
already stretched by other tabs.

This commit improves consistency in the sense that the behavior of
LyX is now the same when a relative path is specified in the
preferences dialog as when it is manually specified in the
preferences file. Before, if the preferences file were manually
edited and a relative path were inserted, the next time the user
made a change to preferences with the GUI (even if the preference
change was a different preference, e.g. instant preview), the
relative path would be silently converted to an absolute path,
evaluated with respect to the working directory of that instance.

Beyond improving clarity and consistency (IMO), this commit allows
for a new feature to be implemented of using relative paths in the
paths preferences. For example, the user may now enter '.' as the
"Working directory" path and now whenever they start LyX from a
directory and create a new file, the default location of the file
will be the directory from which they started LyX, instead of the
user's home directory which is LyX's default and is less intuitive.

No prefs2prefs work is needed because if a relative path were
entered in the preferences dialog before this commit, it was
converted to an absolute path before being stored in preferences. If
a relative path were specified by manually editing the preferences
file, then (unless the path were already automatically converted to
an absolute path by a GUI preferences change, as described above)
the behavior will be the same (the path will be treated as a
relative path).

For related discussion, see the lyx-devel thread here:
https://www.mail-archive.com/search?l=mid&q=20160616003010.bnymtcouar7g55ti%40cotopaxi

This commit removes the last use of lyx::support::expandPath() in
LyX's sources.
src/LyXRC.cpp
src/frontends/qt4/ui/PrefPathsUi.ui