From c659fd4f742763331a5d1e1d3220fb1a615ef845 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Fri, 29 Jul 2016 13:15:41 -0400 Subject: [PATCH] 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). --- src/support/filetools.cpp | 29 ----------------------------- src/support/filetools.h | 3 --- 2 files changed, 32 deletions(-) diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp index fbc8711b15..b28d81210c 100644 --- a/src/support/filetools.cpp +++ b/src/support/filetools.cpp @@ -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) { diff --git a/src/support/filetools.h b/src/support/filetools.h index 2953a81e83..5177cdddee 100644 --- a/src/support/filetools.h +++ b/src/support/filetools.h @@ -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. -- 2.39.2