aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/BaseAnimGroup.cpp
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/BaseAnimGroup.cpp
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/BaseAnimGroup.cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-screensaver/animations/BaseAnimGroup.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/BaseAnimGroup.cpp b/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/BaseAnimGroup.cpp
index c8a248c0..477724e3 100644
--- a/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/BaseAnimGroup.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/BaseAnimGroup.cpp
@@ -15,27 +15,37 @@
#include "ImageSlideshow.h"
#include "VideoSlideshow.h"
+
+QVariant BaseAnimGroup::readSetting(QString variable, QVariant defaultvalue){
+ return DesktopSettings::instance()->value(DesktopSettings::ScreenSaver,
+ "Animations/"+animPlugin+"/"+variable, defaultvalue);
+}
+
//==============================
// PLUGIN LOADING/LISTING
//==============================
-BaseAnimGroup* BaseAnimGroup::NewAnimation(QString type, QWidget *parent, QSettings *set){
+BaseAnimGroup* BaseAnimGroup::NewAnimation(QString type, QWidget *parent){
//This is where we place all the known plugin ID's, and load the associated subclass
+ BaseAnimGroup *anim = 0;
if(type=="fireflies"){
- return (new FirefliesAnimation(parent,set));
+ anim = new FirefliesAnimation(parent);
}else if(type == "grav") {
- return (new GravAnimation(parent, set));
+ anim = new GravAnimation(parent);
}else if(type == "text") {
- return (new TextAnimation(parent, set));
+ anim = new TextAnimation(parent);
}else if(type == "imageSlideshow") {
- return (new ImageAnimation(parent, set));
+ anim = new ImageAnimation(parent);
}else if(type == "videoSlideshow") {
- return (new VideoAnimation(parent, set));
+ anim = new VideoAnimation(parent);
}else {
//Unknown screensaver, return a blank animation group
- return (new BaseAnimGroup(parent, set));
+ anim = new BaseAnimGroup(parent);
}
+ //tag the animation with the type it is and return it
+ if(anim!=0){ anim->animPlugin = type; }
+ return anim;
}
QStringList BaseAnimGroup::KnownAnimations(){
- return (QStringList() << "imageSlideshow" /*<< "grav" << "text" << "imageSlideshow" << "fireflies"*/);
+ return (QStringList() << "grav" << "text" << "imageSlideshow" << "videoSlideshow" << "fireflies");
}
bgstack15