[App] Fix file not found error with canonical filename

boost::filesystem::canonical doesn't resolve non existent file where
boost::filesystem::weakly_canonical does.

Notice boost::filesystem::weakly_canonical only resolve absolute path.
This commit is contained in:
flachyjoe
2022-06-18 17:41:31 +02:00
committed by wwmayer
parent 8fba6b034d
commit 511b38ce24

View File

@@ -2617,9 +2617,9 @@ bool Document::saveToFile(const char* filename) const
//realpath is canonical filename i.e. without symlink
#ifdef FC_OS_WIN32
QString utf8Name = QString::fromUtf8(filename);
auto realpath = fs::canonical(fs::path(utf8Name.toStdWString()));
auto realpath = fs::weakly_canonical(fs::absolute(fs::path(utf8Name.toStdWString())));
#else
auto realpath = fs::canonical(fs::path(filename));
auto realpath = fs::weakly_canonical(fs::absolute(fs::path(filename)));
#endif
// make a tmp. file where to save the project data first and then rename to