Commit 7e5b5d3e authored by Raine Makelainen's avatar Raine Makelainen

[nemo-systemsettings] Expose deviceName from the PartitiionModel. Contributes to JB#39820

parent 0c303461
......@@ -189,6 +189,11 @@ QString Partition::devicePath() const
return d ? d->devicePath : QString();
}
QString Partition::deviceName() const
{
return d ? d->deviceName : QString();
}
QString Partition::mountPath() const
{
return d ? d->mountPath : QString();
......
......@@ -82,6 +82,7 @@ public:
StorageType storageType() const;
QString devicePath() const;
QString deviceName() const;
QString mountPath() const;
QString filesystemType() const;
......
......@@ -128,6 +128,7 @@ QHash<int, QByteArray> PartitionModel::roleNames() const
{ StorageTypeRole, "storageType" },
{ FilesystemTypeRole, "filesystemType" },
{ DevicePathRole, "devicePath" },
{ DeviceNameRole, "deviceName" },
{ MountPathRole, "mountPath" },
{ BytesAvailableRole, "bytesAvailable" },
{ BytesTotalRole, "bytesTotal" },
......@@ -165,6 +166,8 @@ QVariant PartitionModel::data(const QModelIndex &index, int role) const
return partition.filesystemType();
case DevicePathRole:
return partition.devicePath();
case DeviceNameRole:
return partition.deviceName();
case MountPathRole:
return partition.mountPath();
case BytesAvailableRole:
......@@ -185,7 +188,8 @@ void PartitionModel::partitionChanged(const Partition &partition)
{
for (int i = 0; i < m_partitions.count(); ++i) {
if (m_partitions.at(i) == partition) {
emit dataChanged(createIndex(i, 0), createIndex(i, 0));
QModelIndex index = createIndex(i, 0);
emit dataChanged(index, index);
return;
}
}
......
......@@ -53,6 +53,7 @@ public:
StorageTypeRole,
FilesystemTypeRole,
DevicePathRole,
DeviceNameRole,
MountPathRole,
BytesAvailableRole,
BytesTotalRole,
......
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