From 5be5e8ff3a4971e01d6b342a48fc382bc3bd5bdb Mon Sep 17 00:00:00 2001 From: Maks Naumov Date: Thu, 29 Jan 2015 22:15:12 +0200 Subject: Call QDir::homePath() only when necessary in QSettings::initDefaultPaths() Change-Id: I990520917ec65127ae554b5e872791cff78f0b56 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qsettings.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index ebca7d57ff..baaa0dab53 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -1017,7 +1017,6 @@ static inline int pathHashKey(QSettings::Format format, QSettings::Scope scope) static void initDefaultPaths(QMutexLocker *locker) { PathHash *pathHash = pathHashFunc(); - QString homePath = QDir::homePath(); QString systemPath; locker->unlock(); @@ -1051,13 +1050,13 @@ static void initDefaultPaths(QMutexLocker *locker) QString userPath; char *env = getenv("XDG_CONFIG_HOME"); if (env == 0) { - userPath = homePath; + userPath = QDir::homePath(); userPath += QLatin1Char('/'); userPath += QLatin1String(".config"); } else if (*env == '/') { userPath = QFile::decodeName(env); } else { - userPath = homePath; + userPath = QDir::homePath(); userPath += QLatin1Char('/'); userPath += QFile::decodeName(env); } -- cgit v1.2.3