From e8a1115567e3292a8de8b6e26f443b8b2edcba74 Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Thu, 7 Jun 2018 12:47:35 +0200 Subject: Add setTitle functionality, signal+slot Change-Id: Ib79837ff08cabf8a27b6d154529399a5965ab148 --- vcl/unx/kde5/KDE5FilePicker.cxx | 2 -- vcl/unx/kde5/KDE5FilePicker.hxx | 6 ++++++ vcl/unx/kde5/KDE5FilePicker2.cxx | 19 +++++++++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index 3e1387da7fd2..3968a0f686a6 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -46,8 +46,6 @@ KDE5FilePicker::~KDE5FilePicker() delete _dialog; } -//void KDE5FilePicker::setTitle(const QString& title) { _dialog->setWindowTitle(title); } - /*void KDE5FilePicker::setMultiSelectionMode(bool multiSelect) { _dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile); diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index ea18b3298ed4..6078a53b0f98 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -163,6 +163,12 @@ private: protected: bool eventFilter(QObject* watched, QEvent* event) override; + +Q_SIGNALS: + void setTitleSignal(const OUString& rTitle); + +private Q_SLOTS: + void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index e505791cad03..8df045b3aa59 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -31,16 +31,15 @@ #include #include - -#include - #include "FPServiceInfo.hxx" #undef Region #include +#include #include +#include #include #include #include @@ -50,6 +49,7 @@ #include #include +#include #include using namespace ::com::sun::star; @@ -99,6 +99,8 @@ KDE5FilePicker::KDE5FilePicker(const uno::Reference&) connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged); connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged); + connect(this, &KDE5FilePicker::setTitleSignal /*(const OUString&)*/, this, + &KDE5FilePicker::setTitleSlot /*(const OUString&)*/, Qt::BlockingQueuedConnection); qApp->installEventFilter(this); setMultiSelectionMode(false); @@ -117,7 +119,16 @@ void SAL_CALL KDE5FilePicker::removeFilePickerListener(const uno::Referencethread() != QThread::currentThread()) + { + SolarMutexReleaser aReleaser; + return Q_EMIT setTitleSignal(title); + } + + _dialog->setWindowTitle(toQString(title)); +} sal_Int16 SAL_CALL KDE5FilePicker::execute() { -- cgit