[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - vcl/unx
Michael Weghorn (via logerrit)
logerrit at kemper.freedesktop.org
Tue May 21 19:38:21 UTC 2019
vcl/unx/kde5/KDE5FilePicker.hxx | 4 ----
vcl/unx/kde5/KDE5FilePicker2.cxx | 21 ---------------------
2 files changed, 25 deletions(-)
New commits:
commit ec1a6ee0bd8e0c9cd6df6f6f6cda96909234bc3f
Author: Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Wed Feb 6 12:37:39 2019 +0100
Commit: Katarina Behrens <Katarina.Behrens at cib.de>
CommitDate: Tue May 21 21:37:15 2019 +0200
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.
Reviewed-on: https://gerrit.libreoffice.org/68050
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
(cherry picked from commit fa7387077bb708a2f3ec3e747463c9fd9f077f29)
Change-Id: I86dcf98ed310636b899ad289d8a8a8fa263dd2e9
Reviewed-on: https://gerrit.libreoffice.org/72647
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index 2b29c3515dde..58a0c5d95c96 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
@@ -126,14 +125,12 @@ private:
void addCustomControl(sal_Int16 controlId);
void handleSetListValue(QComboBox* pQComboBox, sal_Int16 nAction, const css::uno::Any& rValue);
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);
@@ -147,7 +144,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 fa99c9b7acad..072966c52e44 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -101,9 +101,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);
@@ -338,18 +335,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)
@@ -531,12 +516,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)
{
More information about the Libreoffice-commits
mailing list