QFileDialog: add missing break statements in switch in labelText()
It is of course wrong to potentially return the text of the Cancel button if the text of the Accept role button was asked for. Found independently by GCC 7 and Coverity. Coverity-Id: 11150 Change-Id: Ie30f7875daee16a78eeff4b314ce17cbd7cd3aa8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>bb10
parent
9ad4157530
commit
dafa7cc7b5
|
|
@ -2042,10 +2042,12 @@ QString QFileDialog::labelText(DialogLabel label) const
|
|||
button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Save);
|
||||
if (button)
|
||||
return button->text();
|
||||
break;
|
||||
case Reject:
|
||||
button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Cancel);
|
||||
if (button)
|
||||
return button->text();
|
||||
break;
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue