From ed1acadedada8893e6e4c0fc1bfa8d4884165814 Mon Sep 17 00:00:00 2001 From: Marcos Bento Date: Tue, 29 Oct 2024 16:08:22 +0000 Subject: [PATCH] Avoid incorrect error message related to renamed session configuration file Re ECFLOW-1980 --- Viewer/ecflowUI/src/SessionHandler.cpp | 7 +++++++ Viewer/ecflowUI/src/SessionHandler.hpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Viewer/ecflowUI/src/SessionHandler.cpp b/Viewer/ecflowUI/src/SessionHandler.cpp index cd46cec57..d96498efe 100644 --- a/Viewer/ecflowUI/src/SessionHandler.cpp +++ b/Viewer/ecflowUI/src/SessionHandler.cpp @@ -36,6 +36,13 @@ SessionItem::~SessionItem() { } } +void SessionItem::name(const std::string& name) { + name_ = name; + // Since the name changes, we need to update the related directory paths + dirPath_ = SessionHandler::sessionDirName(name_); + qtPath_ = SessionHandler::sessionQtDirName(name_); +} + void SessionItem::checkDir() { dirPath_ = SessionHandler::sessionDirName(name_); DirectoryHandler::createDir(dirPath_); diff --git a/Viewer/ecflowUI/src/SessionHandler.hpp b/Viewer/ecflowUI/src/SessionHandler.hpp index 47fa68c48..e114c21ad 100644 --- a/Viewer/ecflowUI/src/SessionHandler.hpp +++ b/Viewer/ecflowUI/src/SessionHandler.hpp @@ -21,7 +21,7 @@ class SessionItem { explicit SessionItem(const std::string&); virtual ~SessionItem(); - void name(const std::string& name) { name_ = name; } + void name(const std::string& name); const std::string& name() const { return name_; } std::string sessionFile() const;