From 46350c386050415f996cfa24ed3cc971c2ae97dc Mon Sep 17 00:00:00 2001 From: Claveau Joshua Date: Sun, 29 Mar 2020 18:48:19 +0200 Subject: [PATCH] Try it Laurent --- .../undocommand/changeelementinformationcommand.cpp | 10 ++++++++++ sources/undocommand/changeelementinformationcommand.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/sources/undocommand/changeelementinformationcommand.cpp b/sources/undocommand/changeelementinformationcommand.cpp index cd601d3d0..8b6862383 100644 --- a/sources/undocommand/changeelementinformationcommand.cpp +++ b/sources/undocommand/changeelementinformationcommand.cpp @@ -17,6 +17,7 @@ */ #include "changeelementinformationcommand.h" #include "element.h" +#include "diagram.h" #include /** @@ -49,6 +50,7 @@ bool ChangeElementInformationCommand::mergeWith(const QUndoCommand *other) */ void ChangeElementInformationCommand::undo() { m_element -> setElementInformations(m_old_info); + updateProjectDB(); } /** @@ -56,4 +58,12 @@ void ChangeElementInformationCommand::undo() { */ void ChangeElementInformationCommand::redo() { m_element -> setElementInformations(m_new_info); + updateProjectDB(); +} + +void ChangeElementInformationCommand::updateProjectDB() +{ + if(m_element->diagram()) { + m_element->diagram()->project()->dataBase()->updateDB(); + } } diff --git a/sources/undocommand/changeelementinformationcommand.h b/sources/undocommand/changeelementinformationcommand.h index 3fd5deee2..cfa4d5322 100644 --- a/sources/undocommand/changeelementinformationcommand.h +++ b/sources/undocommand/changeelementinformationcommand.h @@ -37,6 +37,9 @@ class ChangeElementInformationCommand : public QUndoCommand void undo() override; void redo() override; + private: + void updateProjectDB(); + private: Element *m_element; DiagramContext m_old_info,