summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Kudryavtsev <[email protected]>2023-09-07 17:49:02 +0300
committerAnton Kudryavtsev <[email protected]>2023-09-08 19:17:36 +0300
commitd232acbce01ea73d99f8435e554769059de9613e (patch)
treecdfa67592dbe0b6edbe4816779b562729899ed29
parent9a198e23d9cc2835fe1dacd411e9437e806c6522 (diff)
dialogs: use const methods more
to avoid implicit detach Change-Id: I2d46696a29f2a454452239e0400af2e2de534cbb Reviewed-by: MÃ¥rten Nordheim <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp2
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index e985baa3afe..ad5bbf3ca6a 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -1631,7 +1631,7 @@ QString QFileDialog::selectedMimeTypeFilter() const
for (const auto &mimeType: mimeTypes) {
QString filter = nameFilterForMime(mimeType);
if (testOption(HideNameFilterDetails))
- filter = qt_strip_filters({ filter }).first();
+ filter = qt_strip_filters({ filter }).constFirst();
if (filter == nameFilter) {
mimeTypeFilter = mimeType;
break;
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index 855376292b3..edea842def7 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -502,7 +502,7 @@ void QFontDialogPrivate::updateFamilies()
match_t type = MATCH_NONE;
if (bestFamilyType <= MATCH_NONE && familyName2 == QStringLiteral("helvetica"))
type = MATCH_LAST_RESORT;
- if (bestFamilyType <= MATCH_LAST_RESORT && familyName2 == f.families().first())
+ if (bestFamilyType <= MATCH_LAST_RESORT && familyName2 == f.families().constFirst())
type = MATCH_APP;
// ### add fallback for writingSystem
if (type != MATCH_NONE) {