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