From 8a3ea7c8b1b5e76c17d0fd95f4466962ea8c6a12 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 29 Jan 2015 20:34:04 +0100 Subject: [PATCH] Add lazy constructed ViewStepItems for Install and Finished. --- src/calamares/progresstree/ProgressTreeModel.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/calamares/progresstree/ProgressTreeModel.cpp b/src/calamares/progresstree/ProgressTreeModel.cpp index bece777bb..d918da4fc 100644 --- a/src/calamares/progresstree/ProgressTreeModel.cpp +++ b/src/calamares/progresstree/ProgressTreeModel.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === * - * Copyright 2014, Teo Mrnjavac + * Copyright 2014-2015, Teo Mrnjavac * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -141,8 +141,17 @@ ProgressTreeModel::setupModelData() prepare->appendChild( new ViewStepItem( step, prepare ) ); } - m_rootItem->appendChild( new ViewStepItem( vm->installationStep(), m_rootItem ) ); - m_rootItem->appendChild( new TextTreeItem( tr( "Finish" ), m_rootItem ) ); + m_rootItem->appendChild( new ViewStepItem( tr( "Install" ), + [vm]() -> const Calamares::ViewStep* + { + return vm->installationStep(); + }, m_rootItem ) ); + + m_rootItem->appendChild( new ViewStepItem( tr( "Finish" ), + [vm]() -> const Calamares::ViewStep* + { + return vm->finishedStep(); + }, m_rootItem ) ); }