diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-09-14 13:58:44 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-12-27 07:27:45 +0000 |
commit | 6c5b2c367d7cfc92563986b35c99f410f2ac42aa (patch) | |
tree | 0056c73a119cc22ca5f8644552442d3221b39b7d /src/quick/items/qquickanimatedimage_p_p.h | |
parent | c7ebd4109a8c97164cfe8e1b8fca5a66a701cfa0 (diff) |
QQuickAnimatedImagePrivate::setMovie: check for re-assignment; cleanup
There's no need to delete the movie if the same one is being re-assigned.
Also, reorder, rename and clean up the variables. Followup to
bb02a577f0fbf3bd2a273129e6cb57cfc9a338c8
Task-number: QTBUG-62913
Change-Id: I1fc57b411bfbd819b88be20f5933db8c13e9aba0
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickanimatedimage_p_p.h')
-rw-r--r-- | src/quick/items/qquickanimatedimage_p_p.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/quick/items/qquickanimatedimage_p_p.h b/src/quick/items/qquickanimatedimage_p_p.h index 68c4f2d359..85508459f9 100644 --- a/src/quick/items/qquickanimatedimage_p_p.h +++ b/src/quick/items/qquickanimatedimage_p_p.h @@ -70,28 +70,29 @@ class QQuickAnimatedImagePrivate : public QQuickImagePrivate public: QQuickAnimatedImagePrivate() - : playing(true), paused(false), preset_currentframe(0), _movie(0), oldPlaying(false) + : playing(true), paused(false), oldPlaying(false), presetCurrentFrame(0) + , currentSourceSize(0, 0), movie(nullptr) #if QT_CONFIG(qml_network) - , reply(0), redirectCount(0) + , reply(nullptr), redirectCount(0) #endif - , currentSourceSize(0, 0) { } QQuickPixmap *infoForCurrentFrame(QQmlEngine *engine); + void setMovie(QMovie *movie); - bool playing; - bool paused; - int preset_currentframe; - QMovie *_movie; - bool oldPlaying; + bool playing : 1; + bool paused : 1; + bool oldPlaying : 1; + unsigned padding: 29; + int presetCurrentFrame; + QSize currentSourceSize; + QMovie *movie; #if QT_CONFIG(qml_network) QNetworkReply *reply; int redirectCount; #endif QMap<int, QQuickPixmap *> frameMap; - QSize currentSourceSize; - void setMovie(QMovie *movie); }; QT_END_NAMESPACE |