]> git.lyx.org Git - features.git/commitdiff
Remove the now unused lyx::support::expandPath()
authorScott Kostyshak <skostysh@lyx.org>
Fri, 29 Jul 2016 17:15:41 +0000 (13:15 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Fri, 29 Jul 2016 17:17:09 +0000 (13:17 -0400)
The function is no longer used in LyX's sources (as of the previous
comit, 9b64d7bd) and is thus removed with this commit. Perhaps the
advantage this function had over other path functions we have has
disappeared over time (see e.g. 1a7b7f65).

src/support/filetools.cpp
src/support/filetools.h

index fbc8711b15b5ef91cd8fff46573169370f5e28e2..b28d81210c48283395c566dca52bd898994848cc 100644 (file)
@@ -644,35 +644,6 @@ string const onlyFileName(string const & fname)
 }
 
 
-// Create absolute path. If impossible, don't do anything
-// Supports ./ and ~/. Later we can add support for ~logname/. (Asger)
-string const expandPath(string const & path)
-{
-       // checks for already absolute path
-       string rTemp = replaceEnvironmentPath(path);
-       if (FileName::isAbsolute(rTemp))
-               return rTemp;
-
-       string temp;
-       string const copy = rTemp;
-
-       // Split by next /
-       rTemp = split(rTemp, temp, '/');
-
-       if (temp == ".")
-               return FileName::getcwd().absFileName() + '/' + rTemp;
-
-       if (temp == "~")
-               return Package::get_home_dir().absFileName() + '/' + rTemp;
-
-       if (temp == "..")
-               return makeAbsPath(copy).absFileName();
-
-       // Don't know how to handle this
-       return copy;
-}
-
-
 // Search the string for ${VAR} and $VAR and replace VAR using getenv.
 string const replaceEnvironmentPath(string const & path)
 {
index 2953a81e83ea9fe1bd5b4cdbedc1eaaa5441d89b..5177cdddee81ade1ced639a892c1225d36c5a6cb 100644 (file)
@@ -220,9 +220,6 @@ std::string const unzippedFileName(std::string const & zipped_file);
 FileName const unzipFile(FileName const & zipped_file,
                         std::string const & unzipped_file = std::string());
 
-/// Create absolute path. If impossible, don't do anything
-std::string const expandPath(std::string const & path);
-
 /** Convert relative path into absolute path based on a basepath.
   If relpath is absolute, just use that.
   If basepath doesn't exist use CWD.