summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-11-30 08:28:20 +0100
committerLiang Qi <liang.qi@qt.io>2017-11-30 09:16:58 +0100
commit87204c856ae3d8495c41af998ac196a12fe1c779 (patch)
tree5af64eaa3acde506d19fe4ab1c88b028a2197adf /src/corelib/io
parent498ef7f9d77fca75bcba2f657aaac38c8dc78aea (diff)
parentd0812cbdabcff4d388334c499c23992cce98d4da (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: src/corelib/thread/qsemaphore.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Id35b535e88df63fdfe4007ea92ed4a39c4b6d707
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qiodevice.cpp2
-rw-r--r--src/corelib/io/qloggingregistry.cpp3
-rw-r--r--src/corelib/io/qloggingregistry_p.h2
-rw-r--r--src/corelib/io/qstandardpaths_win.cpp13
4 files changed, 15 insertions, 5 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 0a3e83206b..7d46898911 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1879,7 +1879,7 @@ QByteArray QIODevice::peek(qint64 maxSize)
}
/*!
- \since 5.11
+ \since 5.10
Skips up to \a maxSize bytes from the device. Returns the number of bytes
actually skipped, or -1 on error.
diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp
index 0e7eaeea76..1bf61017f6 100644
--- a/src/corelib/io/qloggingregistry.cpp
+++ b/src/corelib/io/qloggingregistry.cpp
@@ -255,6 +255,7 @@ void QLoggingSettingsParser::parseNextLine(QStringRef line)
QLoggingRegistry::QLoggingRegistry()
: categoryFilter(defaultCategoryFilter)
{
+ initalizeRules(); // Init on first use
}
static bool qtLoggingDebug()
@@ -283,7 +284,7 @@ static QVector<QLoggingRule> loadRulesFromFile(const QString &filePath)
Initializes the rules database by loading
$QT_LOGGING_CONF, $QT_LOGGING_RULES, and .config/QtProject/qtlogging.ini.
*/
-void QLoggingRegistry::init()
+void QLoggingRegistry::initalizeRules()
{
QVector<QLoggingRule> er, qr, cr;
// get rules from environment
diff --git a/src/corelib/io/qloggingregistry_p.h b/src/corelib/io/qloggingregistry_p.h
index a68b993cca..a3857d3588 100644
--- a/src/corelib/io/qloggingregistry_p.h
+++ b/src/corelib/io/qloggingregistry_p.h
@@ -113,7 +113,7 @@ class Q_AUTOTEST_EXPORT QLoggingRegistry
public:
QLoggingRegistry();
- void init();
+ void initalizeRules();
void registerCategory(QLoggingCategory *category, QtMsgType enableForLevel);
void unregisterCategory(QLoggingCategory *category);
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)) {