aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/src-cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/src-cpp')
-rw-r--r--src-qt5/src-cpp/framework-OSInterface.h2
-rw-r--r--src-qt5/src-cpp/framework-OSInterface_private.cpp9
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
bgstack15