source: calamares/trunk/fuentes/src/modules/partition/core/BootLoaderModel.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 16 months ago

sync with github

File size: 1.7 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2014, Aurélien Gâteau <agateau@kde.org>
4 *   Copyright 2015, Teo Mrnjavac <teo@kde.org>
5 *
6 *   Calamares is free software: you can redistribute it and/or modify
7 *   it under the terms of the GNU General Public License as published by
8 *   the Free Software Foundation, either version 3 of the License, or
9 *   (at your option) any later version.
10 *
11 *   Calamares is distributed in the hope that it will be useful,
12 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 *   GNU General Public License for more details.
15 *
16 *   You should have received a copy of the GNU General Public License
17 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
18 */
19#ifndef BOOTLOADERMODEL_H
20#define BOOTLOADERMODEL_H
21
22#include <QStandardItemModel>
23#include <QList>
24
25class Device;
26
27/**
28 * This model contains one entry for each device MBR plus one entry for the
29 * /boot or / partition
30 */
31class BootLoaderModel : public QStandardItemModel
32{
33    Q_OBJECT
34public:
35    enum
36    {
37        BootLoaderPathRole = Qt::UserRole + 1,
38        IsPartitionRole
39    };
40
41    BootLoaderModel( QObject* parent = nullptr );
42    ~BootLoaderModel() override;
43
44    /**
45     * Init the model with the list of devices. Does *not* take ownership of the
46     * devices.
47     */
48    void init( const QList< Device* >& devices );
49
50    void update();
51
52    QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override;
53
54private:
55    QList< Device* > m_devices;
56
57    void createMbrItems();
58};
59
60#endif /* BOOTLOADERMODEL_H */
Note: See TracBrowser for help on using the repository browser.