mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-03-09 15:20:06 -04:00
refactor: Refactors AgentRoleDialog's modes handling (#325)
* fix: Fixes `undefined-bool-conversion` compilation warning. * refactor: Replaces `AgentRoleDialog::m_editMode` with `AgentRoleDialog::m_action` --------- Co-authored-by: Ivan Lebedev <ilebedev@flightpath3d.com>
This commit is contained in:
@ -129,7 +129,7 @@ void AgentRolesWidget::updateButtons()
|
||||
|
||||
void AgentRolesWidget::onAddRole()
|
||||
{
|
||||
AgentRoleDialog dialog(this);
|
||||
AgentRoleDialog dialog{AgentRoleDialog::Action::Add, this};
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
||||
@ -170,7 +170,7 @@ void AgentRolesWidget::onEditRole()
|
||||
return;
|
||||
}
|
||||
|
||||
AgentRoleDialog dialog(role, this);
|
||||
AgentRoleDialog dialog{role, AgentRoleDialog::Action::Edit, this};
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
||||
@ -203,7 +203,7 @@ void AgentRolesWidget::onDuplicateRole()
|
||||
role.id = baseId + QString::number(counter++);
|
||||
}
|
||||
|
||||
AgentRoleDialog dialog(role, false, this);
|
||||
AgentRoleDialog dialog{role, AgentRoleDialog::Action::Duplicate, this};
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user