diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2019-04-08 17:55:46 +0300 |
---|---|---|
committer | Rebecca Worledge <rebecca.worledge@theqtcompany.com> | 2019-04-09 02:52:38 +0000 |
commit | fa0b3f9bf148ecefb2ddef124ac753937cc643c4 (patch) | |
tree | 04692ed944cd1ed7d60217c50bc1a8ac0cea552c | |
parent | 2a9f3fe967601d0ff7f113dc6ea5ae5e03f533b4 (diff) |
LottieAnimation: fix state transition on animation load error
the proper transition should be Null -> Loading -> (Ready|Error)
Change-Id: I532d9b5616d552146eddeb3727a1c1d252516b3f
Reviewed-by: Rebecca Worledge <rebecca.worledge@theqtcompany.com>
-rw-r--r-- | src/imports/lottieanimation.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/imports/lottieanimation.cpp b/src/imports/lottieanimation.cpp index bb3c510..dddf88a 100644 --- a/src/imports/lottieanimation.cpp +++ b/src/imports/lottieanimation.cpp @@ -555,6 +555,9 @@ void LottieAnimation::setDirection(LottieAnimation::Direction direction) bool LottieAnimation::loadSource(QString filename) { + m_status = Loading; + emit statusChanged(); + QFile sourceFile(filename); if (!sourceFile.open(QIODevice::ReadOnly)) { m_status = Error; @@ -562,9 +565,6 @@ bool LottieAnimation::loadSource(QString filename) return false; } - m_status = Loading; - emit statusChanged(); - QByteArray json = sourceFile.readAll(); parse(json); |