Skip to content
Snippets Groups Projects
Commit 5534138a authored by David Fairbrother's avatar David Fairbrother Committed by Gigg, Martyn Anthony
Browse files

Append hostname to recovery folder

parent f4f06f54
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,7 @@
#include "PlotWizard.h"
#include "PolynomFitDialog.h"
#include "PolynomialFit.h"
#include "Process.h"
#include "ProjectRecovery.h"
#include "ProjectSerialiser.h"
#include "QwtErrorPlotCurve.h"
......@@ -16638,7 +16639,9 @@ void ApplicationWindow::onAboutToStart() {
resultsLog->scrollToTop();
 
// Kick off project recovery
checkForProjectRecovery();
// but only if we are the only instance currently running
if (!Process::isAnotherInstanceRunning())
checkForProjectRecovery();
}
 
/**
......@@ -16768,6 +16771,11 @@ bool ApplicationWindow::saveProjectRecovery(std::string destination) {
return projectWriter.save(QString::fromStdString(destination));
}
 
/**
* Checks for any recovery checkpoint and starts project
* saving if one doesn't exist. If one does, it prompts
* the user whether they would like to recover
*/
void ApplicationWindow::checkForProjectRecovery() {
if (!m_projectRecovery.checkForRecovery()) {
m_projectRecovery.startProjectSaving();
......
......@@ -16,8 +16,10 @@
#include "boost/range/algorithm_ext/erase.hpp"
#include "Poco/DirectoryIterator.h"
#include "Poco/Environment.h"
#include "Poco/NObserver.h"
#include "Poco/Path.h"
#include "Poco/Process.h"
#include <QMessageBox>
#include <QMetaObject>
......@@ -62,8 +64,10 @@ boost::optional<bool> getConfigBool(const std::string &key) {
/// Returns a string to the current top level recovery folder
std::string getRecoveryFolder() {
static std::string recoverFolder =
Mantid::Kernel::ConfigService::Instance().getAppDataDir() + "/recovery/";
static std::string appData = Mantid::Kernel::ConfigService::Instance().getAppDataDir();
static std::string hostname = Poco::Environment::nodeName();
static std::string recoverFolder = appData + "/recovery/" + hostname + '/';
return recoverFolder;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment