export: check if exists and if can mkpath

This commit is contained in:
itsmattkc
2022-04-07 16:49:18 -07:00
parent fb9034023c
commit 20f74919a3
+2 -1
View File
@@ -312,7 +312,8 @@ void ExportDialog::StartExport()
QFileInfo dir_info(file_info.path());
// If the directory does not exist, try to create it
if (!QDir(file_info.path()).mkpath(QStringLiteral("."))) {
QDir dest_dir(file_info.path());
if (!dest_dir.exists() && !dest_dir.mkpath(QStringLiteral("."))) {
QtUtils::MessageBox(this, QMessageBox::Critical, tr("Failed to create output directory"),
tr("The intended output directory doesn't exist and Olive couldn't create it. "
"Please choose a different filename."));