diff options
author | Liang Qi <liang.qi@qt.io> | 2017-11-23 12:32:56 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-11-23 12:52:18 +0100 |
commit | 7c4b0aa9706bdb79f0f79841cf6704e2f613fe69 (patch) | |
tree | 77acbaa2d335759e0a5ed04d37608dce2b12acbc /src/corelib/io | |
parent | 110e49c9cecca34dfacad33d19e04612cc2671b2 (diff) | |
parent | eade2255ea7cd8200569080e9b295479b1f51bed (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
src/corelib/io/qstandardpaths_win.cpp
src/plugins/platforms/ios/qioswindow.mm
src/plugins/platforms/ios/quiview.mm
tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
Change-Id: I5deb0a0176a454a9c566e924d074ba60ce04f0bc
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qstandardpaths_win.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp index 41fd31df8b..eeb02419c3 100644 --- a/src/corelib/io/qstandardpaths_win.cpp +++ b/src/corelib/io/qstandardpaths_win.cpp @@ -201,6 +201,10 @@ QString QStandardPaths::writableLocation(StandardLocation type) return result; } +#ifndef QT_BOOTSTRAPPED +extern QString qAppFileName(); +#endif + QStringList QStandardPaths::standardLocations(StandardLocation type) { QStringList dirs; @@ -217,8 +221,13 @@ QStringList QStandardPaths::standardLocations(StandardLocation type) dirs.append(programData); } #ifndef QT_BOOTSTRAPPED - dirs.append(QCoreApplication::applicationDirPath()); - const QString dataDir = QCoreApplication::applicationDirPath() + QLatin1String("/data"); + // Note: QCoreApplication::applicationDirPath(), while static, requires + // an application instance. But we might need to resolve the standard + // locations earlier than that, so we fall back to qAppFileName(). + QString applicationDirPath = qApp ? QCoreApplication::applicationDirPath() + : QFileInfo(qAppFileName()).path(); + dirs.append(applicationDirPath); + const QString dataDir = applicationDirPath + QLatin1String("/data"); dirs.append(dataDir); if (!isGenericConfigLocation(type)) { |