[Libreoffice-commits] core.git: vcl/qt5 vcl/unx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Feb 20 15:46:24 UTC 2019
vcl/qt5/Qt5FilePicker.cxx | 8 ++++---
vcl/unx/kde5/KDE5FilePicker.hxx | 7 ------
vcl/unx/kde5/KDE5FilePicker2.cxx | 40 ---------------------------------------
3 files changed, 5 insertions(+), 50 deletions(-)
New commits:
commit e180574ff8b6055fc962974042acb9b1ef27690e
Author: Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Wed Feb 6 08:55:59 2019 +0100
Commit: Katarina Behrens <Katarina.Behrens at cib.de>
CommitDate: Wed Feb 20 16:45:55 2019 +0100
kde5 fpicker: Drop 'getFiles' and 'getSelectedFiles'
... and related signals/slots.
Those from the Qt5FilePicker base class do the same thing,
except for one 'SolarMutexReleaser' that was commented out
in 'KDE5FilePicker::getFiles' for no apparent reason since
that line was added in commit 8fb0881a3e5b2.
Take over the slightly nicer syntax for the range-based for loop
from 'KDE5FilePicker::getSelectedFiles' to
'Qt5FilePicker::getSelectedFiles'.
Change-Id: I419f933d256f3b85eccaea85803b4890770efa24
Reviewed-on: https://gerrit.libreoffice.org/68046
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
diff --git a/vcl/qt5/Qt5FilePicker.cxx b/vcl/qt5/Qt5FilePicker.cxx
index 5a0abc2b8d48..37790a7d0349 100644
--- a/vcl/qt5/Qt5FilePicker.cxx
+++ b/vcl/qt5/Qt5FilePicker.cxx
@@ -300,9 +300,11 @@ uno::Sequence<OUString> SAL_CALL Qt5FilePicker::getSelectedFiles()
}
QList<QUrl> urls = m_pFileDialog->selectedUrls();
uno::Sequence<OUString> seq(urls.size());
- int i = 0;
- foreach (const QUrl& url, urls)
- seq[i++] = toOUString(url.toString());
+
+ size_t i = 0;
+ for (const QUrl& aURL : urls)
+ seq[i++] = toOUString(aURL.toString());
+
return seq;
}
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index 6fff9e44c2a4..451e76af659c 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -81,7 +81,6 @@ public:
// XFilePicker functions
virtual OUString SAL_CALL getDisplayDirectory() override;
- virtual css::uno::Sequence<OUString> SAL_CALL getFiles() override;
// XFilterManager functions
virtual void SAL_CALL appendFilter(const OUString& rTitle, const OUString& rFilter) override;
@@ -117,9 +116,6 @@ public:
virtual sal_Bool SAL_CALL getShowState( );
*/
- // XFilePicker2 functions
- virtual css::uno::Sequence<OUString> SAL_CALL getSelectedFiles() override;
-
// XInitialization
virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
@@ -161,8 +157,6 @@ Q_SIGNALS:
const css::uno::Sequence<css::beans::StringPair>& rFilters);
void setCurrentFilterSignal(const OUString& rFilter);
OUString getCurrentFilterSignal();
- css::uno::Sequence<OUString> getFilesSignal();
- css::uno::Sequence<OUString> getSelectedFilesSignal();
private Q_SLOTS:
OUString getDisplayDirectorySlot() { return implGetDirectory(); }
@@ -202,7 +196,6 @@ private Q_SLOTS:
void setCurrentFilterSlot(const OUString& rFilter) { return setCurrentFilter(rFilter); }
OUString getCurrentFilterSlot() { return getCurrentFilter(); }
- css::uno::Sequence<OUString> getSelectedFilesSlot() { return getFiles(); }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 2d295cf128c5..a3f771bcaf9f 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -130,11 +130,6 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::enableControlSignal, this, &KDE5FilePicker::enableControlSlot,
Qt::BlockingQueuedConnection);
- // XFilePicker2
- connect(this, &KDE5FilePicker::getSelectedFilesSignal, this,
- &KDE5FilePicker::getSelectedFilesSlot, Qt::BlockingQueuedConnection);
- connect(this, &KDE5FilePicker::getFilesSignal, this, &KDE5FilePicker::getFiles,
- Qt::BlockingQueuedConnection);
// used to set the custom controls
qApp->installEventFilter(this);
@@ -171,41 +166,6 @@ OUString SAL_CALL KDE5FilePicker::getDisplayDirectory()
return implGetDirectory();
}
-uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getFiles()
-{
- if (qApp->thread() != QThread::currentThread())
- {
- //SolarMutexReleaser aReleaser;
- return Q_EMIT getFilesSignal();
- }
-
- uno::Sequence<OUString> seq = getSelectedFiles();
- if (seq.getLength() > 1)
- seq.realloc(1);
- return seq;
-}
-
-// XFilePicker2
-uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getSelectedFiles()
-{
- if (qApp->thread() != QThread::currentThread())
- {
- SolarMutexReleaser aReleaser;
- return Q_EMIT getSelectedFilesSignal();
- }
-
- QList<QUrl> aURLs = m_pFileDialog->selectedUrls();
- uno::Sequence<OUString> seq(aURLs.size());
-
- size_t i = 0;
- for (auto& aURL : aURLs)
- {
- seq[i++] = toOUString(aURL.toString());
- }
-
- return seq;
-}
-
// XFilterManager
void SAL_CALL KDE5FilePicker::appendFilter(const OUString& title, const OUString& filter)
{
More information about the Libreoffice-commits
mailing list