Changing prettyName for RAID devices with Resync/Recovery status.
This commit is contained in:
parent
f3fac7eac7
commit
e761c131d0
|
@ -96,8 +96,12 @@ QString SoftwareRAID::prettyName() const
|
||||||
{
|
{
|
||||||
QString raidInfo;
|
QString raidInfo;
|
||||||
|
|
||||||
if (status() != SoftwareRAID::Status::Inactive)
|
if (status() == SoftwareRAID::Status::Active)
|
||||||
raidInfo = xi18nc("@item:inlistbox [RAID level]", " [RAID %1]", raidLevel());
|
raidInfo = xi18nc("@item:inlistbox [RAID level]", " [RAID %1]", raidLevel());
|
||||||
|
else if (status() == SoftwareRAID::Status::Recovery)
|
||||||
|
raidInfo = xi18nc("@item:inlistbox [RAID level - Recovering]", " [RAID %1 - Recovering]", raidLevel());
|
||||||
|
else if (status() == SoftwareRAID::Status::Resync)
|
||||||
|
raidInfo = xi18nc("@item:inlistbox [RAID level - Resyncing]", " [RAID %1 - Resyncing]", raidLevel());
|
||||||
else
|
else
|
||||||
raidInfo = QStringLiteral(" [RAID]");
|
raidInfo = QStringLiteral(" [RAID]");
|
||||||
|
|
||||||
|
@ -193,13 +197,12 @@ void SoftwareRAID::scanSoftwareRAID(QList<Device*>& devices)
|
||||||
|
|
||||||
SoftwareRAID* d = static_cast<SoftwareRAID *>(CoreBackendManager::self()->backend()->scanDevice(deviceNode));
|
SoftwareRAID* d = static_cast<SoftwareRAID *>(CoreBackendManager::self()->backend()->scanDevice(deviceNode));
|
||||||
|
|
||||||
if (scannedRaid.contains(d)) {
|
if (!scannedRaid.contains(d))
|
||||||
if (status == QStringLiteral("inactive"))
|
|
||||||
d->setStatus(SoftwareRAID::Status::Inactive);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
scannedRaid << d;
|
scannedRaid << d;
|
||||||
|
|
||||||
|
if (status == QStringLiteral("inactive"))
|
||||||
|
d->setStatus(SoftwareRAID::Status::Inactive);
|
||||||
|
|
||||||
if (d->raidLevel() > 0) {
|
if (d->raidLevel() > 0) {
|
||||||
QRegularExpression reMirrorStatus(QStringLiteral("\\[[=>.]+\\]\\s+(resync|recovery)"));
|
QRegularExpression reMirrorStatus(QStringLiteral("\\[[=>.]+\\]\\s+(resync|recovery)"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue