Skip to content

Commit 7e4ab60

Browse files
committed
Revert "use Path::getAbsoluteFilePath"
This reverts commit ee53801.
1 parent ee53801 commit 7e4ab60

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

lib/importproject.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,13 @@ static bool simplifyPathWithVariables(std::string &s, VariablesMap &variables)
278278
return true;
279279
}
280280

281+
static std::string toAbsolute(const std::string &path)
282+
{
283+
if (Path::isAbsolute(path))
284+
return Path::simplifyPath(path);
285+
return Path::simplifyPath(Path::getCurrentPath() + "/" + path);
286+
}
287+
281288
static std::string toAbsolute(const std::string &filename, const std::string &baseDir, VariablesMap &variables)
282289
{
283290
std::string resolved(filename);
@@ -353,7 +360,7 @@ ImportProject::Type ImportProject::import(const std::string &filename, Settings
353360
return ImportProject::Type::VS_SLNX;
354361
}
355362
} else if (endsWith(filename, ".vcxproj")) {
356-
if (importVcxproj(Path::getAbsoluteFilePath(filename), mVariables, fileFilters)) {
363+
if (importVcxproj(toAbsolute(filename), mVariables, fileFilters)) {
357364
setRelativePaths(filename);
358365
return ImportProject::Type::VS_VCXPROJ;
359366
}
@@ -489,7 +496,7 @@ bool ImportProject::importSln(std::istream &istr, const std::string &path, const
489496
}
490497
}
491498

492-
const std::string solutionDir = Path::getAbsoluteFilePath(path);
499+
const std::string solutionDir = toAbsolute(path);
493500
mVariables["SolutionDir"] = solutionDir;
494501

495502
bool found = false;
@@ -541,7 +548,7 @@ bool ImportProject::importSlnx(const std::string& filename, const std::vector<st
541548
return false;
542549
}
543550

544-
mVariables["SolutionDir"] = Path::getAbsoluteFilePath(Path::getPathFromFilename(filename));
551+
mVariables["SolutionDir"] = toAbsolute(Path::getPathFromFilename(filename));
545552

546553
bool found = false;
547554

0 commit comments

Comments
 (0)