core: add plannerShared class

Add a plannerShared class, whose purpose is to contain shared
functions between mobile and desktop

This class is the inner workings of the diveplanner not the UI

Signed-off-by: Jan Iversen <jan@casacondor.com>
This commit is contained in:
jan Iversen 2019-12-08 19:30:39 +01:00 committed by Dirk Hohndel
parent b4eef5548b
commit c0069d6aee
3 changed files with 35 additions and 0 deletions

View file

@ -72,6 +72,8 @@ set(SUBSURFACE_CORE_LIB_SRCS
divelist.h divelist.h
divelogexportlogic.cpp divelogexportlogic.cpp
divelogexportlogic.h divelogexportlogic.h
plannershared.cpp
plannershared.h
divesite-helper.cpp divesite-helper.cpp
divesite.c divesite.c
divesite.h divesite.h

9
core/plannershared.cpp Normal file
View file

@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0
#include "plannershared.h"
plannerShared *plannerShared::instance()
{
static plannerShared *self = new plannerShared;
return self;
}

24
core/plannershared.h Normal file
View file

@ -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