From 9e8c979f3e910759152ea8ea19908341c1df3e56 2017-07-04 07:40:34 From: Alexandre Leroux Date: 2017-07-04 07:40:34 Subject: [PATCH] Variable deletion (6) Creates the signal that prevents other controllers that a variable will be deleted from the VariableController --- diff --git a/core/include/Visualization/VisualizationController.h b/core/include/Visualization/VisualizationController.h index 9664fe6..97937e6 100644 --- a/core/include/Visualization/VisualizationController.h +++ b/core/include/Visualization/VisualizationController.h @@ -26,6 +26,8 @@ public: virtual ~VisualizationController(); signals: + /// Signal emitted when a variable is about to be deleted from SciQlop + void variableAboutToBeDeleted(std::shared_ptr variable); /// Signal emitted when a variable has been created in SciQlop void variableCreated(std::shared_ptr variable); diff --git a/core/src/Variable/VariableController.cpp b/core/src/Variable/VariableController.cpp index b156724..c0c8034 100644 --- a/core/src/Variable/VariableController.cpp +++ b/core/src/Variable/VariableController.cpp @@ -89,6 +89,9 @@ void VariableController::deleteVariable(std::shared_ptr variable) noex return; } + // Spreads in SciQlop that the variable will be deleted, so that potential receivers can + // make some treatments before the deletion + emit variableAboutToBeDeleted(variable); // Deletes provider auto nbProvidersDeleted = impl->m_VariableToProviderMap.erase(variable);