diff --git a/genericcore.cpp b/genericcore.cpp index 96f07a3..34ef9dd 100644 --- a/genericcore.cpp +++ b/genericcore.cpp @@ -76,12 +76,10 @@ bool GenericCore::isApplicationUpdateAvailable() { return true; } -void GenericCore::triggerApplicationUpdate() { - // TODO include cleaness of undo stack - // if (!m_undoStack->isClean()) { - // saveItems(); - // } - // QStringList args("update componentA componentB"); +void GenericCore::triggerApplicationUpdate(const bool saveChanges) { + if (saveChanges && !m_modelUndoStack->isClean()) { + saveItems(); + } QStringList args("--start-updater"); QString toolFilePath = getMaintenanceToolFilePath(); QProcess::startDetached(toolFilePath, args); diff --git a/genericcore.h b/genericcore.h index e3c1e5f..b25135c 100644 --- a/genericcore.h +++ b/genericcore.h @@ -20,7 +20,7 @@ class GenericCore : public QObject { void sayHello() const; bool isApplicationUpdateAvailable(); - void triggerApplicationUpdate(); + void triggerApplicationUpdate(const bool saveChanges); QUndoStack* getModelUndoStack() const; std::shared_ptr getModel() const;