Skip to content

Commit

Permalink
ui: remove copy initialization of dialogs (#33427)
Browse files Browse the repository at this point in the history
remove copy initialization of dialogs
old-commit-hash: dc06813
  • Loading branch information
deanlee authored Sep 1, 2024
1 parent e318ca0 commit 1876f80
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions selfdrive/ui/qt/widgets/input.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ InputDialog::InputDialog(const QString &title, QWidget *parent, const QString &s

QString InputDialog::getText(const QString &prompt, QWidget *parent, const QString &subtitle,
bool secret, int minLength, const QString &defaultText) {
InputDialog d = InputDialog(prompt, parent, subtitle, secret);
InputDialog d(prompt, parent, subtitle, secret);
d.line->setText(defaultText);
d.setMinLength(minLength);
const int ret = d.exec();
Expand Down Expand Up @@ -230,17 +230,17 @@ ConfirmationDialog::ConfirmationDialog(const QString &prompt_text, const QString
}

bool ConfirmationDialog::alert(const QString &prompt_text, QWidget *parent) {
ConfirmationDialog d = ConfirmationDialog(prompt_text, tr("Ok"), "", false, parent);
ConfirmationDialog d(prompt_text, tr("Ok"), "", false, parent);
return d.exec();
}

bool ConfirmationDialog::confirm(const QString &prompt_text, const QString &confirm_text, QWidget *parent) {
ConfirmationDialog d = ConfirmationDialog(prompt_text, confirm_text, tr("Cancel"), false, parent);
ConfirmationDialog d(prompt_text, confirm_text, tr("Cancel"), false, parent);
return d.exec();
}

bool ConfirmationDialog::rich(const QString &prompt_text, QWidget *parent) {
ConfirmationDialog d = ConfirmationDialog(prompt_text, tr("Ok"), "", true, parent);
ConfirmationDialog d(prompt_text, tr("Ok"), "", true, parent);
return d.exec();
}

Expand Down Expand Up @@ -328,7 +328,7 @@ MultiOptionDialog::MultiOptionDialog(const QString &prompt_text, const QStringLi
}

QString MultiOptionDialog::getSelection(const QString &prompt_text, const QStringList &l, const QString &current, QWidget *parent) {
MultiOptionDialog d = MultiOptionDialog(prompt_text, l, current, parent);
MultiOptionDialog d(prompt_text, l, current, parent);
if (d.exec()) {
return d.selection;
}
Expand Down

0 comments on commit 1876f80

Please sign in to comment.