From f5e9591be7371f1a63518b3f100c425f1cc8bef5 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 4 Jul 2015 21:53:59 +0000 Subject: [PATCH] Fixed the timeline not updating correctly when using Show Earlier. --- common/lc_timelinewidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/lc_timelinewidget.cpp b/common/lc_timelinewidget.cpp index 882b05b8..32534df6 100644 --- a/common/lc_timelinewidget.cpp +++ b/common/lc_timelinewidget.cpp @@ -175,8 +175,10 @@ void lcTimelineWidget::Update(bool Clear) { if (PieceItemIndex >= StepItem->childCount() || PieceItem != StepItem->child(PieceItemIndex)) { - if (PieceItem->parent() == StepItem) - StepItem->removeChild(PieceItem); + QTreeWidgetItem* PieceParent = PieceItem->parent(); + + if (PieceParent) + PieceParent->removeChild(PieceItem); StepItem->insertChild(PieceItemIndex, PieceItem); }