Ranged-for in availableInConf const copy.
All the scanned devices should be added to devices list.
This commit is contained in:
parent
a508cfbc83
commit
3fd221f794
|
@ -194,17 +194,12 @@ void SoftwareRAID::scanSoftwareRAID(QList<Device*>& devices)
|
|||
|
||||
SoftwareRAID* d = static_cast<SoftwareRAID *>(CoreBackendManager::self()->backend()->scanDevice(deviceNode));
|
||||
|
||||
bool isInConf = false;
|
||||
const QStringList constAvailableInConf = availableInConf;
|
||||
|
||||
for (const QString& path : qAsConst(availableInConf)) {
|
||||
if (getUUID(QStringLiteral("/dev/") + path) == d->uuid()) {
|
||||
isInConf = true;
|
||||
for (const QString& path : constAvailableInConf)
|
||||
if (getUUID(QStringLiteral("/dev/") + path) == d->uuid())
|
||||
availableInConf.removeAll(path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isInConf)
|
||||
devices << d;
|
||||
|
||||
if (status == QStringLiteral("inactive"))
|
||||
|
|
Loading…
Reference in New Issue