diff options
author | Ken Moore <ken@pcbsd.org> | 2015-06-11 20:51:19 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-06-11 20:51:19 -0400 |
commit | ac15e22fe559bbfc267d99237674fba5a879806f (patch) | |
tree | fdb4cce3eeb5ecefcd3f61c9f3cdd40c99723ca3 /libLumina/LuminaUtils.cpp | |
parent | Oops, forgot to save/commit the new fields in the luminaDesktop.conf gile. (diff) | |
download | lumina-ac15e22fe559bbfc267d99237674fba5a879806f.tar.gz lumina-ac15e22fe559bbfc267d99237674fba5a879806f.tar.bz2 lumina-ac15e22fe559bbfc267d99237674fba5a879806f.zip |
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 <Lumina Share>/quickplugins/*.qml or ~/.lumina/quickplugins/*.qml
Diffstat (limited to 'libLumina/LuminaUtils.cpp')
-rw-r--r-- | libLumina/LuminaUtils.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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; |