summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/animationfunctions.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2014-04-08 13:45:23 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-04-11 07:21:15 -0700
commitcdf83f5ef6415eb44cc95e993ab38b4b44f03427 (patch)
tree262c135a0c141eb7f20cc14b6580219f26be9e86 /qt-ui/profile/animationfunctions.cpp
parent6a8d929876f5a8d0279d2a83248a5d7b59e0ae39 (diff)
downloadsubsurface-cdf83f5ef6415eb44cc95e993ab38b4b44f03427.tar.gz
Change some references of QSettings to the pref struct.
After adding the animation member in the preference struct, it is very resonable to change these references of QSettings to the preference structure instead. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/animationfunctions.cpp')
-rw-r--r--qt-ui/profile/animationfunctions.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/qt-ui/profile/animationfunctions.cpp b/qt-ui/profile/animationfunctions.cpp
index 81fbf5eee..05e437cf0 100644
--- a/qt-ui/profile/animationfunctions.cpp
+++ b/qt-ui/profile/animationfunctions.cpp
@@ -1,7 +1,8 @@
#include "animationfunctions.h"
+#include "dive.h"
+#include "pref.h"
#include <QPropertyAnimation>
#include <QPointF>
-#include <QSettings>
namespace Animations
{
@@ -25,12 +26,9 @@ namespace Animations
void moveTo(QObject *obj, qreal x, qreal y)
{
- QSettings s;
- s.beginGroup("Animations");
- int msecs = s.value("animation_speed", 500).toInt();
- if (msecs != 0){
+ if (prefs.animation != 0){
QPropertyAnimation *animation = new QPropertyAnimation(obj, "pos");
- animation->setDuration(msecs);
+ animation->setDuration(prefs.animation);
animation->setStartValue(obj->property("pos").toPointF());
animation->setEndValue(QPointF(x, y));
animation->start(QAbstractAnimation::DeleteWhenStopped);