Utils: Fix FileChooser error marking for directories

Amends  b84c8cf892.

Change-Id: I108110cc682d331947c8eb47f62121ed02cd45f9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-07-14 15:13:41 +02:00
parent b0e0b3ecda
commit 3cdeb1a119

View File

@@ -582,7 +582,7 @@ bool PathChooser::validatePath(FancyLineEdit *edit, QString *errorMessage) const
}
break;
case PathChooser::Directory:
if (filePath.isDir()) {
if (filePath.exists() && !filePath.isDir()) {
if (errorMessage)
*errorMessage = tr("The path \"%1\" is not a directory.").arg(filePath.toUserOutput());
return false;