From 792793b6ed4ff9aafb806550d5ca89d890d10984 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 26 Aug 2015 14:32:49 +0200 Subject: [PATCH] Generalized update --- .../defaultfeatures/cafCmdAddItemExec.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Fwk/AppFwk/cafCommand/defaultfeatures/cafCmdAddItemExec.cpp b/Fwk/AppFwk/cafCommand/defaultfeatures/cafCmdAddItemExec.cpp index 802e143ee8..33ead62abe 100644 --- a/Fwk/AppFwk/cafCommand/defaultfeatures/cafCmdAddItemExec.cpp +++ b/Fwk/AppFwk/cafCommand/defaultfeatures/cafCmdAddItemExec.cpp @@ -99,17 +99,11 @@ void CmdAddItemExec::redo() m_commandData->m_createdItemIndex = m_commandData->m_indexAfter; } - if (m_notificationCenter) m_notificationCenter->notifyObserversOfDataChange(obj); - listField->uiCapability()->updateConnectedEditors(); if (listField->ownerObject()) { - caf::PdmUiObjectHandle* ownerUiObject = uiObj(listField->ownerObject()); - if (ownerUiObject) - { - ownerUiObject->fieldChangedByUi(listField, QVariant(), QVariant()); - } + listField->ownerObject()->uiCapability()->updateConnectedEditors(); } } } @@ -132,17 +126,12 @@ void CmdAddItemExec::undo() caf::SelectionManager::instance()->removeObjectFromAllSelections(obj); listField->erase(m_commandData->m_createdItemIndex); - listField->uiCapability()->updateConnectedEditors(); - if (m_notificationCenter) m_notificationCenter->notifyObservers(); + listField->uiCapability()->updateConnectedEditors(); if (listField->ownerObject()) { - caf::PdmUiObjectHandle* ownerUiObject = uiObj(listField->ownerObject()); - if (ownerUiObject) - { - ownerUiObject->fieldChangedByUi(listField, QVariant(), QVariant()); - } + listField->ownerObject()->uiCapability()->updateConnectedEditors(); } delete obj;