From f93e0aafd52be47b99132a0d38629e1dffaaaa9e Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 10 Jul 2019 22:40:06 +0200 Subject: 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 --- profile-widget/profilewidget2.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'profile-widget/profilewidget2.cpp') 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. -- cgit v1.2.3-70-g09d2