aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified
diff options
context:
space:
mode:
authorZackaryWelch <welch.zackary@gmail.com>2018-01-02 15:09:49 -0500
committerZackaryWelch <welch.zackary@gmail.com>2018-01-02 15:09:49 -0500
commit2287ab5e5edad3e843c4dac1c10ed6f43bc9f32d (patch)
tree9765373240926d103df307518b746c428af3b3a6 /src-qt5/core/lumina-desktop-unified
parentImproved some of the code in the screensaver plugins file (diff)
downloadlumina-2287ab5e5edad3e843c4dac1c10ed6f43bc9f32d.tar.gz
lumina-2287ab5e5edad3e843c4dac1c10ed6f43bc9f32d.tar.bz2
lumina-2287ab5e5edad3e843c4dac1c10ed6f43bc9f32d.zip
Started a framework for desktop plugins and modified the screensaver plugins to inherit from a base plugin system
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp7
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.h5
2 files changed, 8 insertions, 4 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp b/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp
index 7c098887..aa3214a2 100644
--- a/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.cpp
@@ -7,6 +7,9 @@
#include "SSBaseWidget.h"
+//Relative directory to search along the XDG paths for screensavers
+#define REL_DIR QString("/lumina-desktop/screensavers")
+
#define DEBUG 0
// ========
@@ -39,10 +42,10 @@ void SSBaseWidget::startPainting(){
stopPainting();
//If a random plugin - grab one of the known plugins
if(plugType=="random"){
- QList<SSPlugin> valid = SSPluginSystem::findAllPlugins();
+ QList<SSPlugin> valid = PluginSystem::findAllPlugins<SSPlugin>(REL_DIR);
if(!valid.isEmpty()){ cplug = valid[ qrand()%valid.length() ]; } //grab a random plugin
}else if(plugType!="none"){
- cplug = SSPluginSystem::findPlugin(plugType);
+ cplug = PluginSystem::findPlugin<SSPlugin>(plugType, REL_DIR);
}
if(DEBUG){ qDebug() << " - Screen Saver:" << plugType << cplug.scriptURL() << cplug.isValid(); }
if(cplug.isValid()){
diff --git a/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.h b/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.h
index 72e02702..e0a03d17 100644
--- a/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.h
+++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/SSBaseWidget.h
@@ -10,6 +10,7 @@
#define _LUMINA_DESKTOP_SCREEN_SAVER_BASE_WIDGET_H
#include "global-includes.h"
+#include <plugins-base.h>
#include <plugins-screensaver.h>
class SSBaseWidget : public QQuickView{
@@ -25,8 +26,8 @@ public slots:
void stopPainting();
private:
- QString plugType;
- SSPlugin cplug;
+ QString plugType;
+ SSPlugin cplug;
QTimer *restartTimer;
private slots:
bgstack15