mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
35 lines
835 B
C
35 lines
835 B
C
|
#ifndef DRIVELISTMODEL_H
|
||
|
#define DRIVELISTMODEL_H
|
||
|
|
||
|
/*
|
||
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
* Copyright (C) 2020 Raspberry Pi (Trading) Limited
|
||
|
*/
|
||
|
|
||
|
#include <QAbstractItemModel>
|
||
|
#include <QMap>
|
||
|
#include <QHash>
|
||
|
#include "drivelistitem.h"
|
||
|
|
||
|
class DriveListModel : public QAbstractListModel
|
||
|
{
|
||
|
public:
|
||
|
DriveListModel(QObject *parent = nullptr);
|
||
|
virtual int rowCount(const QModelIndex &) const;
|
||
|
virtual QHash<int, QByteArray> roleNames() const;
|
||
|
virtual QVariant data(const QModelIndex &index, int role) const;
|
||
|
|
||
|
enum driveListRoles {
|
||
|
deviceRole = Qt::UserRole + 1, descriptionRole, sizeRole, isUsbRole, isScsiRole, mountpointsRole
|
||
|
};
|
||
|
|
||
|
public slots:
|
||
|
void refreshDriveList();
|
||
|
|
||
|
protected:
|
||
|
QMap<QString,DriveListItem *> _drivelist;
|
||
|
QHash<int, QByteArray> _rolenames;
|
||
|
};
|
||
|
|
||
|
#endif // DRIVELISTMODEL_H
|