From 756347c68a7f1f95b5b27538f2980c45da17e96a Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Tue, 19 Jun 2018 17:08:50 +0100
Subject: [PATCH] Re #0 Remove const so cppcheck doesnt suggest by-ref

---
 MantidPlot/src/ApplicationWindow.cpp | 2 +-
 MantidPlot/src/ApplicationWindow.h   | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/MantidPlot/src/ApplicationWindow.cpp b/MantidPlot/src/ApplicationWindow.cpp
index 251d4e5ae54..451a8342fff 100644
--- a/MantidPlot/src/ApplicationWindow.cpp
+++ b/MantidPlot/src/ApplicationWindow.cpp
@@ -16740,7 +16740,7 @@ bool ApplicationWindow::isOfType(const QObject *obj,
   return strcmp(obj->metaObject()->className(), toCompare) == 0;
 }
 
-void ApplicationWindow::saveProjectRecovery(const std::string destination) {
+void ApplicationWindow::saveProjectRecovery(std::string destination) {
   const bool isRecovery = true;
   ProjectSerialiser projectWriter(this, isRecovery);
   projectWriter.save(QString::fromStdString(destination));
diff --git a/MantidPlot/src/ApplicationWindow.h b/MantidPlot/src/ApplicationWindow.h
index 1493b742cbe..6d26102ef03 100644
--- a/MantidPlot/src/ApplicationWindow.h
+++ b/MantidPlot/src/ApplicationWindow.h
@@ -1123,7 +1123,9 @@ public slots:
 
   bool isOfType(const QObject *obj, const char *toCompare) const;
 
-  void saveProjectRecovery(const std::string destination);
+  // Note: The string must be copied from the other thread in saveProjectRecovery
+  /// Saves the current project as part of recovery auto saving
+  void saveProjectRecovery(std::string destination); 
 
 signals:
   void modified();
-- 
GitLab