[summary] createContentWidget is called exactly once, refactor

This commit is contained in:
Adriaan de Groot 2021-07-20 16:24:09 +02:00
parent d6fe30dfdb
commit 949f9e466f
2 changed files with 4 additions and 12 deletions

View File

@ -89,7 +89,10 @@ createBodyLabel( const QString& text, const QPalette& bodyPalette )
void
SummaryPage::onActivate()
{
createContentWidget();
delete m_contentWidget; // It might have been created previously
m_contentWidget = new QWidget;
m_layout = new QVBoxLayout( m_contentWidget );
CalamaresUtils::unmarginLayout( m_layout );
QFont titleFont = font();
titleFont.setWeight( QFont::Light );
@ -184,16 +187,6 @@ SummaryPage::stepsForSummary( const Calamares::ViewStepList& allSteps ) const
return steps;
}
void
SummaryPage::createContentWidget()
{
delete m_contentWidget;
m_contentWidget = new QWidget;
m_layout = new QVBoxLayout( m_contentWidget );
CalamaresUtils::unmarginLayout( m_layout );
}
void
SummaryPage::onLeave()
{

View File

@ -54,7 +54,6 @@ public:
private:
Calamares::ViewStepList stepsForSummary( const Calamares::ViewStepList& allSteps ) const;
void createContentWidget();
const SummaryViewStep* m_thisViewStep;