diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-11-01 11:12:59 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-11-12 23:03:55 +0100 |
commit | 8fb0881a3e5b2c5120af18823f6f58a1bda7cadd (patch) | |
tree | 7579b6ab30a134fd56b6c453e94baffa8765a540 /vcl/unx | |
parent | 77b5271dc9f397233f3583c4b1827404d5730bc1 (diff) |
tdf#119856: thread-proof kde5 fpicker execute() and getFiles()
so they can be called from extensions
Change-Id: I58b4ee25ef9a58a8d051ffd542119984973095f0
Reviewed-on: https://gerrit.libreoffice.org/62728
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker.hxx | 1 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker2.cxx | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index df7d8499ecae..8179170e831d 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -185,6 +185,7 @@ Q_SIGNALS: const css::uno::Sequence<css::beans::StringPair>& rFilters); void setCurrentFilterSignal(const OUString& rFilter); OUString getCurrentFilterSignal(); + css::uno::Sequence<OUString> getFilesSignal(); css::uno::Sequence<OUString> getSelectedFilesSignal(); void setMultiSelectionSignal(bool bMulti); diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 576318e18799..553ed8500c84 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -106,7 +106,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged); connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged); - connect(this, &KDE5FilePicker::executeSignal, this, &KDE5FilePicker::execute); + connect(this, &KDE5FilePicker::executeSignal, this, &KDE5FilePicker::execute, + Qt::BlockingQueuedConnection); // XExecutableDialog connect(this, &KDE5FilePicker::setTitleSignal, this, &KDE5FilePicker::setTitleSlot, @@ -147,6 +148,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) // XFilePicker2 connect(this, &KDE5FilePicker::getSelectedFilesSignal, this, &KDE5FilePicker::getSelectedFilesSlot, Qt::BlockingQueuedConnection); + connect(this, &KDE5FilePicker::getFilesSignal, this, &KDE5FilePicker::getFiles, + Qt::BlockingQueuedConnection); qApp->installEventFilter(this); } @@ -186,6 +189,7 @@ sal_Int16 SAL_CALL KDE5FilePicker::execute() { if (qApp->thread() != QThread::currentThread()) { + //SolarMutexReleaser aReleaser; return Q_EMIT executeSignal(); } @@ -250,6 +254,12 @@ OUString SAL_CALL KDE5FilePicker::getDisplayDirectory() uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getFiles() { + if (qApp->thread() != QThread::currentThread()) + { + //SolarMutexReleaser aReleaser; + return Q_EMIT getFilesSignal(); + } + uno::Sequence<OUString> seq = getSelectedFiles(); if (seq.getLength() > 1) seq.realloc(1); |