From 2287ab5e5edad3e843c4dac1c10ed6f43bc9f32d Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Tue, 2 Jan 2018 15:09:49 -0500 Subject: Started a framework for desktop plugins and modified the screensaver plugins to inherit from a base plugin system --- src-qt5/src-cpp/plugins-desktop.cpp | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src-qt5/src-cpp/plugins-desktop.cpp (limited to 'src-qt5/src-cpp/plugins-desktop.cpp') diff --git a/src-qt5/src-cpp/plugins-desktop.cpp b/src-qt5/src-cpp/plugins-desktop.cpp new file mode 100644 index 00000000..fdbd676d --- /dev/null +++ b/src-qt5/src-cpp/plugins-desktop.cpp @@ -0,0 +1,40 @@ +//=========================================== +// Lumina-desktop source code +// Copyright (c) 2017, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#include "plugins-desktop.h" + +// ============ +// DT PLUGIN +// ============ +DTPlugin::DTPlugin(){ + +} + +DTPlugin::~DTPlugin(){ + +} + +bool DTPlugin::isValid(){ + if(data.isEmpty()){ return false; } + bool ok = data.contains("name") && data.contains("qml") && data.contains("description"); + ok &= containsDefault("name"); + ok &= containsDefault("description"); + if(ok) { + QJsonObject tmp = data.value("qml").toObject(); + QStringList mustexist; + QString exec = tmp.value("exec").toString(); + if(exec.isEmpty() || !exec.endsWith(".qml")){ return false; } + mustexist << exec; + QJsonArray tmpA = data.value("additional_files").toArray(); + for(int i=0; i