aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaUtils.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-06-11 20:51:19 -0400
committerKen Moore <ken@pcbsd.org>2015-06-11 20:51:19 -0400
commitac15e22fe559bbfc267d99237674fba5a879806f (patch)
treefdb4cce3eeb5ecefcd3f61c9f3cdd40c99723ca3 /libLumina/LuminaUtils.cpp
parentOops, forgot to save/commit the new fields in the luminaDesktop.conf gile. (diff)
downloadlumina-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.cpp15
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;
bgstack15