fix: honor DirectoryIsValid create flag; unbreak Windows CI tests
DirectoryIsValid() ignored try_to_create_if_not_exists and always called mkpath(). On the Windows CI runner (which may create dirs at the drive root) PathWidget validation both created bogus directories and never flagged invalid paths; on Linux the mkpath just failed. - filefunctions: only mkpath when try_to_create_if_not_exists is set - TaskProjectLoadTest: Project::set_filename() stores native separators on Windows, normalize before comparing paths - DialogProjectProperties: use a nonexistent file inside a temp dir instead of a fixed /definitely/... path that prior tests may have partially created on a writable drive
This commit is contained in:
@@ -168,7 +168,8 @@ bool FileFunctions::DirectoryIsValid(const QDir &d,
|
||||
bool try_to_create_if_not_exists)
|
||||
{
|
||||
// Return whether the directory exists, or whether it could be created if it doesn't
|
||||
return d.exists() || d.mkpath(QStringLiteral("."));
|
||||
return d.exists() ||
|
||||
(try_to_create_if_not_exists && d.mkpath(QStringLiteral(".")));
|
||||
}
|
||||
|
||||
QString FileFunctions::EnsureFilenameExtension(QString fn,
|
||||
|
||||
Reference in New Issue
Block a user