diff options
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker.hxx | 3 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker2.cxx | 26 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5SalInstance.cxx | 1 |
3 files changed, 18 insertions, 12 deletions
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index fb73fbe3b9af..dc3f5c0f63a4 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -92,9 +92,6 @@ private: protected: bool eventFilter(QObject* watched, QEvent* event) override; - -Q_SIGNALS: - sal_Int16 executeSignal(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 5eb1a315db2a..6bdc63de926a 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -36,6 +36,7 @@ #include <unx/geninst.h> #include <qt5/Qt5Tools.hxx> +#include <qt5/Qt5Instance.hxx> #include <QtCore/QDebug> #include <QtCore/QThread> @@ -106,19 +107,20 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) QStringLiteral("smb"), }); - connect(this, &KDE5FilePicker::executeSignal, this, &KDE5FilePicker::execute, - Qt::BlockingQueuedConnection); - // used to set the custom controls qApp->installEventFilter(this); } sal_Int16 SAL_CALL KDE5FilePicker::execute() { - if (qApp->thread() != QThread::currentThread()) + SolarMutexGuard g; + auto* pSalInst(static_cast<Qt5Instance*>(GetSalData()->m_pInstance)); + assert(pSalInst); + if (!pSalInst->IsMainThread()) { - //SolarMutexReleaser aReleaser; - return Q_EMIT executeSignal(); + sal_Int16 ret; + pSalInst->RunInMainThread([&ret, this] { ret = execute(); }); + return ret; } if (!m_aNamedFilterList.isEmpty()) @@ -144,10 +146,16 @@ void SAL_CALL KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAc uno::Any SAL_CALL KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) { - if (qApp->thread() != QThread::currentThread()) + SolarMutexGuard g; + auto* pSalInst(static_cast<Qt5Instance*>(GetSalData()->m_pInstance)); + assert(pSalInst); + if (!pSalInst->IsMainThread()) { - SolarMutexReleaser aReleaser; - return Q_EMIT getValueSignal(controlId, nControlAction); + uno::Any ret; + pSalInst->RunInMainThread([&ret, this, controlId, nControlAction]() { + ret = getValue(controlId, nControlAction); + }); + return ret; } if (CHECKBOX_AUTOEXTENSION == controlId) diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx index 565140cbcf4c..c8453c49d21a 100644 --- a/vcl/unx/kde5/KDE5SalInstance.cxx +++ b/vcl/unx/kde5/KDE5SalInstance.cxx @@ -63,6 +63,7 @@ KDE5SalInstance::createFilePicker(const uno::Reference<uno::XComponentContext>& { if (!IsMainThread()) { + SolarMutexGuard g; uno::Reference<ui::dialogs::XFilePicker2> xRet; RunInMainThread( std::function([&xRet, this, xMSF]() { xRet = this->createFilePicker(xMSF); })); |