diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2019-02-06 12:37:39 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-02-20 16:49:05 +0100 |
commit | fa7387077bb708a2f3ec3e747463c9fd9f077f29 (patch) | |
tree | cb967284e20bd2394cadc2138b5069f4f1671b01 /vcl | |
parent | d5ac5eb59dda2c1dc537f5a4baf13515af7a57aa (diff) |
Drop KDE5FilePicker::getDirectory
Use base class's 'Qt5FilePicker::getDirectory' instead
to reduce duplication.
Strictly speaking, the 'KDE5FilePicker::implGetDirectory'
implementation used by 'KDE5FilePicker::getDirectory'
suggests that the display directory is returned
rather than the selected directory, and the same
method 'implGetDirectory()' was actually previously used
by the 'KDE5FilePicker::getDisplayDirectory()' method
as well (removed in a previous commit).
The code worked fine inside KDE5FilePicker (where the
native Plasma/kde5 file dialog is used) but would lead
to incorrect results when used inside Qt5FilePicker, e.g.
for the following scenario
* open folder picker displaying $HOME that contains
a directory "bar"
* do a single mouse click on the "bar" directory
* click "OK"
The call to 'toOUString(m_pFileDialog->directoryUrl().url())'
inside 'getDirectory()' would return '$HOME/bar' for the native
QFileDialog on KDE Plasma 5, but '$HOME' when
used with the non-native QFileDialog
Anyway, the implementation inside 'Qt5FilePicker::getDirectory'
works fine for both cases, so just drop the KDE5FilePicker one.
Change-Id: I86dcf98ed310636b899ad289d8a8a8fa263dd2e9
Reviewed-on: https://gerrit.libreoffice.org/68050
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker.hxx | 4 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker2.cxx | 21 |
2 files changed, 0 insertions, 25 deletions
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index ed1bd7da7243..ed5b480884cc 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -96,7 +96,6 @@ public: virtual OUString SAL_CALL getLabel(sal_Int16 nControlId) override; // XFolderPicker stuff - virtual OUString SAL_CALL getDirectory() override; virtual void SAL_CALL setDescription(const OUString& rDescription) override; /* TODO XFilePreview @@ -127,14 +126,12 @@ private: static void handleSetListValue(QComboBox* pQComboBox, sal_Int16 nAction, const css::uno::Any& rValue); static css::uno::Any handleGetListValue(QComboBox* pQComboBox, sal_Int16 nAction); - OUString implGetDirectory(); protected: bool eventFilter(QObject* watched, QEvent* event) override; Q_SIGNALS: sal_Int16 executeSignal(); - OUString getDirectorySignal(); void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue); css::uno::Any getValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction); @@ -148,7 +145,6 @@ Q_SIGNALS: OUString getCurrentFilterSignal(); private Q_SLOTS: - OUString getDirectorySlot() { return implGetDirectory(); } void setValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue) { return setValue(nControlId, nControlAction, rValue); diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 9cad538a2048..a99a064d16ff 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -102,9 +102,6 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) connect(this, &KDE5FilePicker::executeSignal, this, &KDE5FilePicker::execute, Qt::BlockingQueuedConnection); - // XFolderPicker - connect(this, &KDE5FilePicker::getDirectorySignal, this, &KDE5FilePicker::getDirectorySlot, - Qt::BlockingQueuedConnection); // XFilterManager connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot, Qt::BlockingQueuedConnection); @@ -339,18 +336,6 @@ OUString SAL_CALL KDE5FilePicker::getLabel(sal_Int16 controlId) return label; } -// XFolderPicker -OUString SAL_CALL KDE5FilePicker::getDirectory() -{ - if (qApp->thread() != QThread::currentThread()) - { - SolarMutexReleaser aReleaser; - return Q_EMIT getDirectorySignal(); - } - - return implGetDirectory(); -} - void SAL_CALL KDE5FilePicker::setDescription(const OUString&) {} void KDE5FilePicker::addCustomControl(sal_Int16 controlId) @@ -532,12 +517,6 @@ uno::Any KDE5FilePicker::handleGetListValue(QComboBox* pQComboBox, sal_Int16 nAc return aAny; } -OUString KDE5FilePicker::implGetDirectory() -{ - OUString dir = toOUString(m_pFileDialog->directoryUrl().url()); - return dir; -} - // XInitialization void SAL_CALL KDE5FilePicker::initialize(const uno::Sequence<uno::Any>& args) { |