diff --git a/src/calamares/progresstree/ProgressTreeDelegate.cpp b/src/calamares/progresstree/ProgressTreeDelegate.cpp index e7041d1b9..574777ed8 100644 --- a/src/calamares/progresstree/ProgressTreeDelegate.cpp +++ b/src/calamares/progresstree/ProgressTreeDelegate.cpp @@ -85,10 +85,7 @@ ProgressTreeDelegate::paintViewStep( QPainter* painter, font.setBold( false ); painter->setFont( font ); - bool isCurrent = false; - isCurrent = index.data( Calamares::ViewManager::ProgressTreeItemCurrentRole ).toBool(); - - if ( isCurrent ) + if ( index.row() == index.data( Calamares::ViewManager::ProgressTreeItemCurrentIndex ).toInt() ) { painter->setPen( Calamares::Branding::instance()->styleString( Calamares::Branding::SidebarTextSelect ) ); QString textHighlight diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 1499e3653..f0c7d5965 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -561,23 +561,6 @@ ViewManager::data( const QModelIndex& index, int role ) const } case ProgressTreeItemCurrentIndex: return m_currentStep; - case ProgressTreeItemCurrentRole: - return currentStep() == step; - case ProgressTreeItemCompletedRole: - // Every step *before* the current step is considered "complete" - for ( const auto* otherstep : m_steps ) - { - if ( otherstep == currentStep() ) - { - break; - } - if ( otherstep == step ) - { - return true; - } - } - // .. and the others (including current) are not. - return false; default: return QVariant(); } @@ -594,13 +577,4 @@ ViewManager::rowCount( const QModelIndex& parent ) const return m_steps.length(); } -QHash< int, QByteArray > -ViewManager::roleNames() const -{ - auto h = QAbstractListModel::roleNames(); - h.insert( ProgressTreeItemCurrentRole, "current" ); - h.insert( ProgressTreeItemCompletedRole, "completed" ); - return h; -} - } // namespace Calamares diff --git a/src/libcalamaresui/ViewManager.h b/src/libcalamaresui/ViewManager.h index 2c12aac6b..f16419dcd 100644 --- a/src/libcalamaresui/ViewManager.h +++ b/src/libcalamaresui/ViewManager.h @@ -153,15 +153,11 @@ public: */ enum Role { - ProgressTreeItemCurrentRole = Qt::UserRole + 11, ///< Is this the *current* step? - ProgressTreeItemCompletedRole = Qt::UserRole + 12, ///< Are we past this one? ProgressTreeItemCurrentIndex = Qt::UserRole + 13 ///< Index (row) of the current step }; QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override; int rowCount( const QModelIndex& parent = QModelIndex() ) const override; - - QHash< int, QByteArray > roleNames() const override; }; } // namespace Calamares