Ranged-for in availableInConf const copy.

All the scanned devices should be added to devices list.
This commit is contained in:
Caio Carvalho 2018-07-15 16:36:43 -03:00
parent a508cfbc83
commit 3fd221f794
1 changed files with 4 additions and 9 deletions

View File

@ -194,18 +194,13 @@ 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;
devices << d;
if (status == QStringLiteral("inactive"))
d->setStatus(SoftwareRAID::Status::Inactive);