Rename 'name' member of ActionDescription to 'customName'

* This is a deliberate break of compatibility since the field is now often
  empty, for non-markers. This means code will get a more explicit error when
  the name is being referenced, so it can be updated to fetch the name it needs
  as needed.
This commit is contained in:
baldurk
2021-07-01 15:15:05 +01:00
parent 7149302680
commit d0accc409b
36 changed files with 373 additions and 275 deletions
+19 -5
View File
@@ -514,13 +514,22 @@ struct EventItemModel : public QAbstractItemModel
return NULL;
}
rdcstr GetEventName(uint32_t eid)
{
if(eid < m_Actions.size())
return RichResourceTextFormat(m_Ctx, GetCachedEIDName(eid));
return rdcstr();
}
rdcarray<rdcstr> GetMarkerList() const
{
rdcarray<rdcstr> ret;
for(auto it = m_Nodes.begin(); it != m_Nodes.end(); ++it)
if(it.value().action && (it.value().action->flags & ActionFlags::PushMarker))
ret.push_back(it.value().action->name);
if(it.value().action && (it.value().action->flags & ActionFlags::PushMarker) &&
!it.value().action->customName.isEmpty())
ret.push_back(it.value().action->customName);
return ret;
}
@@ -1080,14 +1089,14 @@ private:
{
if(m_UseCustomActionNames)
{
name = action->name;
name = action->customName;
}
else
{
if((action->flags & (ActionFlags::SetMarker | ActionFlags::PushMarker)) &&
!(action->flags & (ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary |
ActionFlags::CmdList | ActionFlags::MultiAction)))
name = action->name;
name = action->customName;
}
}
@@ -2564,7 +2573,7 @@ nesting level.
const SDChunk *, const ActionDescription *action, const rdcstr &) {
while(action->parent)
{
if(QString(action->parent->name).contains(markerName, Qt::CaseInsensitive))
if(QString(action->parent->customName).contains(markerName, Qt::CaseInsensitive))
return true;
action = action->parent;
@@ -5234,6 +5243,11 @@ const ActionDescription *EventBrowser::GetActionForEID(uint32_t eid)
return m_Model->GetActionForEID(eid);
}
rdcstr EventBrowser::GetEventName(uint32_t eid)
{
return m_Model->GetEventName(eid);
}
bool EventBrowser::IsAPIEventVisible(uint32_t eid)
{
return m_FilterModel->mapFromSource(m_Model->GetIndexForEID(eid)).isValid();