aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/Grav.h
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-08-30 05:22:30 -0400
committerKen Moore <ken@ixsystems.com>2017-08-30 05:22:30 -0400
commit50384966b759498167365867d49a5df120b1fe26 (patch)
tree145a68394d8070f7bb0a0938c46cf898987c99d1 /src-qt5/core/lumina-desktop-unified/src-screensaver/animations/Grav.h
parentMake sure the context menu label is center-aligned (diff)
downloadlumina-50384966b759498167365867d49a5df120b1fe26.tar.gz
lumina-50384966b759498167365867d49a5df120b1fe26.tar.bz2
lumina-50384966b759498167365867d49a5df120b1fe26.zip
Clean up the use of the settings files within the entire screensaver system.
Also fix some minor whitespace/alignment in code, and add fallback routines to a couple screensavers which need external files (so they don't crash if nothing was setup or a directory is empty)
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-screensaver/animations/Grav.h')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-screensaver/animations/Grav.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/Grav.h b/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/Grav.h
index 50d733e9..099e6645 100644
--- a/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/Grav.h
+++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/Grav.h
@@ -36,7 +36,7 @@ private:
double xrand = 0.4; //(qrand()%10+4)/10.0;
double yrand = 0.4; //(qrand()%10+4)/10.0;
- double theta = 1.5707963;
+ double theta = 1.5707963;
//double theta = aTan((start.x() - ref->x())/(start.y() - ref->y()));
QMatrix rotation = QMatrix(qCos(theta), qSin(theta), -qSin(theta), qCos(theta), -ref->x(), -ref->y());
qDebug() << rotation;
@@ -46,9 +46,9 @@ private:
//qDebug() << "Center" << *ref;
QPoint firstP = (QPoint(ref->x() + xrand*start.x()*(qCos(0/step) -qSin(0/step)), ref->y() + yrand*start.y()*(qCos(0/step) -qSin(0/step))));
- QPoint rotFP = rotation.map(firstP);
+ QPoint rotFP = rotation.map(firstP);
qDebug() << "First Point" << firstP;
- qDebug() << "Rotation by Matrix" << rotFP;
+ qDebug() << "Rotation by Matrix" << rotFP;
QPoint lastP = (QPoint(ref->x() + xrand*start.x()*(qCos(PI/step) -qSin(PI/step)), ref->y() + yrand*start.y()*(qCos(PI/step) -qSin(PI/step))));
orbit->setKeyValueAt(0, firstP);
orbit->setKeyValueAt(1, lastP);
@@ -145,7 +145,7 @@ private slots:
}
public:
- GravAnimation(QWidget *parent, QSettings *set) : BaseAnimGroup(parent, set){}
+ GravAnimation(QWidget *parent) : BaseAnimGroup(parent){}
~GravAnimation(){
sun->deleteLater();
while(planets.length()>0){ planets.takeAt(0)->deleteLater(); }
@@ -179,7 +179,7 @@ public:
canvas->setStyleSheet("background: black;");
//Pulls number of planets from settings, with 10 as default
- int number = settings->value("planets/number",10).toInt();
+ int number = readSetting("planets/number",qrand()%5+3).toInt();
//Loops through all planets and sets up the animations, then adds them to the base group and vector, which
qDebug() << "Starting planets";
bgstack15