vcl/unx/kde5/KDE5FilePicker.hxx | 1 + vcl/unx/kde5/KDE5FilePicker2.cxx | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-)
New commits: commit 8fb0881a3e5b2c5120af18823f6f58a1bda7cadd Author: Katarina Behrens <katarina.behr...@cib.de> AuthorDate: Thu Nov 1 11:12:59 2018 +0100 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Mon Nov 12 23:03:55 2018 +0100 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.behr...@cib.de> 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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits