Refactor: move last token info into struct (#5808)

* add override

* refactor token info into struct

* correct default destroy value
This commit is contained in:
RickyRister 2025-04-09 08:26:14 -07:00 committed by GitHub
parent 0bd53d6dc7
commit 56bbd8a172
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 56 deletions

View file

@ -224,27 +224,11 @@ void DlgCreateToken::actReject()
reject();
}
QString DlgCreateToken::getName() const
TokenInfo DlgCreateToken::getTokenInfo() const
{
return nameEdit->text();
}
QString DlgCreateToken::getColor() const
{
return QString(colorEdit->itemData(colorEdit->currentIndex()).toChar());
}
QString DlgCreateToken::getPT() const
{
return ptEdit->text();
}
QString DlgCreateToken::getAnnotation() const
{
return annotationEdit->text();
}
bool DlgCreateToken::getDestroy() const
{
return destroyCheckBox->isChecked();
return {.name = nameEdit->text(),
.color = colorEdit->itemData(colorEdit->currentIndex()).toString(),
.pt = ptEdit->text(),
.annotation = annotationEdit->text(),
.destroy = destroyCheckBox->isChecked()};
}