summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMaks Naumov <maksqwe1@ukr.net>2015-01-29 22:15:12 +0200
committerMaks Naumov <maksqwe1@ukr.net>2015-02-02 16:15:55 +0000
commit5be5e8ff3a4971e01d6b342a48fc382bc3bd5bdb (patch)
tree7f3fb5133bf195bae8732a0061b3eb0423dea5b8 /src/corelib
parentd2be83bc279cc35911f10fe5fb056a4d8f80bb5b (diff)
Call QDir::homePath() only when necessary in QSettings::initDefaultPaths()
Change-Id: I990520917ec65127ae554b5e872791cff78f0b56 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qsettings.cpp5
1 files changed, 2 insertions, 3 deletions
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);
}