From 9d485f9626135f1297b01b095320b8c134f3a7e9 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 30 Mar 2020 21:33:05 +0200 Subject: cleanup: fold ThemeInterface::setup() into constructor There appears to be no reason for two-phase initialization. Let's keep things simple: let the constructor produce a functioning object. Signed-off-by: Berthold Stoeger --- mobile-widgets/themeinterface.cpp | 5 +---- mobile-widgets/themeinterface.h | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'mobile-widgets') 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; -- cgit v1.2.3-70-g09d2