From ac15e22fe559bbfc267d99237674fba5a879806f Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 11 Jun 2015 20:51:19 -0400 Subject: Add two new plugins for Lumina: QuickPPlugin, QuickDPlugin (panel/desktop respectively). These are QtQuick "containers" which allow the loading of user/system supplied QML scripts for non-compiled plugin support. These plugins must be single *.qml files located in /quickplugins/*.qml or ~/.lumina/quickplugins/*.qml --- libLumina/LuminaUtils.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libLumina/LuminaUtils.cpp') diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index 7d53af3e..b569782e 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -181,6 +181,21 @@ double LUtils::DisplaySizeToBytes(QString num){ return N; } +//Various function for finding valid QtQuick plugins on the system +bool LUtils::validQuickPlugin(QString ID){ + return ( !LUtils::findQuickPluginFile(ID).isEmpty() ); +} + +QString LUtils::findQuickPluginFile(QString ID){ + if(ID.startsWith("quick-")){ ID = ID.section("-",1,50); } + //Give preference to any user-supplied plugins (overwrites for system plugins) + QString path = QDir::homePath()+"/.lumina/quickplugins/"+ID+".qml"; + if( QFile::exists(path) ){return path; } + path = LOS::LuminaShare()+"quickplugins/"+ID+".qml"; + if( QFile::exists(path) ){return path; } + return ""; //could not be found +} + QStringList LUtils::listFavorites(){ static QStringList fav; static QDateTime lastRead; -- cgit