[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).
This commit is contained in:
Adriaan de Groot 2021-07-13 22:07:06 +02:00
parent 768760793a
commit 235db9f961
2 changed files with 3 additions and 17 deletions

View File

@ -98,13 +98,7 @@ Config::retranslate()
} }
void void
Config::componentComplete() Config::init()
{
refresh();
}
void
Config::refresh()
{ {
Calamares::ViewStepList steps; Calamares::ViewStepList steps;
for ( Calamares::ViewStep* step : Calamares::ViewManager::instance()->viewSteps() ) for ( Calamares::ViewStep* step : Calamares::ViewManager::instance()->viewSteps() )
@ -133,9 +127,3 @@ Config::refresh()
m_summary->setSummaryList( steps ); m_summary->setSummaryList( steps );
} }
void
Config::init()
{
refresh();
}

View File

@ -58,7 +58,7 @@ private:
QVector< StepSummary > m_summary; QVector< StepSummary > m_summary;
}; };
class Config : public QObject, public QQmlParserStatus class Config : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -71,10 +71,8 @@ class Config : public QObject, public QQmlParserStatus
public: public:
explicit Config( Calamares::ViewStep* parent = nullptr ); 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(); void init();
QAbstractListModel* summaryModel() const { return m_summary; } QAbstractListModel* summaryModel() const { return m_summary; }