various: consolidated dir exists+mkpath into one function
This commit is contained in:
@@ -313,7 +313,7 @@ void ExportDialog::StartExport()
|
||||
|
||||
// If the directory does not exist, try to create it
|
||||
QDir dest_dir(file_info.path());
|
||||
if (!dest_dir.exists() && !dest_dir.mkpath(QStringLiteral("."))) {
|
||||
if (!FileFunctions::DirectoryIsValid(dest_dir)) {
|
||||
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."));
|
||||
|
||||
@@ -96,7 +96,7 @@ bool PreferencesDiskTab::Validate()
|
||||
}
|
||||
|
||||
// Check validity of the new path
|
||||
if (!FileFunctions::DirectoryIsValid(disk_cache_location_->text(), true)) {
|
||||
if (!FileFunctions::DirectoryIsValid(disk_cache_location_->text())) {
|
||||
QMessageBox::critical(this,
|
||||
tr("Disk Cache"),
|
||||
tr("Failed to set disk cache location. Access was denied."));
|
||||
|
||||
@@ -186,7 +186,7 @@ void ProjectPropertiesDialog::accept()
|
||||
|
||||
bool ProjectPropertiesDialog::VerifyPathAndWarnIfBad(const QString &path)
|
||||
{
|
||||
if (!FileFunctions::DirectoryIsValid(path, true)) {
|
||||
if (!FileFunctions::DirectoryIsValid(path)) {
|
||||
QMessageBox mb(this);
|
||||
mb.setWindowModality(Qt::WindowModal);
|
||||
mb.setIcon(QMessageBox::Critical);
|
||||
|
||||
Reference in New Issue
Block a user