logic: paths in ProjectSettings relative to file not working directory

This change checks all paths in the ProjectSettings file for relativity and makes them relative to the location of the
ProjectSettings file if necessary. The paths are also correctly saved relative to the file.
This commit is contained in:
Eberhard Graether
2015-07-29 22:20:26 +02:00
parent 336df76912
commit 5f25311389
31 changed files with 407 additions and 148 deletions
+3 -4
View File
@@ -178,8 +178,7 @@ void Storage::onError(const ParseLocation& location, const std::string& message)
}
bool duplicate = false;
std::string filePath = location.filePath;
TokenLocationFile* file = m_errorLocationCollection.findTokenLocationFileByPath(filePath);
TokenLocationFile* file = m_errorLocationCollection.findTokenLocationFileByPath(location.filePath);
if (file)
{
@@ -202,7 +201,7 @@ void Storage::onError(const ParseLocation& location, const std::string& message)
Id errorId = m_errorMessages.size();
m_errorLocationCollection.addTokenLocation(
errorId, filePath,
errorId, location.filePath,
location.startLineNumber, location.startColumnNumber,
location.endLineNumber, location.endColumnNumber
);
@@ -1480,7 +1479,7 @@ void Storage::removeNodeIfUnreferenced(Node* node)
void Storage::log(std::string type, std::string str, const ParseLocation& location) const
{
LOG_INFO_STREAM(
<< type << ": " << str << " <" << location.filePath << " "
<< type << ": " << str << " <" << location.filePath.str() << " "
<< location.startLineNumber << ":" << location.startColumnNumber << " "
<< location.endLineNumber << ":" << location.endColumnNumber << ">"
);