[Libreoffice-commits] core.git: 2 commits - configure.ac vcl/unx
configure.ac |4 - vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.cxx |9 -- vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.hxx |3 vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.cxx | 98 +++-- vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.hxx | 29 +-- vcl/unx/gtk3_kde5/gtk3_kde5_gtkinst.cxx|6 - 6 files changed, 101 insertions(+), 48 deletions(-) New commits: commit cbf0c689d41ba11f37e557c10db7976f8318d43c Author: Milian WolffDate: Wed Jan 24 11:43:20 2018 +0100 Undo "check for boost/process/child.hpp in configure.ac if --enable-gtk3-kde5" This reverts commit c7a1320593191e8359aa64d8e262948da085d358. It's no longer required since we ported away from boost.:process Change-Id: I53c5b994c3ba2801823ba0d6ab25f43223db1476 Reviewed-on: https://gerrit.libreoffice.org/48491 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/configure.ac b/configure.ac index 3de79ab4d192..2780d20f7b9b 100644 --- a/configure.ac +++ b/configure.ac @@ -8716,10 +8716,6 @@ if test "$with_system_boost" = "yes"; then [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], []) AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [], [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], []) -if test "x$enable_gtk3_kde5" = "xyes"; then -AC_CHECK_HEADER(boost/process/child.hpp, [], - [AC_MSG_ERROR(boost/process/child.hpp not found. install boost >= 1.64)], []) -fi CXXFLAGS=$save_CXXFLAGS AC_LANG_POP([C++]) # this is in m4/ax_boost_base.m4 commit 068f244222edcc5916fe864a0265ab6ccb4e43d2 Author: Milian Wolff Date: Wed Jan 24 11:35:20 2018 +0100 gtk3_kde5: port away from boost::process While this uglifies the code, it removes a dependency on newer boost 1.64+ which ships boost::process. This helps on systems where LO is linked against system boost and an older version of boost is used. Additionally, and this is the main motivation, this makes it easier to backport these changes to 5.2, where the bundled boost is also only at 1.60. To keep the required changes at a minimum, the osl_* API for reading from/writing to the stdout/stdin of the helper process, we buffer the responses on a line-by-line basis. Note that one cannot simply reuse osl_readLine on the non-seekable oslFileHandle. Instead, we have to roll our own simplistic readLine implementation... Change-Id: I1197e38cb2416e926d8ba985accd6c10d78bcc52 Reviewed-on: https://gerrit.libreoffice.org/48490 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.cxx b/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.cxx index 7372d476f55e..8c983996b791 100644 --- a/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.cxx +++ b/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.cxx @@ -42,13 +42,6 @@ #include -#include - -#include -#include -#include -#include - using namespace ::com::sun::star; using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::ui::dialogs::TemplateDescription; @@ -57,8 +50,6 @@ using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; -namespace bp = boost::process; -namespace bf = boost::filesystem; // helper functions diff --git a/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.hxx b/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.hxx index 80261ded9f9b..740382d9ec49 100644 --- a/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.hxx +++ b/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker.hxx @@ -32,9 +32,6 @@ #include -#include -#include - #include "gtk3_kde5_filepicker_ipc.hxx" #include diff --git a/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.cxx b/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.cxx index fd9c1c7b64e1..21690c5e74f8 100644 --- a/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.cxx +++ b/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.cxx @@ -26,6 +26,7 @@ #include #include +#include #include @@ -41,38 +42,33 @@ #include #include -#include -#include -#include using namespace ::com::sun::star::ui::dialogs; -namespace bp = boost::process; -namespace bf = boost::filesystem; - // helper functions namespace { -bf::path applicationDirPath() +OUString applicationDirPath() { OUString applicationFilePath; osl_getExecutableFile(); OUString applicationSystemPath; osl_getSystemPathFromFileURL(applicationFilePath.pData, ); -auto sysPath = applicationSystemPath.toUtf8(); -auto ret = bf::path(sysPath.getStr(), sysPath.getStr() + sysPath.getLength()); +const auto utf8Path = applicationSystemPath.toUtf8(); +
[Libreoffice-commits] core.git: 2 commits - configure.ac vcl/unx
configure.ac |4 ++ vcl/unx/gtk3_kde5/kde5_filepicker.cxx | 45 ++ vcl/unx/gtk3_kde5/kde5_filepicker.hxx |3 -- vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx | 27 ++ 4 files changed, 35 insertions(+), 44 deletions(-) New commits: commit f1b60bd62daff4aaf6465caadd4ad0c447521102 Author: Milian WolffDate: Mon Jan 22 17:06:00 2018 +0100 Support opening of (some) remote URLs through the KDE file dialog LO already supports http, https, webdav and webdavs through the WebDAVContentProvider. Ftp is supported via FTPContentProvider and then finally we have the GIOContentProvider that can potentially support SMB, if the dependencies for that are met. We now configure the KDE file dialog to allow these remote protocols. Note that this filtering depends on https://phabricator.kde.org/D10024 and https://phabricator.kde.org/D10025 to have any effect. Then we rewrite the URLs we receive from KIO to a format that is supported by LO. Most notably, we prepend `vnd.sun.star.` to the webdav URL schemes, such that they get picked up by the WebDAVContentProvider. Then finally, we clear the username from the smb:// URLs we get from KIO, as that prevents GIO from opening them. In all cases, the user will get prompted a second time for the credentials required to access the remote resource. This is unfortunate, but better than nothing. In the future, we may solve this issue through either a separate KIO UCP or by getting support for the FDO Secret Service specification in KWallet. Change-Id: I91df28434b115639c2698968e2a672b3320bf8e2 Reviewed-on: https://gerrit.libreoffice.org/48350 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/vcl/unx/gtk3_kde5/kde5_filepicker.cxx b/vcl/unx/gtk3_kde5/kde5_filepicker.cxx index db7d04cf7d4a..456ba645808b 100644 --- a/vcl/unx/gtk3_kde5/kde5_filepicker.cxx +++ b/vcl/unx/gtk3_kde5/kde5_filepicker.cxx @@ -32,17 +32,6 @@ #include #include -// The dialog should check whether LO also supports the protocol -// provided by KIO, and KFileWidget::dirOperator() is only 4.3+ . -// Moreover it's only in this somewhat internal KFileWidget class, -// which may not necessarily be what QFileDialog::fileWidget() returns, -// but that's hopefully not a problem in practice. -//#if Qt_VERSION_MAJOR == 4 && Qt_VERSION_MINOR >= 2 -//#define ALLOW_REMOTE_URLS 1 -//#else -#define ALLOW_REMOTE_URLS 0 -//#endif - // KDE5FilePicker KDE5FilePicker::KDE5FilePicker(QObject* parent) @@ -53,16 +42,15 @@ KDE5FilePicker::KDE5FilePicker(QObject* parent) , _winId(0) , allowRemoteUrls(false) { -#if ALLOW_REMOTE_URLS -if (KFileWidget* fileWidget = dynamic_cast (_dialog->fileWidget())) -{ -allowRemoteUrls = true; -// Use finishedLoading signal rather than e.g. urlEntered, because if there's a problem -// such as the URL being mistyped, there's no way to prevent two message boxes about it, -// one from us and one from Qt code. -connect(fileWidget->dirOperator(), SIGNAL(finishedLoading()), SLOT(checkProtocol())); -} -#endif +_dialog->setSupportedSchemes({ +QStringLiteral("file"), +QStringLiteral("ftp"), +QStringLiteral("http"), +QStringLiteral("https"), +QStringLiteral("webdav"), +QStringLiteral("webdavs"), +QStringLiteral("smb"), +}); setMultiSelectionMode(false); @@ -245,21 +233,6 @@ void SAL_CALL KDE5FilePicker::initialize(bool saveDialog) } } -void KDE5FilePicker::checkProtocol() -{ -// There's no libreoffice.desktop :(, so find a matching one. -/* -KService::List services = KServiceTypeTrader::self()->query( "Application", "Exec =~ 'libreoffice %U'" ); -QStringList protocols; -if( !services.isEmpty()) -protocols = services[ 0 ]->property( "X-Qt-Protocols" ).toStringList(); -if( protocols.isEmpty()) // incorrect (developer?) installation ? -protocols << "file" << "http"; -if( !protocols.contains( _dialog->baseUrl().protocol()) && !protocols.contains( "KIO" )) -KMessageBox::error( _dialog, KIO::buildErrorString( KIO::ERR_UNSUPPORTED_PROTOCOL, _dialog->baseUrl().protocol())); -*/ -} - void KDE5FilePicker::setWinId(sal_uIntPtr winId) { _winId = winId; } bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e) diff --git a/vcl/unx/gtk3_kde5/kde5_filepicker.hxx b/vcl/unx/gtk3_kde5/kde5_filepicker.hxx index 8b364832c6af..25c7454f86b5 100644 --- a/vcl/unx/gtk3_kde5/kde5_filepicker.hxx +++ b/vcl/unx/gtk3_kde5/kde5_filepicker.hxx @@ -102,9 +102,6 @@ private: protected: bool eventFilter(QObject* watched, QEvent* event) override; -private Q_SLOTS: -void checkProtocol(); - Q_SIGNALS: void filterChanged();