From fa2b577236e5c9bb036114fe0c5d446167a2c9f4 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Sat, 6 Jun 2015 23:45:34 +0200 Subject: [PATCH] Meaningful text from BootLoaderModel. --- src/modules/partition/core/BootLoaderModel.cpp | 12 ++++++++++++ src/modules/partition/core/BootLoaderModel.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/src/modules/partition/core/BootLoaderModel.cpp b/src/modules/partition/core/BootLoaderModel.cpp index 6c99a5dcd..ceecb17de 100644 --- a/src/modules/partition/core/BootLoaderModel.cpp +++ b/src/modules/partition/core/BootLoaderModel.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014, Aurélien Gâteau + * Copyright 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 @@ -102,3 +103,14 @@ BootLoaderModel::update() } } + +QVariant +BootLoaderModel::data( const QModelIndex& index, int role ) const +{ + if ( role == Qt::DisplayRole ) + return tr( "%1 (%2)" ) + .arg( QStandardItemModel::data( index, Qt::DisplayRole ).toString() ) + .arg( QStandardItemModel::data( index, BootLoaderModel::BootLoaderPathRole ).toString() ); + return QStandardItemModel::data( index, role ); +} + diff --git a/src/modules/partition/core/BootLoaderModel.h b/src/modules/partition/core/BootLoaderModel.h index f0c3034c6..27684e326 100644 --- a/src/modules/partition/core/BootLoaderModel.h +++ b/src/modules/partition/core/BootLoaderModel.h @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014, Aurélien Gâteau + * Copyright 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 @@ -48,6 +49,8 @@ public: void update(); + QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override; + private: QList< Device* > m_devices;