diff options
-rw-r--r-- | mobile-widgets/themeinterface.cpp | 5 | ||||
-rw-r--r-- | mobile-widgets/themeinterface.h | 3 | ||||
-rw-r--r-- | subsurface-helper.cpp | 2 |
3 files changed, 3 insertions, 7 deletions
diff --git a/mobile-widgets/themeinterface.cpp b/mobile-widgets/themeinterface.cpp index 68f9564db..9e522b936 100644 --- a/mobile-widgets/themeinterface.cpp +++ b/mobile-widgets/themeinterface.cpp @@ -50,11 +50,8 @@ ThemeInterface *ThemeInterface::instance() return self; } -void ThemeInterface::setup(QQmlContext *ct) +ThemeInterface::ThemeInterface() { - // Register interface class - ct->setContextProperty("subsurfaceTheme", this); - // get current theme m_currentTheme = qPrefDisplay::theme(); update_theme(); diff --git a/mobile-widgets/themeinterface.h b/mobile-widgets/themeinterface.h index e364d74b5..e4e61144f 100644 --- a/mobile-widgets/themeinterface.h +++ b/mobile-widgets/themeinterface.h @@ -36,7 +36,6 @@ class ThemeInterface : public QObject { public: static ThemeInterface *instance(); - void setup(QQmlContext *ct); double currentScale(); public slots: @@ -66,7 +65,7 @@ signals: void currentThemeChanged(); private: - ThemeInterface() {} + ThemeInterface(); void update_theme(); QColor m_backgroundColor; diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp index eb3bcc27a..65a6e9630 100644 --- a/subsurface-helper.cpp +++ b/subsurface-helper.cpp @@ -199,7 +199,7 @@ void register_qml_types(QQmlEngine *engine) // Register qml interface classes QMLInterface::setup(ct); - ThemeInterface::instance()->setup(ct); + ct->setContextProperty("subsurfaceTheme", ThemeInterface::instance()); } REGISTER_TYPE(QMLManager, "QMLManager"); |