mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
6a8d929876
commit
cdf83f5ef6
3 changed files with 10 additions and 13 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue