From fc138f1492c0275215327cfe698587916107b69f Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 30 Jan 2018 05:49:30 -0500 Subject: 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. --- src-qt5/src-cpp/framework-OSInterface.h | 2 +- src-qt5/src-cpp/framework-OSInterface_private.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src-qt5/src-cpp') 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 #include +#include + 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("Lumina.Backend.OSInterface", 2, 0, "OSInterface"); +} + //Start/stop interface systems void OSInterface::start(){ if(!mediaDirectories().isEmpty()){ setupMediaWatcher(); }//will create/connect the filesystem watcher automatically -- cgit