diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-07-10 22:40:06 +0200 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2019-07-12 09:59:28 +0200 |
commit | f93e0aafd52be47b99132a0d38629e1dffaaaa9e (patch) | |
tree | ca567559dedee56903a901569df4246ea43d195d /profile-widget/profilewidget2.cpp | |
parent | 2d9dc40171c261fc6c907badb871d6735d59787a (diff) | |
download | subsurface-f93e0aafd52be47b99132a0d38629e1dffaaaa9e.tar.gz |
Profile: store animation speed in profile object
When exporting dive pictures we don't want animations. Therefore,
store the animation speed in the profile object to avoid nasty
hacks with the preferences.
This actually removes such a hack. Pictures and tooltips for now
still use the values stored in the preferences, because their
animations happen only on user-interactions.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/profilewidget2.cpp')
-rw-r--r-- | profile-widget/profilewidget2.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 9eefb0fc1..c2514e59e 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -594,10 +594,9 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict } // special handling for the first time we display things - int animSpeedBackup = 0; + animSpeed = qPrefDisplay::animation_speed(); if (firstCall && haveFilesOnCommandLine()) { - animSpeedBackup = qPrefDisplay::animation_speed(); - qPrefDisplay::set_animation_speed(0); + animSpeed = 0; firstCall = false; } @@ -814,9 +813,6 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict dcText += tr(" (#%1 of %2)").arg(dc_number + 1).arg(nr); #endif diveComputerText->setText(dcText); - if (haveFilesOnCommandLine() && animSpeedBackup != 0) { - qPrefDisplay::set_animation_speed(animSpeedBackup); - } #ifndef SUBSURFACE_MOBILE if (currentState == ADD || currentState == PLAN) { // TODO: figure a way to move this from here. |