From 235db9f9619309cafa0087e4281bcb7f9c89606a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 13 Jul 2021 22:07:06 +0200 Subject: [PATCH] [summaryq] No need to be a ParserStatus object Config classes, which intend to be shared between widgets- and QML-based view-steps, should not tie closely to internals. None of the ParserStatus methods are used in a meaningful way (init() can be called by the view step). --- src/modules/summaryq/Config.cpp | 14 +------------- src/modules/summaryq/Config.h | 6 ++---- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/modules/summaryq/Config.cpp b/src/modules/summaryq/Config.cpp index e404c1f62..0f98891a6 100644 --- a/src/modules/summaryq/Config.cpp +++ b/src/modules/summaryq/Config.cpp @@ -98,13 +98,7 @@ Config::retranslate() } void -Config::componentComplete() -{ - refresh(); -} - -void -Config::refresh() +Config::init() { Calamares::ViewStepList steps; for ( Calamares::ViewStep* step : Calamares::ViewManager::instance()->viewSteps() ) @@ -133,9 +127,3 @@ Config::refresh() m_summary->setSummaryList( steps ); } - -void -Config::init() -{ - refresh(); -} diff --git a/src/modules/summaryq/Config.h b/src/modules/summaryq/Config.h index 08f2c0f16..524aeee8e 100644 --- a/src/modules/summaryq/Config.h +++ b/src/modules/summaryq/Config.h @@ -58,7 +58,7 @@ private: QVector< StepSummary > m_summary; }; -class Config : public QObject, public QQmlParserStatus +class Config : public QObject { Q_OBJECT @@ -71,10 +71,8 @@ class Config : public QObject, public QQmlParserStatus public: explicit Config( Calamares::ViewStep* parent = nullptr ); - virtual void componentComplete() override; - virtual void classBegin() override {} - void refresh(); + ///@brief Called later, to load the model once all viewsteps are there void init(); QAbstractListModel* summaryModel() const { return m_summary; }