From 68a85a03f96f5912151ff7412c508e52a27c9418 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 28 Feb 2015 15:19:44 +0100 Subject: 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) --- src/widgets/dialogs/qfiledialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/dialogs/qfiledialog.cpp') 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(); -- cgit v1.2.3