Skip to content

Commit

Permalink
fmk - updating version to 4.1.0, adding check before recursiveRemove
Browse files Browse the repository at this point in the history
  • Loading branch information
fmckenna committed Oct 1, 2024
1 parent 520ec62 commit 1db6876
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions WorkflowAppEE_UQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include <Utils/ProgramOutputDialog.h>
#include <Utils/RelativePathResolver.h>
#include <GoogleAnalytics.h>
#include <Utils/FileOperations.h>

// static pointer for global procedure set in constructor
static WorkflowAppEE_UQ *theApp = 0;

extern bool isSafeToRemoveRecursivily(const QString &directoryPath);

// global procedure
int getNumParallelTasks() {
Expand Down Expand Up @@ -256,7 +256,11 @@ WorkflowAppEE_UQ::setMainWindow(MainWindowWorkflowApp* window) {
theMachine,
theRemoteService,
theOpenSeesApp,
theToolDialog);
theToolDialog);
QStringList filesToDownload; filesToDownload << "results.zip";
theOpenSeesTool->setFilesToDownload(filesToDownload, false);



theToolDialog->addTool(theOpenSeesTool, "OpenSees@DesignSafe");
QAction *showOpenSees = toolsMenu->addAction("&OpenSees@DesignSafe");
Expand Down Expand Up @@ -617,8 +621,14 @@ WorkflowAppEE_UQ::setUpForApplicationRun(QString &workingDir, QString &subDir) {
QDir destinationDirectory(tmpDirectory);

if(destinationDirectory.exists()) {
if (isSafeToRemoveRecursivily(tmpDirectory))
if (SCUtils::isSafeToRemoveRecursivily(tmpDirectory))
destinationDirectory.removeRecursively();
else {
QString msg("The Program stopped, it was about to recursivily remove: ");
msg.append(tmpDirectory);
fatalMessage(msg);
return;
}
}

destinationDirectory.mkpath(tmpDirectory);
Expand Down

0 comments on commit 1db6876

Please sign in to comment.