WModifyTab: Make use of push_back over operator<<
This commit is contained in:
parent
b868a94182
commit
0465029055
|
@ -219,23 +219,23 @@ void WModifyTab::OnPickModeExit()
|
||||||
|
|
||||||
void WModifyTab::OnDeleteLinksClicked()
|
void WModifyTab::OnDeleteLinksClicked()
|
||||||
{
|
{
|
||||||
if (mpSelectedNode && mpSelectedNode->NodeType() == ENodeType::Script)
|
if (mpSelectedNode == nullptr || mpSelectedNode->NodeType() != ENodeType::Script)
|
||||||
{
|
return;
|
||||||
ELinkType Type = (sender() == ui->DeleteOutgoingConnectionButton ? ELinkType::Outgoing : ELinkType::Incoming);
|
|
||||||
QModelIndexList SelectedIndices = (Type == ELinkType::Outgoing ? ui->OutLinksTableView->selectionModel()->selectedRows() : ui->InLinksTableView->selectionModel()->selectedRows());
|
const ELinkType Type = (sender() == ui->DeleteOutgoingConnectionButton ? ELinkType::Outgoing : ELinkType::Incoming);
|
||||||
|
const QModelIndexList SelectedIndices = (Type == ELinkType::Outgoing ? ui->OutLinksTableView->selectionModel()->selectedRows() : ui->InLinksTableView->selectionModel()->selectedRows());
|
||||||
|
|
||||||
|
if (SelectedIndices.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!SelectedIndices.isEmpty())
|
|
||||||
{
|
|
||||||
QVector<uint32> Indices;
|
QVector<uint32> Indices;
|
||||||
|
Indices.reserve(SelectedIndices.size());
|
||||||
|
for (const auto& index : SelectedIndices)
|
||||||
|
Indices.push_back(index.row());
|
||||||
|
|
||||||
for (int iIdx = 0; iIdx < SelectedIndices.size(); iIdx++)
|
auto *pInst = static_cast<CScriptNode*>(mpSelectedNode)->Instance();
|
||||||
Indices << SelectedIndices[iIdx].row();
|
auto *pCmd = new CDeleteLinksCommand(mpWorldEditor, pInst, Type, Indices);
|
||||||
|
|
||||||
CScriptObject *pInst = static_cast<CScriptNode*>(mpSelectedNode)->Instance();
|
|
||||||
CDeleteLinksCommand *pCmd = new CDeleteLinksCommand(mpWorldEditor, pInst, Type, Indices);
|
|
||||||
mpWorldEditor->UndoStack().push(pCmd);
|
mpWorldEditor->UndoStack().push(pCmd);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WModifyTab::OnEditLinkClicked()
|
void WModifyTab::OnEditLinkClicked()
|
||||||
|
|
Loading…
Reference in New Issue