[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-07-09 19:29:48 +02:00
committed by Uwe
parent d25478bb35
commit 8bb7cfe780
+2 -2
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