logic: Less restrictions for FilePath::isValid check on project location (#959)

Switch from using boost::filesystem::portable_name and boost::filesystem::portable_directory_name to using boost::filesystem::windows_name, which allows periods and spaces in paths.
Fixes #957
This commit is contained in:
Eberhard Gräther
2020-04-03 15:27:31 +02:00
committed by GitHub
parent 0c577f2f69
commit 2924c1c948
2 changed files with 14 additions and 13 deletions
+2 -13
View File
@@ -115,17 +115,6 @@ bool FilePath::isAbsolute() const
bool FilePath::isValid() const
{
boost::filesystem::path::iterator end = m_path->end();
if (!isDirectory())
{
if (!boost::filesystem::portable_file_name(m_path->filename().generic_string()))
{
return false;
}
end--;
}
boost::filesystem::path::iterator it = m_path->begin();
if (isAbsolute() && m_path->has_root_path())
@@ -139,9 +128,9 @@ bool FilePath::isValid() const
}
}
for (; it != end; ++it)
for (; it != m_path->end(); ++it)
{
if (!boost::filesystem::portable_directory_name(it->string()))
if (!boost::filesystem::windows_name(it->string()))
{
return false;
}