CardManager refactor:

. replaced most GetObj() with GetRef()
. so dynamic_cast'ing to a reference now (instead of a pointer)
This commit is contained in:
tomcw
2020-01-04 13:58:59 +00:00
parent d3faae69fb
commit edf65762cd
9 changed files with 78 additions and 74 deletions
+3 -3
View File
@@ -217,10 +217,10 @@ void CPropertySheetHelper::GetDiskBaseNameWithAWS(std::string & pszFilename)
if (g_CardMgr.QuerySlot(SLOT6) != CT_Disk2)
return;
const std::string & pDiskName = dynamic_cast<Disk2InterfaceCard*>(g_CardMgr.GetObj(SLOT6))->GetBaseName(DRIVE_1);
if (!pDiskName.empty())
const std::string& diskName = dynamic_cast<Disk2InterfaceCard&>(g_CardMgr.GetRef(SLOT6)).GetBaseName(DRIVE_1);
if (!diskName.empty())
{
pszFilename = pDiskName + ".aws.yaml";
pszFilename = diskName + ".aws.yaml";
}
}