bugfix/ai-static-analysis #82

Open
localhorst wants to merge 15 commits from bugfix/ai-static-analysis into master
2 changed files with 14 additions and 14 deletions
Showing only changes of commit ff6a1763e0 - Show all commits

View File

@ -326,28 +326,28 @@ void reHDD::searchDrives(std::list<Drive> *plistDrives)
if (devName.empty())
continue;
Drive *tmpDrive = new Drive("/dev/" + devName);
tmpDrive->state = Drive::NONE;
tmpDrive->bIsOffline = false;
Drive tmpDrive("/dev/" + devName);
tmpDrive.state = Drive::NONE;
tmpDrive.bIsOffline = false;
// Set connection type
if (transport == "sata")
tmpDrive->connectionType = Drive::SATA;
tmpDrive.connectionType = Drive::SATA;
else if (transport == "usb")
tmpDrive->connectionType = Drive::USB;
tmpDrive.connectionType = Drive::USB;
else if (transport == "nvme")
tmpDrive->connectionType = Drive::NVME;
tmpDrive.connectionType = Drive::NVME;
else
tmpDrive->connectionType = Drive::UNKNOWN;
tmpDrive.connectionType = Drive::UNKNOWN;
plistDrives->push_back(*tmpDrive);
plistDrives->push_back(tmpDrive);
Logger::logThis()->info(
"Drive found: " + tmpDrive->getPath() +
"Drive found: " + tmpDrive.getPath() +
" (type: " +
(tmpDrive->connectionType == Drive::USB ? "USB" : tmpDrive->connectionType == Drive::SATA ? "SATA"
: tmpDrive->connectionType == Drive::NVME ? "NVME"
: "UNKNOWN") +
(tmpDrive.connectionType == Drive::USB ? "USB" : tmpDrive.connectionType == Drive::SATA ? "SATA"
: tmpDrive.connectionType == Drive::NVME ? "NVME"
: "UNKNOWN") +
")");
}