mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
Move source files to /src
This commit is contained in:
parent
4daff1ba79
commit
033ff07abf
2685 changed files with 9 additions and 7 deletions
39
src/drivelistmodel.h
Normal file
39
src/drivelistmodel.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
#ifndef DRIVELISTMODEL_H
|
||||
#define DRIVELISTMODEL_H
|
||||
|
||||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Copyright (C) 2020 Raspberry Pi Ltd
|
||||
*/
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QMap>
|
||||
#include <QHash>
|
||||
#include "drivelistitem.h"
|
||||
#include "drivelistmodelpollthread.h"
|
||||
|
||||
class DriveListModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
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;
|
||||
void startPolling();
|
||||
void stopPolling();
|
||||
|
||||
enum driveListRoles {
|
||||
deviceRole = Qt::UserRole + 1, descriptionRole, sizeRole, isUsbRole, isScsiRole, isReadOnlyRole, mountpointsRole
|
||||
};
|
||||
|
||||
public slots:
|
||||
void processDriveList(std::vector<Drivelist::DeviceDescriptor> l);
|
||||
|
||||
protected:
|
||||
QMap<QString,DriveListItem *> _drivelist;
|
||||
QHash<int, QByteArray> _rolenames;
|
||||
DriveListModelPollThread _thread;
|
||||
};
|
||||
|
||||
#endif // DRIVELISTMODEL_H
|
Loading…
Add table
Add a link
Reference in a new issue