1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-18 16:32:33 +02:00
ScreenPlay/ScreenPlaySysInfo/storage.h
2020-01-12 17:07:05 +01:00

43 lines
888 B
C++

#pragma once
#include <QAbstractListModel>
#include <QObject>
#include <QStorageInfo>
#include <QTimer>
#include <QVector>
class Storage : public QAbstractListModel {
Q_OBJECT
public:
explicit Storage(QObject* parent = nullptr);
enum class StorageRole {
BytesAvailable = Qt::UserRole,
BytesFree,
BytesTotal,
DisplayName,
FileSystemType,
IsReadOnly,
IsReady,
IsRoot,
IsValid,
Name,
};
Q_ENUM(StorageRole)
QHash<int, QByteArray> roleNames() const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
public slots:
void refresh();
void reset();
signals:
private:
void loadStorageDevices();
private:
QVector<QStorageInfo> m_storageInfoList;
};