Remove the now unused lyx::support::expandPath()

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).
This commit is contained in:
Scott Kostyshak 2016-07-29 13:15:41 -04:00
parent 9b64d7bd24
commit c659fd4f74
2 changed files with 0 additions and 32 deletions

View 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. // Search the string for ${VAR} and $VAR and replace VAR using getenv.
string const replaceEnvironmentPath(string const & path) string const replaceEnvironmentPath(string const & path)
{ {

View File

@ -220,9 +220,6 @@ std::string const unzippedFileName(std::string const & zipped_file);
FileName const unzipFile(FileName const & zipped_file, FileName const unzipFile(FileName const & zipped_file,
std::string const & unzipped_file = std::string()); 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. /** Convert relative path into absolute path based on a basepath.
If relpath is absolute, just use that. If relpath is absolute, just use that.
If basepath doesn't exist use CWD. If basepath doesn't exist use CWD.