summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-10-24 10:37:17 +0200
committerLiang Qi <liang.qi@qt.io>2017-10-24 13:40:55 +0200
commitfa9d12f4a20d618caedc77880459fa1af75fd50d (patch)
tree11bd3cb4541afb924b3ee17f867133e71eb0e090 /src/corelib/io
parent895cb4681ee78caaf9b99c88390a74ff1d79ae61 (diff)
parentf174d31667dca184439f520b9624a1471d9556a6 (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: src/plugins/platforms/windows/qwindowsmousehandler.cpp src/plugins/platforms/xcb/qxcbimage.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/manual/qtabletevent/regular_widgets/main.cpp Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io> Done-with: MÃ¥rten Nordheim<marten.nordheim@qt.io> Change-Id: I5b2499513a92c590ed0756f7d2e93c35a64b7f30
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp3
-rw-r--r--src/corelib/io/qloggingcategory.cpp8
-rw-r--r--src/corelib/io/qurl.cpp31
3 files changed, 33 insertions, 9 deletions
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index 35ddb41215..944ca232ee 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -595,6 +595,9 @@ QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry)
params.dwSize = sizeof(params);
params.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
params.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS;
+ params.dwSecurityQosFlags = SECURITY_ANONYMOUS;
+ params.lpSecurityAttributes = NULL;
+ params.hTemplateFile = NULL;
const HANDLE handle =
CreateFile2((const wchar_t*)entry.nativeFilePath().utf16(), 0,
FILE_SHARE_READ, OPEN_EXISTING, &params);
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp
index 4256d4b6e1..b029274329 100644
--- a/src/corelib/io/qloggingcategory.cpp
+++ b/src/corelib/io/qloggingcategory.cpp
@@ -445,6 +445,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
/*!
\macro qCDebug(category)
\relates QLoggingCategory
+ \threadsafe
\since 5.2
Returns an output stream for debug messages in the logging category
@@ -469,6 +470,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
/*!
\macro qCDebug(category, const char *message, ...)
\relates QLoggingCategory
+ \threadsafe
\since 5.3
Logs a debug message \a message in the logging category \a category.
@@ -490,6 +492,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
/*!
\macro qCInfo(category)
\relates QLoggingCategory
+ \threadsafe
\since 5.5
Returns an output stream for informational messages in the logging category
@@ -514,6 +517,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
/*!
\macro qCInfo(category, const char *message, ...)
\relates QLoggingCategory
+ \threadsafe
\since 5.5
Logs an informational message \a message in the logging category \a category.
@@ -535,6 +539,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
/*!
\macro qCWarning(category)
\relates QLoggingCategory
+ \threadsafe
\since 5.2
Returns an output stream for warning messages in the logging category
@@ -559,6 +564,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
/*!
\macro qCWarning(category, const char *message, ...)
\relates QLoggingCategory
+ \threadsafe
\since 5.3
Logs a warning message \a message in the logging category \a category.
@@ -580,6 +586,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
/*!
\macro qCCritical(category)
\relates QLoggingCategory
+ \threadsafe
\since 5.2
Returns an output stream for critical messages in the logging category
@@ -604,6 +611,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
/*!
\macro qCCritical(category, const char *message, ...)
\relates QLoggingCategory
+ \threadsafe
\since 5.3
Logs a critical message \a message in the logging category \a category.
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index ac694a464a..a499dc2d30 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -499,9 +499,10 @@ public:
InvalidFragmentError = Fragment << 8,
- // the following two cases are only possible in combination
- // with presence/absence of the authority and scheme. See validityError().
+ // the following three cases are only possible in combination with
+ // presence/absence of the path, authority and scheme. See validityError().
AuthorityPresentAndPathIsRelative = Authority << 8 | Path << 8 | 0x10000,
+ AuthorityAbsentAndPathIsDoubleSlash,
RelativeUrlPathContainsColonBeforeSlash = Scheme << 8 | Authority << 8 | Path << 8 | 0x10000,
NoError = 0
@@ -1627,19 +1628,32 @@ inline QUrlPrivate::ErrorCode QUrlPrivate::validityError(QString *source, int *p
return error->code;
}
- // There are two more cases of invalid URLs that QUrl recognizes and they
+ // There are three more cases of invalid URLs that QUrl recognizes and they
// are only possible with constructed URLs (setXXX methods), not with
// parsing. Therefore, they are tested here.
//
- // The two cases are a non-empty path that doesn't start with a slash and:
+ // Two cases are a non-empty path that doesn't start with a slash and:
// - with an authority
// - without an authority, without scheme but the path with a colon before
// the first slash
+ // The third case is an empty authority and a non-empty path that starts
+ // with "//".
// Those cases are considered invalid because toString() would produce a URL
// that wouldn't be parsed back to the same QUrl.
- if (path.isEmpty() || path.at(0) == QLatin1Char('/'))
+ if (path.isEmpty())
return NoError;
+ if (path.at(0) == QLatin1Char('/')) {
+ if (sectionIsPresent & QUrlPrivate::Authority || port != -1 ||
+ path.length() == 1 || path.at(1) != QLatin1Char('/'))
+ return NoError;
+ if (source) {
+ *source = path;
+ *position = 0;
+ }
+ return AuthorityAbsentAndPathIsDoubleSlash;
+ }
+
if (sectionIsPresent & QUrlPrivate::Host) {
if (source) {
*source = path;
@@ -2514,10 +2528,7 @@ void QUrl::setPath(const QString &path, ParsingMode mode)
mode = TolerantMode;
}
- int from = 0;
- while (from < data.length() - 2 && data.midRef(from, 2) == QLatin1String("//"))
- ++from;
- d->setPath(data, from, data.length());
+ d->setPath(data, 0, data.length());
// optimized out, since there is no path delimiter
// if (path.isNull())
@@ -3989,6 +4000,8 @@ static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &err
case QUrlPrivate::AuthorityPresentAndPathIsRelative:
return QStringLiteral("Path component is relative and authority is present");
+ case QUrlPrivate::AuthorityAbsentAndPathIsDoubleSlash:
+ return QStringLiteral("Path component starts with '//' and authority is absent");
case QUrlPrivate::RelativeUrlPathContainsColonBeforeSlash:
return QStringLiteral("Relative URL's path component contains ':' before any '/'");
}