summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio/Palettes
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2018-08-27 15:28:49 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2018-08-27 15:09:22 +0000
commit88b14898a965140e065c21141df0cab1de1fb539 (patch)
tree58f8b2a9fe1347ca8f46b81ca880405cc5eaf28e /src/Authoring/Studio/Palettes
parent6e648526be2d260e6164cfb04b0f4b8af92a9dcc (diff)
Fix crash when checking object type
Crash happened because we checked for object type before we were sure the instance was an actual object and not e.g. an action. Refactored the check to be done only when sourcepath property changes, as that's only when we need to check. Task-number: QT3DS-2131 Change-Id: I6cab0c8f8f8c0277f5b84a510c8d7fcf764a9612 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes')
-rw-r--r--src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp
index f533e960..2c4b3b28 100644
--- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp
+++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp
@@ -701,24 +701,22 @@ void TimelineWidget::onPropertyChanged(qt3dsdm::Qt3DSDMInstanceHandle inInstance
const SDataModelSceneAsset &asset = m_bridge->GetSceneAsset();
CDoc *doc = g_StudioApp.GetCore()->GetDoc();
- EStudioObjectType instanceType = m_bridge->GetObjectType(inInstance);
auto ctrldPropHandle = doc->GetPropertySystem()
- ->GetAggregateInstancePropertyByName(inInstance, L"controlledproperty");
+ ->GetAggregateInstancePropertyByName(inInstance, L"controlledproperty");
if (inProperty == asset.m_Eyeball || inProperty == asset.m_Locked || inProperty == asset.m_Shy
- || inProperty == asset.m_StartTime || inProperty == asset.m_EndTime
- || inProperty == m_bridge->GetNameProperty() || inProperty == ctrldPropHandle) {
+ || inProperty == asset.m_StartTime || inProperty == asset.m_EndTime
+ || inProperty == m_bridge->GetNameProperty() || inProperty == ctrldPropHandle) {
m_dirtyProperties.insert(inInstance, inProperty);
if (!m_asyncUpdateTimer.isActive())
m_asyncUpdateTimer.start();
- } else if ((instanceType == OBJTYPE_LAYER && inProperty == m_bridge->GetSourcePathProperty())
- || (instanceType == OBJTYPE_IMAGE && inProperty == m_bridge->GetSceneImage()
- .m_SubPresentation)) {
- // subpresentation property change
- m_subpresentationChanges.insert(inInstance);
- if (!m_asyncUpdateTimer.isActive())
- m_asyncUpdateTimer.start();
- }
+ } else if (inProperty == m_bridge->GetSceneImage().m_SubPresentation
+ || (inProperty == m_bridge->GetSourcePathProperty()
+ && m_bridge->GetObjectType(inInstance) == OBJTYPE_LAYER)) {
+ m_subpresentationChanges.insert(inInstance);
+ if (!m_asyncUpdateTimer.isActive())
+ m_asyncUpdateTimer.start();
+ }
}
void TimelineWidget::onAsyncUpdate()