summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-10-10 20:34:54 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-10-12 08:16:28 +0000
commitdafa7cc7b5bc35f06f63a78b8f29a7d71fc93f5d (patch)
tree94f91219ec8ad899367c8f94e7dd233ea02f6d22 /src
parent9ad4157530e86a1bac7ab8ca50ba3ee9f839f536 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 3aa9052917..61f5f7b0d2 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -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();
}