From a3def2869da8ad9c17d44005c0d1fd70a903f855 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Thu, 25 Feb 2016 12:41:35 +0300 Subject: QtGui: de-duplicate calls and cache results Change-Id: Iaf232c31d6780b49dc6a3d0faafb9717f3c36e65 Reviewed-by: Marc Mutz Reviewed-by: Lars Knoll Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/util/qdesktopservices.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/util') diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index 1cfea8634a..085c073bb1 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -328,17 +328,17 @@ QString QDesktopServices::storageLocationImpl(QStandardPaths::StandardLocation t // * Unix data location is under the "data/" subdirectory const QString compatAppName = qt_applicationName_noFallback(); const QString baseDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); + const QString organizationName = QCoreApplication::organizationName(); #if defined(Q_OS_WIN) || defined(Q_OS_MAC) QString result = baseDir; - if (!QCoreApplication::organizationName().isEmpty()) - result += QLatin1Char('/') + QCoreApplication::organizationName(); + if (!organizationName.isEmpty()) + result += QLatin1Char('/') + organizationName; if (!compatAppName.isEmpty()) result += QLatin1Char('/') + compatAppName; return result; #elif defined(Q_OS_UNIX) return baseDir + QLatin1String("/data/") - + QCoreApplication::organizationName() + QLatin1Char('/') - + compatAppName; + + organizationName + QLatin1Char('/') + compatAppName; #endif } return QStandardPaths::writableLocation(type); -- cgit v1.2.3