summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/inc/qt5/Qt5FilePicker.hxx7
-rw-r--r--vcl/unx/kf5/KF5FilePicker.cxx22
-rw-r--r--vcl/unx/kf5/KF5FilePicker.hxx7
3 files changed, 7 insertions, 29 deletions
diff --git a/vcl/inc/qt5/Qt5FilePicker.hxx b/vcl/inc/qt5/Qt5FilePicker.hxx
index 6fb116875dd4..f88395c6acce 100644
--- a/vcl/inc/qt5/Qt5FilePicker.hxx
+++ b/vcl/inc/qt5/Qt5FilePicker.hxx
@@ -64,9 +64,11 @@ private:
osl::Mutex m_aHelperMutex; ///< mutex used by the WeakComponentImplHelper
+ QStringList m_aNamedFilterList; ///< to keep the original sequence
QHash<QString, QString> m_aTitleToFilterMap;
// to retrieve the filename extension for a given filter
QHash<QString, QString> m_aNamedFilterToExtensionMap;
+ QString m_aCurrentFilter;
QGridLayout* m_pLayout; ///< layout for extra custom controls
QHash<sal_Int16, QWidget*> m_aCustomWidgetsMap; ///< map of SAL control ID's to widget
@@ -74,9 +76,6 @@ private:
const bool m_bIsFolderPicker;
protected:
- QStringList m_aNamedFilterList; ///< to keep the original sequence
- QString m_aCurrentFilter;
-
std::unique_ptr<QFileDialog> m_pFileDialog; ///< the file picker dialog
QWidget* m_pExtraControls; ///< widget to contain extra custom controls
@@ -165,7 +164,7 @@ private Q_SLOTS:
// emit XFilePickerListener fileSelectionChanged event
void currentChanged(const QString&);
// (un)set automatic file extension
- void updateAutomaticFileExtension();
+ virtual void updateAutomaticFileExtension();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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: */