Commit 254ef0d8 authored by jpetrell's avatar jpetrell

[storage] Expose partition model as its own role. Contributes to JB#36373

parent 39d7065c
......@@ -131,7 +131,8 @@ QHash<int, QByteArray> PartitionModel::roleNames() const
{ MountPathRole, "mountPath" },
{ BytesAvailableRole, "bytesAvailable" },
{ BytesTotalRole, "bytesTotal" },
{ BytesFreeRole, "bytesFree" }
{ BytesFreeRole, "bytesFree" },
{ PartitionModelRole, "partitionModel" }
};
return roleNames;
......@@ -172,6 +173,8 @@ QVariant PartitionModel::data(const QModelIndex &index, int role) const
return partition.bytesTotal();
case BytesFreeRole:
return partition.bytesFree();
case PartitionModelRole:
return QVariant::fromValue(static_cast<QObject*>(const_cast<PartitionModel*>((this))));
default:
return QVariant();
}
......
......@@ -57,6 +57,7 @@ public:
BytesAvailableRole,
BytesTotalRole,
BytesFreeRole,
PartitionModelRole
};
enum Status {
......
......@@ -52,7 +52,7 @@ static QVariantMap g_mocked_apkd_size;
/* Mocked implementations of size calculation functions */
quint64 DiskUsageWorker::calculateSize(QString directory, QString *expandedPath, bool androidHomeExists)
quint64 DiskUsageWorker::calculateSize(QString directory, QString *expandedPath, bool)
{
if (expandedPath) {
*expandedPath = directory;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment