diff options
author | ZackaryWelch <welch.zackary@gmail.com> | 2018-01-02 15:09:49 -0500 |
---|---|---|
committer | ZackaryWelch <welch.zackary@gmail.com> | 2018-01-02 15:09:49 -0500 |
commit | 2287ab5e5edad3e843c4dac1c10ed6f43bc9f32d (patch) | |
tree | 9765373240926d103df307518b746c428af3b3a6 /src-qt5/src-cpp/plugins-screensaver.h | |
parent | Improved some of the code in the screensaver plugins file (diff) | |
download | lumina-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/src-cpp/plugins-screensaver.h')
-rw-r--r-- | src-qt5/src-cpp/plugins-screensaver.h | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/src-qt5/src-cpp/plugins-screensaver.h b/src-qt5/src-cpp/plugins-screensaver.h index 08210147..042f824d 100644 --- a/src-qt5/src-cpp/plugins-screensaver.h +++ b/src-qt5/src-cpp/plugins-screensaver.h @@ -4,44 +4,26 @@ // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== -// This is a simple class for managing all the various desktop -// screensaver plugins that could be available -//=========================================== -// NOTE: -// This class has a heirarchy-based lookup system -// USER plugins > SYSTEM plugins -// XDG_DATA_HOME/lumina-desktop/screensavers > XDG_DATA_DIRS/lumina-desktop/screensavers -//=========================================== #ifndef _LUMINA_DESKTOP_SCREENSAVER_PLUGINS_CLASS_H #define _LUMINA_DESKTOP_SCREENSAVER_PLUGINS_CLASS_H +#include "plugins-base.h" #include <QJsonObject> #include <QString> #include <QUrl> #include <QObject> +#include <QJsonDocument> +#include <QJsonArray> +#include <QFile> +#include <QDir> +#include <QDebug> -class SSPlugin{ -private: - QString currentfile; - QJsonObject data; //Hazardous to manually modify - bool containsDefault(QString obj) { return data.value(obj).toObject().contains("default"); } - +class SSPlugin : public BasePlugin { public: SSPlugin(); ~SSPlugin(); - void loadFile(QString path); - bool isLoaded(); - bool isValid(); - QString translatedObject(QString obj); - QUrl scriptURL(); -}; - -class SSPluginSystem{ -public: - static SSPlugin findPlugin(QString name); - static QList<SSPlugin> findAllPlugins(bool validonly = true); - + virtual bool isValid() Q_DECL_OVERRIDE; }; #endif |