[summary] Clear model on leave

This commit is contained in:
Adriaan de Groot 2021-10-04 12:10:17 +02:00
parent 295f6f9737
commit 2fdb6fdf37
3 changed files with 11 additions and 2 deletions

View File

@ -125,3 +125,9 @@ Config::collectSummaries( const Calamares::ViewStep* upToHere )
m_summary->setSummaryList( steps );
}
void
Config::clearSummaries()
{
m_summary->setSummaryList( {} );
}

View File

@ -74,6 +74,8 @@ public:
///@brief Called later, to load the model once all viewsteps are there
void collectSummaries( const Calamares::ViewStep* upToHere );
///@brief Clear the model of steps (to avoid dangling widgets)
void clearSummaries();
QAbstractListModel* summaryModel() const { return m_summary; }

View File

@ -92,5 +92,6 @@ SummaryViewStep::onActivate()
void
SummaryViewStep::onLeave()
{
m_config->clearSummaries();
m_widget->onLeave();
}