path: root/src/widgets/dialogs/qfiledialog.cpp
diff options
authorMarc Mutz <>2015-02-28 15:19:44 +0100
committerMarc Mutz <>2016-02-24 17:14:07 +0000
commit68a85a03f96f5912151ff7412c508e52a27c9418 (patch)
tree95f74ce10cc6ec652d7df0785ba0b31a4fd6f721 /src/widgets/dialogs/qfiledialog.cpp
parent3ca2eea00d53ae1f75cead8dde763cb8e348d630 (diff)
QtWidgets: replace QStringLiteral with QLatin1String when appending
It makes little sense to use QStringLiteral for strings which are immediately appended to, or which are appended to other strings, because no dynamic memory allocation is saved by doing so. But if the only advantage of QStringLiteral does not apply, all its disadvantages dominate, to wit: injection of calls to qstring dtor, non-sharability of data between C strings and QStringLiterals and among QStringLiterals, and doubled storage requirements. Fix by replacing QStringLiteral with QLatin1String. Saves 288B in text size on stripped optimized Linux AMD64 GCC 4.9 builds. Change-Id: Ie632f25883163f57991264b29e8753fe4c4f738e Reviewed-by: Friedemann Kleint <> Reviewed-by: Olivier Goffart (Woboq GmbH) <>
Diffstat (limited to 'src/widgets/dialogs/qfiledialog.cpp')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 4d74292e8f..50667e2a91 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -1527,7 +1527,7 @@ static QString nameFilterForMime(const QString &mimeType)
return QFileDialog::tr("All files (*)");
} else {
const QString patterns = mime.globPatterns().join(QLatin1Char(' '));
- return mime.comment() + QStringLiteral(" (") + patterns + QLatin1Char(')');
+ return mime.comment() + QLatin1String(" (") + patterns + QLatin1Char(')');
return QString();