diff options
author | Ken Moore <ken@ixsystems.com> | 2018-01-30 05:49:30 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2018-01-30 05:49:30 -0500 |
commit | fc138f1492c0275215327cfe698587916107b69f (patch) | |
tree | f1db15573ee9e8ecf7618214cf28f381ba6c0632 /src-qt5/src-cpp | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-fc138f1492c0275215327cfe698587916107b69f.tar.gz lumina-fc138f1492c0275215327cfe698587916107b69f.tar.bz2 lumina-fc138f1492c0275215327cfe698587916107b69f.zip |
A few couple other attempts at the layering issue.
Tie-in the new OSInterface class to the QML data store (RootObject).
This will allow the new system status functions to be accessible to the QML interface.
Diffstat (limited to 'src-qt5/src-cpp')
-rw-r--r-- | src-qt5/src-cpp/framework-OSInterface.h | 2 | ||||
-rw-r--r-- | src-qt5/src-cpp/framework-OSInterface_private.cpp | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src-qt5/src-cpp/framework-OSInterface.h b/src-qt5/src-cpp/framework-OSInterface.h index f8345bac..88f4d10a 100644 --- a/src-qt5/src-cpp/framework-OSInterface.h +++ b/src-qt5/src-cpp/framework-OSInterface.h @@ -243,6 +243,6 @@ public: ~OSInterface(); static OSInterface* instance(); //Get the currently-active instance of this class (or make a new one) - + static void RegisterType(); //Register this object for QML access }; #endif diff --git a/src-qt5/src-cpp/framework-OSInterface_private.cpp b/src-qt5/src-cpp/framework-OSInterface_private.cpp index d633fe9a..66ac7d8e 100644 --- a/src-qt5/src-cpp/framework-OSInterface_private.cpp +++ b/src-qt5/src-cpp/framework-OSInterface_private.cpp @@ -9,6 +9,8 @@ #include <framework-OSInterface.h> #include <QtConcurrent> +#include <QQmlEngine> + OSInterface::OSInterface(QObject *parent) : QObject(parent){ watcher = 0; iodevice = 0; @@ -38,6 +40,13 @@ OSInterface* OSInterface::instance(){ return m_os_object; } +void OSInterface::RegisterType(){ + static bool done = false; + if(done){ return; } + done=true; + qmlRegisterType<OSInterface>("Lumina.Backend.OSInterface", 2, 0, "OSInterface"); +} + //Start/stop interface systems void OSInterface::start(){ if(!mediaDirectories().isEmpty()){ setupMediaWatcher(); }//will create/connect the filesystem watcher automatically |