summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/codecs/qt_attribution.json7
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp19
-rw-r--r--src/corelib/kernel/qobject.cpp34
-rw-r--r--src/corelib/kernel/qt_attribution.json1
-rw-r--r--src/corelib/kernel/qvariant.cpp12
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp2
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp1
-rw-r--r--src/corelib/mimetypes/qmimetypeparser.cpp4
-rw-r--r--src/corelib/thread/qthread_win.cpp4
-rw-r--r--src/corelib/tools/qcontiguouscache.h1
10 files changed, 63 insertions, 22 deletions
diff --git a/src/corelib/codecs/qt_attribution.json b/src/corelib/codecs/qt_attribution.json
index 41f644a030..0815074675 100644
--- a/src/corelib/codecs/qt_attribution.json
+++ b/src/corelib/codecs/qt_attribution.json
@@ -6,6 +6,7 @@
"QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
"Path": "qbig5codec.cpp",
+ "Description": "Treat as final version; no upstream known",
"Description": "The Big5 codecs (QBig5Codec, QBig5hkscsCodec)
provide conversion to and from the Big5 encodings.",
"License": "BSD 2-clause \"Simplified\" License",
@@ -23,6 +24,7 @@ Copyright (C) 2001, 2002 Anthony Fok, ThizLinux Laboratory Ltd."
"QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
"Path": "qeucjpcodec.cpp",
+ "Description": "Treat as final version; no upstream known",
"Description": "The EUC-JP text codec provides conversion to and from EUC-JP,
the main legacy encoding for Unix machines in Japan.",
"License": "BSD 2-clause \"Simplified\" License",
@@ -37,6 +39,7 @@ the main legacy encoding for Unix machines in Japan.",
"QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
"Path": "qeuckrcodec.cpp",
+ "Description": "Treat as final version; no upstream known",
"Description": "The EUC-KR text codec provides conversion to and from EUC-KR, KR,
the main legacy encoding for Unix machines in Korea.",
"License": "BSD 2-clause \"Simplified\" License",
@@ -51,6 +54,7 @@ the main legacy encoding for Unix machines in Korea.",
"QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
"Path": "qjiscodec.cpp",
+ "Description": "Treat as final version; no upstream known",
"Description": "The ISO 2022-JP (JIS) text codec provides conversion to and from ISO 2022-JP.",
"License": "BSD 2-clause \"Simplified\" License",
"LicenseId": "BSD-2-Clause",
@@ -64,6 +68,7 @@ the main legacy encoding for Unix machines in Korea.",
"QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
"Path": "qsjiscodec.cpp",
+ "Description": "Treat as final version; no upstream known",
"Description": "The Shift-JIS text codec provides conversion to and from Shift-JIS.",
"License": "BSD 2-clause \"Simplified\" License",
"LicenseId": "BSD-2-Clause",
@@ -77,6 +82,7 @@ the main legacy encoding for Unix machines in Korea.",
"QtUsage": "Used in Qt Core.",
"Path": "qtsciicodec.cpp",
+ "Description": "Treat as final version; no upstream known",
"Description": "The TSCII text codec provides conversion to and from the Tamil TSCII
encoding.",
"License": "BSD 2-clause \"Simplified\" License",
@@ -91,6 +97,7 @@ encoding.",
"QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
"Path": "qgb18030codec.cpp",
+ "Description": "Treat as final version; no upstream known",
"Description": "The GBK codec provides conversion to and from the Chinese
GB18030/GBK/GB2312 encoding.",
"License": "BSD 2-clause \"Simplified\" License",
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index 0109e2c658..b373267fcb 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -417,6 +417,23 @@ static const char *findWMstr(uint msg)
{ 0x0232, "WM_EXITSIZEMOVE" },
{ 0x0233, "WM_DROPFILES" },
{ 0x0234, "WM_MDIREFRESHMENU" },
+ { 0x0241, "WM_NCPOINTERUPDATE"},
+ { 0x0242, "WM_NCPOINTERDOWN"},
+ { 0x0243, "WM_NCPOINTERUP"},
+ { 0x0245, "WM_POINTERUPDATE"},
+ { 0x0246, "WM_POINTERDOWN"},
+ { 0x0247, "WM_POINTERUP"},
+ { 0x0249, "WM_POINTERENTER"},
+ { 0x024A, "WM_POINTERLEAVE"},
+ { 0x0248, "WM_POINTERACTIVATE"},
+ { 0x024C, "WM_POINTERCAPTURECHANGED"},
+ { 0x024D, "WM_TOUCHHITTESTING"},
+ { 0x024E, "WM_POINTERWHEEL"},
+ { 0x024F, "WM_POINTERHWHEEL"},
+ { 0x0250, "DM_POINTERHITTEST"},
+ { 0x0251, "WM_POINTERROUTEDTO"},
+ { 0x0252, "WM_POINTERROUTEDAWAY"},
+ { 0x0253, "WM_POINTERROUTEDRELEASED"},
{ 0x0281, "WM_IME_SETCONTEXT" },
{ 0x0282, "WM_IME_NOTIFY" },
{ 0x0283, "WM_IME_CONTROL" },
@@ -700,7 +717,7 @@ QString decodeMSG(const MSG& msg)
else if (const char *wmmsgC = findWMstr(msg.message))
message = QString::fromLatin1(wmmsgC);
else
- message = QString::fromLatin1("WM_(%1)").arg(msg.message); // Unknown WM_, so use number
+ message = QString::fromLatin1("WM_(0x%1)").arg(msg.message, 0, 16); // Unknown WM_, so use number
// Yes, we want to give the WM_ names 20 chars of space before showing the
// decoded message, since some of the common messages are quite long, and
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 07208b7f40..deab51cfd0 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -421,6 +421,7 @@ void QObjectPrivate::cleanConnectionLists()
{
if (connectionLists->dirty && !connectionLists->inUse) {
// remove broken connections
+ bool allConnected = false;
for (int signal = -1; signal < connectionLists->count(); ++signal) {
QObjectPrivate::ConnectionList &connectionList =
(*connectionLists)[signal];
@@ -432,11 +433,13 @@ void QObjectPrivate::cleanConnectionLists()
QObjectPrivate::Connection **prev = &connectionList.first;
QObjectPrivate::Connection *c = *prev;
+ bool connected = false; // whether the signal is still connected somewhere
while (c) {
if (c->receiver) {
last = c;
prev = &c->nextConnectionList;
c = *prev;
+ connected = true;
} else {
QObjectPrivate::Connection *next = c->nextConnectionList;
*prev = next;
@@ -448,6 +451,14 @@ void QObjectPrivate::cleanConnectionLists()
// Correct the connection list's last pointer.
// As conectionList.last could equal last, this could be a noop
connectionList.last = last;
+
+ if (!allConnected && !connected && signal >= 0
+ && size_t(signal) < sizeof(connectedSignals) * 8) {
+ // This signal is no longer connected
+ connectedSignals[signal >> 5] &= ~(1 << (signal & 0x1f));
+ } else if (signal == -1) {
+ allConnected = connected;
+ }
}
connectionLists->dirty = false;
}
@@ -2501,19 +2512,20 @@ bool QObject::isSignalConnected(const QMetaMethod &signal) const
signalIndex += QMetaObjectPrivate::signalOffset(signal.mobj);
- if (signalIndex < sizeof(d->connectedSignals) * 8)
+ QMutexLocker locker(signalSlotLock(this));
+ if (!d->connectionLists)
+ return false;
+
+ if (signalIndex < sizeof(d->connectedSignals) * 8 && !d->connectionLists->dirty)
return d->isSignalConnected(signalIndex);
- QMutexLocker locker(signalSlotLock(this));
- if (d->connectionLists) {
- if (signalIndex < uint(d->connectionLists->count())) {
- const QObjectPrivate::Connection *c =
- d->connectionLists->at(signalIndex).first;
- while (c) {
- if (c->receiver)
- return true;
- c = c->nextConnectionList;
- }
+ if (signalIndex < uint(d->connectionLists->count())) {
+ const QObjectPrivate::Connection *c =
+ d->connectionLists->at(signalIndex).first;
+ while (c) {
+ if (c->receiver)
+ return true;
+ c = c->nextConnectionList;
}
}
return false;
diff --git a/src/corelib/kernel/qt_attribution.json b/src/corelib/kernel/qt_attribution.json
index 37764a5330..6d8f4f2abc 100644
--- a/src/corelib/kernel/qt_attribution.json
+++ b/src/corelib/kernel/qt_attribution.json
@@ -5,6 +5,7 @@
"QtUsage": "Used in Qt Core on macOS.",
"Path": "qeventdispatcher_cf_p.h",
+ "Description": "Treat as final version; no upstream known",
"Description": "Implementation of QAbstractEventDispatcher for macOS.",
"License": "BSD 3-clause \"New\" or \"Revised\" License",
"LicenseId": "BSD-3-Clause",
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 0b4c3f387f..6541b97595 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -3523,13 +3523,19 @@ bool QVariant::canConvert(int targetTypeId) const
}
// TODO Reimplement this function, currently it works but it is a historical mess.
- uint currentType = ((d.type == QMetaType::Float) ? QVariant::Double : d.type);
+ uint currentType = d.type;
if (currentType == QMetaType::SChar || currentType == QMetaType::Char)
currentType = QMetaType::UInt;
if (targetTypeId == QMetaType::SChar || currentType == QMetaType::Char)
targetTypeId = QMetaType::UInt;
- if (uint(targetTypeId) == uint(QMetaType::Float)) targetTypeId = QVariant::Double;
-
+ if (currentType == QMetaType::Short || currentType == QMetaType::UShort)
+ currentType = QMetaType::Int;
+ if (targetTypeId == QMetaType::Short || currentType == QMetaType::UShort)
+ targetTypeId = QMetaType::Int;
+ if (currentType == QMetaType::Float)
+ currentType = QMetaType::Double;
+ if (targetTypeId == QMetaType::Float)
+ targetTypeId = QMetaType::Double;
if (currentType == uint(targetTypeId))
return true;
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index c4a8458243..aac51184a4 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -502,7 +502,7 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
QString lang = xml.attributes().value(QLatin1String("xml:lang")).toString();
const QString text = xml.readElementText();
if (lang.isEmpty()) {
- lang = QLatin1String("en_US");
+ lang = QLatin1String("default"); // no locale attribute provided, treat it as default.
}
data.localeComments.insert(lang, text);
continue; // we called readElementText, so we're at the EndElement already.
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 50b8eae5c3..55c7de0c87 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -258,6 +258,7 @@ QString QMimeType::comment() const
QStringList languageList;
languageList << QLocale().name();
languageList << QLocale().uiLanguages();
+ languageList << QLatin1String("default"); // use the default locale if possible.
for (const QString &language : qAsConst(languageList)) {
const QString lang = language == QLatin1String("C") ? QLatin1String("en_US") : language;
const QString comm = d->localeComments.value(lang);
diff --git a/src/corelib/mimetypes/qmimetypeparser.cpp b/src/corelib/mimetypes/qmimetypeparser.cpp
index 7ff695bbc3..d10575cfe9 100644
--- a/src/corelib/mimetypes/qmimetypeparser.cpp
+++ b/src/corelib/mimetypes/qmimetypeparser.cpp
@@ -248,11 +248,11 @@ bool QMimeTypeParserBase::parse(QIODevice *dev, const QString &fileName, QString
}
break;
case ParseComment: {
- // comments have locale attributes. We want the default, English one
+ // comments have locale attributes.
QString locale = atts.value(QLatin1String(localeAttributeC)).toString();
const QString comment = reader.readElementText();
if (locale.isEmpty())
- locale = QString::fromLatin1("en_US");
+ locale = QString::fromLatin1("default");
data.localeComments.insert(locale, comment);
}
break;
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index e04d27d7b6..e56fe2c6ae 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -465,11 +465,7 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
void QThread::yieldCurrentThread()
{
-#if !defined(Q_OS_WINRT)
SwitchToThread();
-#else
- ::Sleep(0);
-#endif
}
#endif // QT_CONFIG(thread)
diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h
index faa7263d6b..fdb9c6d19a 100644
--- a/src/corelib/tools/qcontiguouscache.h
+++ b/src/corelib/tools/qcontiguouscache.h
@@ -217,6 +217,7 @@ void QContiguousCache<T>::setCapacity(int asize)
detach();
union { QContiguousCacheData *d; QContiguousCacheTypedData<T> *p; } x;
x.d = allocateData(asize);
+ x.d->ref.store(1);
x.d->alloc = asize;
x.d->count = qMin(d->count, asize);
x.d->offset = d->offset + d->count - x.d->count;