summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/CMakeLists.txt2
-rw-r--r--core/plannershared.cpp9
-rw-r--r--core/plannershared.h24
3 files changed, 35 insertions, 0 deletions
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index eb7185812..376cfda4f 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -72,6 +72,8 @@ set(SUBSURFACE_CORE_LIB_SRCS
divelist.h
divelogexportlogic.cpp
divelogexportlogic.h
+ plannershared.cpp
+ plannershared.h
divesite-helper.cpp
divesite.c
divesite.h
diff --git a/core/plannershared.cpp b/core/plannershared.cpp
new file mode 100644
index 000000000..ddfc73642
--- /dev/null
+++ b/core/plannershared.cpp
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "plannershared.h"
+
+
+plannerShared *plannerShared::instance()
+{
+ static plannerShared *self = new plannerShared;
+ return self;
+}
diff --git a/core/plannershared.h b/core/plannershared.h
new file mode 100644
index 000000000..a18e2147d
--- /dev/null
+++ b/core/plannershared.h
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0
+#ifndef PLANNERSHARED_H
+#define PLANNERSHARED_H
+#include <QObject>
+
+// This is a shared class (mobile/desktop), and contains the core of the diveplanner
+// without UI entanglement.
+// It make variables and functions available to QML, these are referenced directly
+// in the desktop version
+//
+// The mobile diveplanner shows all diveplans, but the editing functionality is
+// limited to keep the UI simpler.
+
+class plannerShared: public QObject {
+ Q_OBJECT
+
+public:
+ static plannerShared *instance();
+
+private:
+ plannerShared() {}
+};
+
+#endif // PLANNERSHARED_H