on xenial help sign in
Be more thread safe

CroppedImageSizerAsyncWorker::processRequestFinished lives in the non main thread so use a QueuedConnection to call CroppedImageSizer::setSourceSize

commit5509d1a5faf969f755b37f2760aa715d9bc849d4 authorAlbert Astals <albert.astals@canonical.com> dateTue 11 Nov 2014, 13:50 (12 years ago) parent385f205
2 files changed+2−2
plugins/Dash/croppedimagesizer.h+1−1 plugins/Dash/croppedimagesizerasyncworker.cpp+1−1
plugins/Dash/croppedimagesizer.h+1−1
@@ -47,7 +47,7 @@ public:
4747 void setHeight(qreal height);
4848
4949 QSize sourceSize() const;
50− void setSourceSize(const QSize &sourceSize);
50+ Q_INVOKABLE void setSourceSize(const QSize &sourceSize);
5151
5252Q_SIGNALS:
5353 void inputParamsChanged();
plugins/Dash/croppedimagesizerasyncworker.cpp+1−1
@@ -78,7 +78,7 @@ void CroppedImageSizerAsyncWorker::processRequestFinished(qreal width, qreal hei
7878
7979 worker->m_mutex.lock();
8080 if (worker->m_sizer) {
81− worker->m_sizer->setSourceSize(sourceSize);
81+ QMetaObject::invokeMethod(worker->m_sizer, "setSourceSize", Qt::QueuedConnection, Q_ARG(QSize, sourceSize));
8282 }
8383 worker->m_mutex.unlock();
8484