summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlinterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mobile-widgets/qmlinterface.cpp')
-rw-r--r--mobile-widgets/qmlinterface.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/mobile-widgets/qmlinterface.cpp b/mobile-widgets/qmlinterface.cpp
index 67d4196a3..4bf23dedf 100644
--- a/mobile-widgets/qmlinterface.cpp
+++ b/mobile-widgets/qmlinterface.cpp
@@ -81,16 +81,11 @@ QMLInterface::QMLInterface()
this, &QMLInterface::display_variationsChanged);
}
-QMLInterface *QMLInterface::instance()
-{
- static QMLInterface *self = new QMLInterface;
- return self;
-}
-
void QMLInterface::setup(QQmlContext *ct)
{
// Register interface class
- ct->setContextProperty("Backend", QMLInterface::instance());
+ static QMLInterface self;
+ ct->setContextProperty("Backend", &self);
// Make enums available as types
qmlRegisterUncreatableType<QMLInterface>("org.subsurfacedivelog.mobile",1,0,"Enums","Enum is not a type");
@@ -100,7 +95,6 @@ void QMLInterface::setup(QQmlContext *ct)
diveSummary::summaryCalculation(0, 3);
}
-
void QMLInterface::summaryCalculation(int primaryPeriod, int secondaryPeriod)
{
diveSummary::summaryCalculation(primaryPeriod, secondaryPeriod);