diff options
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker.cxx | 12 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker.hxx | 6 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker2.cxx | 20 |
3 files changed, 25 insertions, 13 deletions
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index d3939e1d7e1f..02135eaa4a9a 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -91,18 +91,6 @@ QString KDE5FilePicker::getCurrentFilter() const return filter; } -void KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction, bool value) -{ - if (_customWidgets.contains(controlId)) - { - QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId)); - if (cb) - cb->setChecked(value); - } - else - qWarning() << "set value on unknown control" << controlId; -} - bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const { bool ret = false; diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index d303ba30a6ac..675becf0bf68 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -174,10 +174,16 @@ protected: Q_SIGNALS: void setTitleSignal(const OUString& rTitle); void setDisplayDirectorySignal(const OUString& rDir); + void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction, + const css::uno::Any& rValue); private Q_SLOTS: void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); } void setDisplayDirectorySlot(const OUString& rDir) { return setDisplayDirectory(rDir); } + void setValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue) + { + return setValue(nControlAction, nControlAction, rValue); + } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 96b6a0fe3c4f..a920b9f3cbb7 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -105,6 +105,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) connect(this, &KDE5FilePicker::setDisplayDirectorySignal /*(const OUString&)*/, this, &KDE5FilePicker::setDisplayDirectorySlot /*(const OUString&)*/, Qt::BlockingQueuedConnection); + connect(this, &KDE5FilePicker::setValueSignal, this, &KDE5FilePicker::setValueSlot, + Qt::BlockingQueuedConnection); qApp->installEventFilter(this); setMultiSelectionMode(false); @@ -205,6 +207,23 @@ void SAL_CALL KDE5FilePicker::appendFilterGroup(const OUString& /*rGroupTitle*/, void SAL_CALL KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction, const uno::Any& value) { + if (qApp->thread() != QThread::currentThread()) + { + SolarMutexReleaser aReleaser; + return Q_EMIT setValueSignal(controlId, nControlAction, value); + } + + if (_customWidgets.contains(controlId)) + { + bool bChecked = false; + value >>= bChecked; + + QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId)); + if (cb) + cb->setChecked(bChecked); + } + else + SAL_WARN("vcl.kde5", "set value on unknown control " << controlId); } uno::Any SAL_CALL KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) @@ -433,7 +452,6 @@ void SAL_CALL KDE5FilePicker::initialize(const uno::Sequence<uno::Any>& args) OSL_TRACE("Unknown templates %d", templateId); return; } - setTitle(VclResId(saveDialog ? STR_FPICKER_SAVE : STR_FPICKER_OPEN)); } |