[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
Katarina Behrens
Katarina.Behrens at cib.de
Wed Jun 6 10:23:23 UTC 2018
vcl/unx/kde5/KDE5FilePicker.cxx | 14 +-------------
vcl/unx/kde5/KDE5FilePicker2.cxx | 12 +++++++++++-
vcl/unx/kde5/KDE5SalInstance.cxx | 3 ++-
3 files changed, 14 insertions(+), 15 deletions(-)
New commits:
commit de9210e0be28225e36818789d2b692c5a7a14c52
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Wed Jun 6 12:20:13 2018 +0200
Basic KDE5 native file picker opens now
Change-Id: I3bb5d45f3337fbe26d80acb1fac7a433de904546
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index bfbe56304d0d..3e1387da7fd2 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -48,19 +48,7 @@ KDE5FilePicker::~KDE5FilePicker()
//void KDE5FilePicker::setTitle(const QString& title) { _dialog->setWindowTitle(title); }
-/*bool KDE5FilePicker::execute()
-{
- if (!_filters.isEmpty())
- _dialog->setNameFilters(_filters);
- if (!_currentFilter.isEmpty())
- _dialog->selectNameFilter(_currentFilter);
-
- _dialog->show();
- //block and wait for user input
- return _dialog->exec() == QFileDialog::Accepted;
-}
-
-void KDE5FilePicker::setMultiSelectionMode(bool multiSelect)
+/*void KDE5FilePicker::setMultiSelectionMode(bool multiSelect)
{
_dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile);
}
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 12a29c8d4d29..e505791cad03 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -119,7 +119,17 @@ void SAL_CALL KDE5FilePicker::removeFilePickerListener(const uno::Reference<XFil
void SAL_CALL KDE5FilePicker::setTitle(const OUString& title) {}
-sal_Int16 SAL_CALL KDE5FilePicker::execute() { return 0; }
+sal_Int16 SAL_CALL KDE5FilePicker::execute()
+{
+ if (!_filters.isEmpty())
+ _dialog->setNameFilters(_filters);
+ if (!_currentFilter.isEmpty())
+ _dialog->selectNameFilter(_currentFilter);
+
+ _dialog->show();
+ //block and wait for user input
+ return _dialog->exec() == QFileDialog::Accepted;
+}
void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect) {}
diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx
index 120bf409b36c..b4e2b68e8045 100644
--- a/vcl/unx/kde5/KDE5SalInstance.cxx
+++ b/vcl/unx/kde5/KDE5SalInstance.cxx
@@ -26,6 +26,7 @@
#include <osl/process.h>
+#include "KDE5FilePicker.hxx"
#include "KDE5SalData.hxx"
#include "KDE5SalInstance.hxx"
#include "KDE5SalFrame.hxx"
@@ -51,7 +52,7 @@ SalFrame* KDE5SalInstance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nSt
uno::Reference<ui::dialogs::XFilePicker2>
KDE5SalInstance::createFilePicker(const uno::Reference<uno::XComponentContext>& xMSF)
{
- return SalInstance::createFilePicker(xMSF);
+ return uno::Reference<ui::dialogs::XFilePicker2>(new KDE5FilePicker(xMSF));
}
bool KDE5SalInstance::IsMainThread() const { return qApp->thread() == QThread::currentThread(); }
More information about the Libreoffice-commits
mailing list