Editor code: tidy up BOOLs,NULLs and overrides pt6.
A few 'typedefs' replaced by 'using's This shouldn't have any functional changes at all, just c++17 modernization It's a part 6 of a split #2847 Signed-off-by: Nemerle <nemerle5+git@gmail.com>
This commit is contained in:
@@ -105,7 +105,7 @@ bool CSettingsManager::CreateDefaultLayoutSettingsFile()
|
||||
|
||||
AZStd::vector<AZStd::string> CSettingsManager::BuildSettingsList()
|
||||
{
|
||||
XmlNodeRef root = NULL;
|
||||
XmlNodeRef root = nullptr;
|
||||
|
||||
root = m_pSettingsManagerMemoryNode;
|
||||
|
||||
@@ -132,8 +132,8 @@ void CSettingsManager::BuildSettingsList_Helper(const XmlNodeRef& node, const AZ
|
||||
{
|
||||
for (int i = 0; i < node->getNumAttributes(); ++i)
|
||||
{
|
||||
const char* key = NULL;
|
||||
const char* value = NULL;
|
||||
const char* key = nullptr;
|
||||
const char* value = nullptr;
|
||||
node->getAttributeByIndex(i, &key, &value);
|
||||
if (!pathToNode.empty())
|
||||
{
|
||||
@@ -163,7 +163,7 @@ void CSettingsManager::BuildSettingsList_Helper(const XmlNodeRef& node, const AZ
|
||||
result
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,7 @@ void CSettingsManager::SaveSetting(const QString& path, const QString& attr, con
|
||||
// Spaces in node names not allowed
|
||||
writeAttr.replace(" ", "");
|
||||
|
||||
XmlNodeRef root = NULL;
|
||||
XmlNodeRef root = nullptr;
|
||||
|
||||
root = m_pSettingsManagerMemoryNode;
|
||||
|
||||
@@ -276,11 +276,11 @@ XmlNodeRef CSettingsManager::LoadSetting(const QString& path, const QString& att
|
||||
// Spaces in node names not allowed
|
||||
readAttr.replace(" ", "");
|
||||
|
||||
XmlNodeRef root = NULL;
|
||||
XmlNodeRef root = nullptr;
|
||||
|
||||
root = m_pSettingsManagerMemoryNode;
|
||||
|
||||
XmlNodeRef tmpNode = NULL;
|
||||
XmlNodeRef tmpNode = nullptr;
|
||||
|
||||
if (NeedSettingsNode(path))
|
||||
{
|
||||
@@ -293,7 +293,7 @@ XmlNodeRef CSettingsManager::LoadSetting(const QString& path, const QString& att
|
||||
|
||||
if (!tmpNode)
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (int i = 0; i < strNodes.size(); ++i)
|
||||
@@ -304,13 +304,13 @@ XmlNodeRef CSettingsManager::LoadSetting(const QString& path, const QString& att
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (!tmpNode->findChild(readAttr.toUtf8().data()))
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -360,7 +360,7 @@ void CSettingsManager::AddToolVersion(const QString& toolName, const QString& to
|
||||
return;
|
||||
}
|
||||
|
||||
if (stl::find_in_map(m_toolNames, toolName, NULL) == "")
|
||||
if (stl::find_in_map(m_toolNames, toolName, nullptr) == "")
|
||||
{
|
||||
if (!toolVersion.isEmpty())
|
||||
{
|
||||
@@ -380,7 +380,7 @@ void CSettingsManager::AddToolName(const QString& toolName, const QString& human
|
||||
return;
|
||||
}
|
||||
|
||||
if (stl::find_in_map(m_toolNames, toolName, NULL) == "")
|
||||
if (stl::find_in_map(m_toolNames, toolName, nullptr) == "")
|
||||
{
|
||||
if (!humanReadableName.isEmpty())
|
||||
{
|
||||
@@ -499,7 +499,7 @@ void CSettingsManager::GetMatchingLayoutNames(TToolNamesMap& foundTools, XmlNode
|
||||
return;
|
||||
}
|
||||
|
||||
TToolNamesMap* toolNames = NULL;
|
||||
TToolNamesMap* toolNames = nullptr;
|
||||
|
||||
if (!foundTools.empty())
|
||||
{
|
||||
@@ -593,11 +593,11 @@ bool CSettingsManager::NeedSettingsNode(const QString& path)
|
||||
{
|
||||
if ((path != EDITOR_LAYOUT_ROOT_NODE) && (path != TOOLBOX_NODE) && (path != TOOLBOXMACROS_NODE))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -605,13 +605,13 @@ void CSettingsManager::SerializeCVars(XmlNodeRef& node, bool bLoad)
|
||||
{
|
||||
int nNumberOfVariables(0);
|
||||
int nCurrentVariable(0);
|
||||
IConsole* piConsole(NULL);
|
||||
ICVar* piVariable(NULL);
|
||||
IConsole* piConsole(nullptr);
|
||||
ICVar* piVariable(nullptr);
|
||||
std::vector<char*> cszVariableNames;
|
||||
|
||||
char* szKey(NULL);
|
||||
char* szValue(NULL);
|
||||
ICVar* piCVar(NULL);
|
||||
char* szKey(nullptr);
|
||||
char* szValue(nullptr);
|
||||
ICVar* piCVar(nullptr);
|
||||
|
||||
piConsole = gEnv->pConsole;
|
||||
|
||||
@@ -622,7 +622,7 @@ void CSettingsManager::SerializeCVars(XmlNodeRef& node, bool bLoad)
|
||||
|
||||
if (bLoad)
|
||||
{
|
||||
XmlNodeRef readNode = NULL;
|
||||
XmlNodeRef readNode = nullptr;
|
||||
XmlNodeRef inputCVarsNode = node->findChild(CVARS_NODE);
|
||||
|
||||
if (!inputCVarsNode)
|
||||
@@ -649,7 +649,7 @@ void CSettingsManager::SerializeCVars(XmlNodeRef& node, bool bLoad)
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlNodeRef newCVarNode = NULL;
|
||||
XmlNodeRef newCVarNode = nullptr;
|
||||
XmlNodeRef oldCVarsNode = node->findChild(CVARS_NODE);
|
||||
|
||||
if (oldCVarsNode)
|
||||
@@ -660,9 +660,9 @@ void CSettingsManager::SerializeCVars(XmlNodeRef& node, bool bLoad)
|
||||
XmlNodeRef cvarsNode = XmlHelpers::CreateXmlNode(CVARS_NODE);
|
||||
|
||||
nNumberOfVariables = piConsole->GetNumVisibleVars();
|
||||
cszVariableNames.resize(nNumberOfVariables, NULL);
|
||||
cszVariableNames.resize(nNumberOfVariables, nullptr);
|
||||
|
||||
if (piConsole->GetSortedVars((const char**)&cszVariableNames.front(), nNumberOfVariables, NULL) != nNumberOfVariables)
|
||||
if (piConsole->GetSortedVars((const char**)&cszVariableNames.front(), nNumberOfVariables, nullptr) != nNumberOfVariables)
|
||||
{
|
||||
assert(false);
|
||||
return;
|
||||
@@ -711,8 +711,8 @@ void CSettingsManager::ReadValueStr(XmlNodeRef& sourceNode, const QString& path,
|
||||
// Spaces in node names not allowed
|
||||
readAttr.replace(" ", "");
|
||||
|
||||
XmlNodeRef root = NULL;
|
||||
XmlNodeRef tmpNode = NULL;
|
||||
XmlNodeRef root = nullptr;
|
||||
XmlNodeRef tmpNode = nullptr;
|
||||
|
||||
if (NeedSettingsNode(path))
|
||||
{
|
||||
@@ -809,7 +809,7 @@ bool CSettingsManager::IsEventSafe(const SEventLog& event)
|
||||
|
||||
if (!root)
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
QString eventName = event.m_eventName;
|
||||
@@ -823,7 +823,7 @@ bool CSettingsManager::IsEventSafe(const SEventLog& event)
|
||||
// Log entry not found, so it is safe to start
|
||||
if (!resNode)
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
XmlNodeRef callerVersion = resNode->findChild(EVENT_LOG_CALLER_VERSION);
|
||||
@@ -841,15 +841,15 @@ bool CSettingsManager::IsEventSafe(const SEventLog& event)
|
||||
{
|
||||
if (callerVersionStr != GetToolVersion(eventName))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// The same version of tool/level found
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -947,15 +947,15 @@ XmlNodeRef CSettingsManager::LoadLogEventSetting(const QString& path, const QStr
|
||||
|
||||
if (!root)
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
XmlNodeRef tmpNode = NULL;
|
||||
XmlNodeRef tmpNode = nullptr;
|
||||
tmpNode = root;
|
||||
|
||||
if (!tmpNode)
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (int i = 0; i < strNodes.size(); ++i)
|
||||
@@ -966,7 +966,7 @@ XmlNodeRef CSettingsManager::LoadLogEventSetting(const QString& path, const QStr
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -975,7 +975,7 @@ XmlNodeRef CSettingsManager::LoadLogEventSetting(const QString& path, const QStr
|
||||
return tmpNode;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QString CSettingsManager::GenerateContentHash(XmlNodeRef& node, QString sourceName)
|
||||
|
||||
Reference in New Issue
Block a user