mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
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:
parent
9b64d7bd24
commit
c659fd4f74
@ -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)
|
||||
{
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user