|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
|
|
|
|
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
@ -23,13 +23,13 @@
|
|
|
|
|
#include "viewpages/ViewStep.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewStepItem::ViewStepItem( const QString& prettyName,
|
|
|
|
|
ViewStepItem::ViewStepItem( std::function< QString() > prettyName,
|
|
|
|
|
std::function< const Calamares::ViewStep*() > accessor,
|
|
|
|
|
ProgressTreeItem* parent )
|
|
|
|
|
: ProgressTreeItem( parent )
|
|
|
|
|
, m_step( 0 )
|
|
|
|
|
, m_prettyName( prettyName )
|
|
|
|
|
, m_step( nullptr )
|
|
|
|
|
{
|
|
|
|
|
m_prettyName = prettyName;
|
|
|
|
|
m_accessor = accessor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -54,7 +54,7 @@ ViewStepItem::data( int role ) const
|
|
|
|
|
if ( role == ProgressTreeModel::ProgressTreeItemRole )
|
|
|
|
|
return this;
|
|
|
|
|
if ( role == Qt::DisplayRole )
|
|
|
|
|
return m_step ? m_step->prettyName() : m_prettyName;
|
|
|
|
|
return m_step ? m_step->prettyName() : m_prettyName();
|
|
|
|
|
if ( role == ProgressTreeModel::ProgressTreeItemCurrentRole )
|
|
|
|
|
return m_step ?
|
|
|
|
|
( Calamares::ViewManager::instance()->currentStep() == m_step ) :
|
|
|
|
|