From 6792c42f1ec0dc44617c74e1b1a69c0b200ded07 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Mon, 3 Jun 2019 15:29:23 +0300 Subject: Add names for pthreads in Integrity Set name for pthread instead of "name too long" for easier tracking. Change-Id: Iab22cbeac01277e4dc1325399c7892de2e5bd551 Reviewed-by: Timo Aarnipuro Reviewed-by: Thiago Macieira --- src/corelib/thread/qthread_unix.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 329caa02ba..695d45d8e7 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -720,6 +720,12 @@ void QThread::start(Priority priority) } } +#ifdef Q_OS_INTEGRITY + if (Q_LIKELY(objectName().isEmpty())) + pthread_attr_setthreadname(&attr, metaObject()->className()); + else + pthread_attr_setthreadname(&attr, objectName().toLocal8Bit()); +#endif pthread_t threadId; int code = pthread_create(&threadId, &attr, QThreadPrivate::start, this); if (code == EPERM) { -- cgit v1.2.3 From 93642992ae779f3d8c864e5680ff2dfdfa9d0331 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Tue, 11 Jun 2019 12:07:55 +0200 Subject: Doc: Correct documentation of QFuture::cancel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-76305 Change-Id: I192a7f0bc2c15e532bc6d51c7e9c39561ae3436c Reviewed-by: Topi Reiniö Reviewed-by: Jędrzej Nowacki --- src/corelib/thread/qfuture.qdoc | 8 ++++---- src/corelib/thread/qfuturewatcher.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/thread/qfuture.qdoc b/src/corelib/thread/qfuture.qdoc index 7db65dacd3..076725e19c 100644 --- a/src/corelib/thread/qfuture.qdoc +++ b/src/corelib/thread/qfuture.qdoc @@ -55,8 +55,8 @@ instance, the computation can be canceled with the cancel() function. To pause the computation, use the setPaused() function or one of the pause(), resume(), or togglePaused() convenience functions. Be aware that not all - asynchronous computations can be canceled or paused. For example, the - future returned by QtConcurrent::run() cannot be canceled; but the + running asynchronous computations can be canceled or paused. For example, + the future returned by QtConcurrent::run() cannot be canceled; but the future returned by QtConcurrent::mappedReduced() can. Progress information is provided by the progressValue(), @@ -133,8 +133,8 @@ Any QFutureWatcher object that is watching this future will not deliver progress and result ready signals on a canceled future. - Be aware that not all asynchronous computations can be canceled. For - example, the future returned by QtConcurrent::run() cannot be canceled; + Be aware that not all running asynchronous computations can be canceled. + For example, the future returned by QtConcurrent::run() cannot be canceled; but the future returned by QtConcurrent::mappedReduced() can. */ diff --git a/src/corelib/thread/qfuturewatcher.cpp b/src/corelib/thread/qfuturewatcher.cpp index faeb6b3a28..8e90d043ef 100644 --- a/src/corelib/thread/qfuturewatcher.cpp +++ b/src/corelib/thread/qfuturewatcher.cpp @@ -84,8 +84,8 @@ QT_BEGIN_NAMESPACE \snippet code/src_corelib_thread_qfuturewatcher.cpp 0 - Be aware that not all asynchronous computations can be canceled or paused. - For example, the future returned by QtConcurrent::run() cannot be + Be aware that not all running asynchronous computations can be canceled or + paused. For example, the future returned by QtConcurrent::run() cannot be canceled; but the future returned by QtConcurrent::mappedReduced() can. QFutureWatcher is specialized to not contain any of the result @@ -124,9 +124,9 @@ QFutureWatcherBase::QFutureWatcherBase(QObject *parent) progressRangeChanged(), progressTextChanged(), resultReadyAt(), and resultsReadyAt() signals. - Be aware that not all asynchronous computations can be canceled. For - example, the QFuture returned by QtConcurrent::run() cannot be canceled; - but the QFuture returned by QtConcurrent::mappedReduced() can. + Be aware that not all running asynchronous computations can be canceled. + For example, the QFuture returned by QtConcurrent::run() cannot be + canceled; but the QFuture returned by QtConcurrent::mappedReduced() can. */ void QFutureWatcherBase::cancel() { -- cgit v1.2.3 From b68a9df076a5f821b1a1b49207fad9ec9ac8a251 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 3 Jun 2019 13:40:01 +0200 Subject: Fix bogus setAttribute setter warning Since e9e16c74643 running webengine application you can get warning "Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created." WebEngine set shared open gl context on qt_call_pre_routines, so when QCoreApplicationPrivate init() runs. Fixes: QTBUG-76391 Change-Id: I5fc146ed70054b0c1597fe06615cea2d7a8969d8 Reviewed-by: Kai Koehne --- src/corelib/kernel/qcoreapplication.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 8652c45634..db6546028a 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -979,7 +979,11 @@ void QCoreApplication::setAttribute(Qt::ApplicationAttribute attribute, bool on) QCoreApplicationPrivate::attribs |= 1 << attribute; else QCoreApplicationPrivate::attribs &= ~(1 << attribute); +#if defined(QT_NO_QOBJECT) if (Q_UNLIKELY(qApp)) { +#else + if (Q_UNLIKELY(QCoreApplicationPrivate::is_app_running)) { +#endif switch (attribute) { case Qt::AA_EnableHighDpiScaling: case Qt::AA_DisableHighDpiScaling: -- cgit v1.2.3 From c086fc7341bcd57d0b7a459bb3ba7cfe1ccbd8be Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 19 Jun 2019 20:11:19 +0200 Subject: Report correct data when multiple volumes are mounted to the same path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We read the data into the iterator from the system, but then recreate the QStorageInfo object based on the rootPath, and then stat, discarding the data in the iterator. We can overwrite the data with the information in the iterator, which partially fixes the issue. Volume information that can only be retrieved by stat'ing the root path, such as size information, will only be correct for one of the entries. Change-Id: Ie98590876d6a5f525af009f4ff5d595cbc308b3f Fixes: QTBUG-63209 Reviewed-by: Andrius Štikonas Reviewed-by: Thiago Macieira --- src/corelib/io/qstorageinfo_unix.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp index b7621b5d2f..11b5af069a 100644 --- a/src/corelib/io/qstorageinfo_unix.cpp +++ b/src/corelib/io/qstorageinfo_unix.cpp @@ -846,6 +846,9 @@ QList QStorageInfoPrivate::mountedVolumes() const QString mountDir = it.rootPath(); QStorageInfo info(mountDir); + info.d->device = it.device(); + info.d->fileSystemType = it.fileSystemType(); + info.d->subvolume = it.subvolume(); if (info.bytesTotal() == 0) continue; volumes.append(info); -- cgit v1.2.3 From 7940791f477fd991bb4e1b833e10cc23c696332e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 20 Jun 2019 12:46:30 +0200 Subject: Report correct state change when destroying QAbstractAnimation Change-Id: Ibe5310e20268d1baa5b329a4d02a3dc38d875008 Reviewed-by: Simon Hausmann --- src/corelib/animation/qabstractanimation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 78b79e574a..42308b78fb 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -1061,7 +1061,7 @@ QAbstractAnimation::~QAbstractAnimation() if (d->state != Stopped) { QAbstractAnimation::State oldState = d->state; d->state = Stopped; - emit stateChanged(oldState, d->state); + emit stateChanged(d->state, oldState); if (oldState == QAbstractAnimation::Running) QAnimationTimer::unregisterAnimation(this); } -- cgit v1.2.3 From 0ef61500059e6ebed30b76140a78e6e9149b318e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 19 Jun 2019 17:15:26 -0700 Subject: QCborValue::fromJsonValue: rewrite code to remove UB Converting an out-of-range FP to integer is UB. See comment in qnumeric_p.h. Change-Id: Ief874765cd7b43798de3fffd15a9bfe2c5fbbc01 Reviewed-by: Marc Mutz Reviewed-by: Ulf Hermann --- src/corelib/serialization/qjsoncbor.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/serialization/qjsoncbor.cpp b/src/corelib/serialization/qjsoncbor.cpp index 4f756df97c..4603750d11 100644 --- a/src/corelib/serialization/qjsoncbor.cpp +++ b/src/corelib/serialization/qjsoncbor.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 Intel Corporation. +** Copyright (C) 2019 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -598,10 +598,12 @@ QCborValue QCborValue::fromJsonValue(const QJsonValue &v) switch (v.type()) { case QJsonValue::Bool: return v.b; - case QJsonValue::Double: - if (v.dbl == qint64(v.dbl)) - return qint64(v.dbl); + case QJsonValue::Double: { + qint64 i; + if (convertDoubleTo(v.dbl, &i)) + return i; return v.dbl; + } case QJsonValue::String: return v.toString(); case QJsonValue::Array: -- cgit v1.2.3 From 47691260ca623643107ace846352a3604436e428 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Thu, 13 Jun 2019 11:05:12 +0200 Subject: move ENDSESSION_* compat defines to before they are actually used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit amends 144d33df72e5ca905b1d64134784923d5c. Change-Id: Ic6bc475c9d8c3bb727ee209dbab437a18e219b6d Reviewed-by: Jörg Bornemann --- src/corelib/kernel/qcoreapplication_win.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index 75cc813298..4f4a29b41b 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -694,6 +694,12 @@ static const char *winPosInsertAfter(quintptr h) static const char *sessionMgrLogOffOption(uint p) { +#ifndef ENDSESSION_CLOSEAPP +#define ENDSESSION_CLOSEAPP 0x00000001 +#endif +#ifndef ENDSESSION_CRITICAL +#define ENDSESSION_CRITICAL 0x40000000 +#endif static const QWinMessageMapping values[] = { {ENDSESSION_CLOSEAPP, "Close application"}, {ENDSESSION_CRITICAL, "Force application end"}, @@ -887,12 +893,6 @@ QString decodeMSG(const MSG& msg) parameters += QLatin1Char(')'); } break; -#ifndef ENDSESSION_CLOSEAPP -#define ENDSESSION_CLOSEAPP 0x00000001 -#endif -#ifndef ENDSESSION_CRITICAL -#define ENDSESSION_CRITICAL 0x40000000 -#endif case WM_QUERYENDSESSION: parameters = QLatin1String("End session: "); if (const char *logoffOption = sessionMgrLogOffOption(uint(wParam))) -- cgit v1.2.3