2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// Copyright (C) 2016 Ivan Komissarov
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2014-05-06 16:14:21 +00:00
|
|
|
|
|
|
|
#ifndef STORAGEMODEL_H
|
|
|
|
#define STORAGEMODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
#include <QStorageInfo>
|
|
|
|
|
|
|
|
class StorageModel : public QAbstractTableModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_DISABLE_COPY(StorageModel)
|
|
|
|
public:
|
|
|
|
enum Column {
|
|
|
|
ColumnRootPath = 0,
|
|
|
|
ColumnName,
|
|
|
|
ColumnDevice,
|
|
|
|
ColumnFileSystemName,
|
|
|
|
ColumnTotal,
|
|
|
|
ColumnFree,
|
|
|
|
ColumnAvailable,
|
|
|
|
ColumnIsReady,
|
|
|
|
ColumnIsReadOnly,
|
|
|
|
ColumnIsValid,
|
|
|
|
ColumnCount
|
|
|
|
};
|
|
|
|
|
2018-11-24 16:29:15 +00:00
|
|
|
using QAbstractTableModel::QAbstractTableModel;
|
2014-05-06 16:14:21 +00:00
|
|
|
|
2017-09-20 09:36:42 +00:00
|
|
|
int columnCount(const QModelIndex &parent) const override;
|
|
|
|
int rowCount(const QModelIndex &parent) const override;
|
2014-05-06 16:14:21 +00:00
|
|
|
|
2017-09-20 09:36:42 +00:00
|
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
|
|
|
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
|
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void refresh();
|
2014-05-06 16:14:21 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QList<QStorageInfo> m_volumes;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // STORAGEMODEL_H
|