diff options
author | Jan-Marek Glogowski <jan-marek.glogowski@extern.cib.de> | 2019-12-03 06:54:14 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-12-05 12:28:37 +0100 |
commit | c0cdb01ef33042be76251c4a353e0582a0838e0e (patch) | |
tree | 8e7377b3c7bcfe146601cead3bb1b0a4d6fb0e5b /vcl/unx | |
parent | 81f01259dfe29b7ee73c42d3b44934d6fc973cd8 (diff) |
KF5 drop KF5FilePicker::execute
To prevent calls to Qt5FilePicker::updateAutomaticFileExtension,
it is simply made virtual with an empty override. This is needed,
because the KF5 file picker has its own automatic extension
handling.
The main motivation is the fix for tdf#129071, which will result
in some major changes to XExecutableDialog::execute, so this will
prevent larger code duplication later.
Change-Id: I5f747f0828cb8a65b4e7043f3ee68ebd31973e6a
Reviewed-on: https://gerrit.libreoffice.org/84297
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/kf5/KF5FilePicker.cxx | 22 | ||||
-rw-r--r-- | vcl/unx/kf5/KF5FilePicker.hxx | 7 |
2 files changed, 4 insertions, 25 deletions
diff --git a/vcl/unx/kf5/KF5FilePicker.cxx b/vcl/unx/kf5/KF5FilePicker.cxx index a7ecd938ccca..0d95cd0be304 100644 --- a/vcl/unx/kf5/KF5FilePicker.cxx +++ b/vcl/unx/kf5/KF5FilePicker.cxx @@ -70,28 +70,6 @@ KF5FilePicker::KF5FilePicker(css::uno::Reference<css::uno::XComponentContext> co qApp->installEventFilter(this); } -sal_Int16 SAL_CALL KF5FilePicker::execute() -{ - SolarMutexGuard g; - auto* pSalInst(static_cast<Qt5Instance*>(GetSalData()->m_pInstance)); - assert(pSalInst); - if (!pSalInst->IsMainThread()) - { - sal_Int16 ret; - pSalInst->RunInMainThread([&ret, this] { ret = execute(); }); - return ret; - } - - if (!m_aNamedFilterList.isEmpty()) - m_pFileDialog->setNameFilters(m_aNamedFilterList); - if (!m_aCurrentFilter.isEmpty()) - m_pFileDialog->selectNameFilter(m_aCurrentFilter); - - m_pFileDialog->show(); - //block and wait for user input - return m_pFileDialog->exec() == QFileDialog::Accepted ? 1 : 0; -} - // XFilePickerControlAccess void SAL_CALL KF5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction, const uno::Any& value) diff --git a/vcl/unx/kf5/KF5FilePicker.hxx b/vcl/unx/kf5/KF5FilePicker.hxx index ee731a36a425..0886579cf459 100644 --- a/vcl/unx/kf5/KF5FilePicker.hxx +++ b/vcl/unx/kf5/KF5FilePicker.hxx @@ -35,9 +35,6 @@ public: explicit KF5FilePicker(css::uno::Reference<css::uno::XComponentContext> const& context, QFileDialog::FileMode); - // XExecutableDialog functions - virtual sal_Int16 SAL_CALL execute() override; - // XFilePickerControlAccess functions virtual void SAL_CALL setValue(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue) override; @@ -56,6 +53,10 @@ private: //add a custom control widget to the file dialog void addCustomControl(sal_Int16 controlId) override; bool eventFilter(QObject* watched, QEvent* event) override; + +private Q_SLOTS: + // the KF5 file picker has its own automatic extension handling + void updateAutomaticFileExtension() override {} }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |