diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2024-01-09 00:26:30 +0100 |
---|---|---|
committer | Morten Sørvig <morten.sorvig@qt.io> | 2024-02-08 15:37:02 +0100 |
commit | 97330602cc167d542e9f3265bb110f99942eadaf (patch) | |
tree | bb420afd3887b5a0433207a409f7a97e5b02c642 /src/qml/qml | |
parent | 6bed7c1e7598089b1b2e1a4cb2ef3efc893fb953 (diff) |
no-thread: remove special cases for callbacks
We can use the common postMethodToMain() call here instead of
postMethodToThread(), since the former function handles the
case where the main thread is posting the callback to itself.
This change should not introduce a behavior change: postMethodToThread()
will call internalPostMethodToMain() in this case.
Change-Id: If5f190d2f4fed124622030df096b78b9886e6212
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmltypeloaderthread.cpp | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/qml/qml/qqmltypeloaderthread.cpp b/src/qml/qml/qqmltypeloaderthread.cpp index 3d35962c08..18d1dbe7ce 100644 --- a/src/qml/qml/qqmltypeloaderthread.cpp +++ b/src/qml/qml/qqmltypeloaderthread.cpp @@ -72,22 +72,12 @@ void QQmlTypeLoaderThread::loadWithCachedUnitAsync(const QQmlDataBlob::Ptr &b, c void QQmlTypeLoaderThread::callCompleted(const QQmlDataBlob::Ptr &b) { -#if !QT_CONFIG(thread) - if (!isThisThread()) - postMethodToThread(&This::callCompletedMain, b); -#else postMethodToMain(&This::callCompletedMain, b); -#endif } void QQmlTypeLoaderThread::callDownloadProgressChanged(const QQmlDataBlob::Ptr &b, qreal p) { -#if !QT_CONFIG(thread) - if (!isThisThread()) - postMethodToThread(&This::callDownloadProgressChangedMain, b, p); -#else postMethodToMain(&This::callDownloadProgressChangedMain, b, p); -#endif } void QQmlTypeLoaderThread::initializeEngine(QQmlExtensionInterface *iface, |