summaryrefslogtreecommitdiff
path: root/user/nextcloud-client
diff options
context:
space:
mode:
Diffstat (limited to 'user/nextcloud-client')
-rw-r--r--user/nextcloud-client/APKBUILD38
-rw-r--r--user/nextcloud-client/fix-missing-header.patch11
-rw-r--r--user/nextcloud-client/no-webengine.patch1254
-rw-r--r--user/nextcloud-client/openssl.patch11
-rw-r--r--user/nextcloud-client/test-fix-include.patch22
5 files changed, 360 insertions, 976 deletions
diff --git a/user/nextcloud-client/APKBUILD b/user/nextcloud-client/APKBUILD
index 549383413..4a0317bce 100644
--- a/user/nextcloud-client/APKBUILD
+++ b/user/nextcloud-client/APKBUILD
@@ -1,46 +1,50 @@
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Max Rees <maxcrees@me.com>
pkgname=nextcloud-client
-pkgver=2.5.0_beta2
-_ver="${pkgver%_beta2}-beta2"
-pkgrel=0
+pkgver=2.6.4
+pkgrel=1
pkgdesc="Nextcloud desktop client"
url="https://github.com/nextcloud/desktop"
arch="all"
-options="!checkroot"
license="GPL-2.0+ AND LGPL-2.1+ AND Public-Domain AND MIT AND (Custom:Digia-Qt OR LGPL-2.1-only WITH Qt-LGPL-exception-1.1) AND (Custom:Digia-Qt OR LGPL-2.1-only WITH Qt-LGPL-exception-1.1 OR GPL-3.0-only)"
depends=""
makedepends="cmake qt5-qttools-dev qtkeychain-dev zlib-dev
openssl-dev sqlite-dev qt5-qtsvg-dev"
subpackages="$pkgname-dev"
-source="$pkgname-$pkgver.tar.gz::https://github.com/nextcloud/desktop/archive/v$_ver.tar.gz
+source="$pkgname-$pkgver.tar.gz::https://github.com/nextcloud/desktop/archive/v$pkgver.tar.gz
no-webengine.patch
- openssl.patch"
-builddir="$srcdir/desktop-$_ver"
+ test-fix-include.patch
+ fix-missing-header.patch
+ "
+builddir="$srcdir/desktop-$pkgver"
build() {
- cd "$builddir"
cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_INSTALL_SYSCONFDIR="/etc/$pkgname" \
- -DNO_SHIBBOLETH=1 \
-DWITH_CRASHREPORTER=bool:OFF \
- -DUNIT_TESTING=bool:ON
+ -DUNIT_TESTING=bool:ON \
+ -DNO_SHIBBOLETH=bool:ON \
+ -DNO_WEBENGINE=bool:ON .
make
}
check() {
- cd "$builddir"
- make test
+ # ChunkingTestNg fails sporadically when run with the other tests based
+ # on a timeout, but runs fine on its own
+ make test || make test ARGS="--rerun-failed --output-on-failure"
}
package() {
- cd "$builddir"
make DESTDIR="$pkgdir" install
+ cat > "$pkgdir"/etc/Nextcloud/Nextcloud.conf <<-EOF
+ [General]
+ skipUpdateCheck=true
+ EOF
}
-sha512sums="ed5ec8c0fd79d3f7f843ef1aefb9b94088b85dacca442388bc9a42e1ddbf1ee90482595135ffaffc85e40d223406964c903949ca1c2161fa0f6a2d6770a77cea nextcloud-client-2.5.0_beta2.tar.gz
-6bd83fdee02eabe7ae29fb1a677f62d4a416ec553a0f8c66b7544cafb9201dd7d8b04dc6fb21f447f6c1ece13b06f5d3cba57ac71b211e166607ef15350b3e57 no-webengine.patch
-e323a1074f8ac96667a420f076fdfc988e2fd97cdacd05d83ac54b467b567f5adbf635e7c4fb0414af0012b4016cc4c13441cb35ed3976bc970e514e81b65fd4 openssl.patch"
+sha512sums="849bf9bfa6a50342f6b58e805dc72ef342cb5f3e2e27d8f45d6a48759b1956dec194fb376b9a6b760df724f01eec3a22aadaa439f03e5166b1b2afb5454e40f1 nextcloud-client-2.6.4.tar.gz
+38dd89ca2bf67294187bb4d5c59cdf725ec3b502f23bf4a60210e85c66f6a7e00da0e0b41775bc138159bed300dc60a1f179d1d6ad3b7a27e1aadf4f0576f348 no-webengine.patch
+c14054e6dc228ca77a659371b3c151e0551477fce3a2678a54da4ba73adbcf972a78114c5649adc3dc813fb01b55bbb812620caac0bc0460519424c2caa6c81f test-fix-include.patch
+e5012f375a0446a532f1302f432921e7bb610fb1aebe99d074605ddc06e32e7fa261a4eb56e1bd20b52610830eb054147e95c35a105bf413cedb1ad2edd6e381 fix-missing-header.patch"
diff --git a/user/nextcloud-client/fix-missing-header.patch b/user/nextcloud-client/fix-missing-header.patch
new file mode 100644
index 000000000..2c659a630
--- /dev/null
+++ b/user/nextcloud-client/fix-missing-header.patch
@@ -0,0 +1,11 @@
+diff -ur a/src/libsync/bandwidthmanager.h b/src/libsync/bandwidthmanager.h
+--- a/src/libsync/bandwidthmanager.h 2022-05-28 11:32:35.440187894 +0000
++++ b/src/libsync/bandwidthmanager.h 2022-05-28 11:33:25.713188074 +0000
+@@ -19,6 +19,7 @@
+ #include <QLinkedList>
+ #include <QTimer>
+ #include <QIODevice>
++#include <QPainterPath>
+
+ namespace OCC {
+
diff --git a/user/nextcloud-client/no-webengine.patch b/user/nextcloud-client/no-webengine.patch
index d5beed35c..cbbfe2a72 100644
--- a/user/nextcloud-client/no-webengine.patch
+++ b/user/nextcloud-client/no-webengine.patch
@@ -1,1017 +1,375 @@
---- desktop-2.5.0-beta1/src/libsync/networkjobs.cpp 2018-08-02 16:32:56.000000000 -0400
-+++ desktop-2.5.0-beta1/src/libsync/networkjobs.cpp 2018-08-15 19:10:43.340595365 -0400
-@@ -922,7 +922,7 @@
-
- // WebViewFlow > OAuth > Shib > Basic
- if (_account->serverVersionInt() >= Account::makeServerVersion(12, 0, 0)) {
-- result = WebViewFlow;
-+ result = Basic;
- }
+From 61561d454fec726741a938b81149fa0e2d7db4d6 Mon Sep 17 00:00:00 2001
+From: Max Rees <maxcrees@me.com>
+Date: Mon, 24 Feb 2020 21:32:58 -0600
+Subject: [PATCH] Add support for compiling without QtWebEngine (webflow /
+ flow2 support)
+
+Signed-off-by: Max Rees <maxcrees@me.com>
+---
+ CMakeLists.txt | 7 +++++++
+ src/CMakeLists.txt | 6 +++++-
+ src/gui/CMakeLists.txt | 25 +++++++++++++++-------
+ src/gui/accountmanager.cpp | 2 ++
+ src/gui/creds/credentialsfactory.cpp | 4 ++++
+ src/gui/wizard/owncloudsetuppage.cpp | 4 ++++
+ src/gui/wizard/owncloudwizard.cpp | 31 +++++++++++++++++++++++++++-
+ src/gui/wizard/owncloudwizard.h | 6 ++++++
+ src/libsync/networkjobs.cpp | 8 +++++++
+ 9 files changed, 83 insertions(+), 10 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f8e92e250..90719c222 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -167,6 +167,13 @@ if(NO_SHIBBOLETH)
+ add_definitions(-DNO_SHIBBOLETH=1)
+ endif()
- qCInfo(lcDetermineAuthTypeJob) << "Auth type for" << _account->davUrl() << "is" << result;
---- desktop-2.5.0-beta1/src/gui/creds/webflowcredentialsdialog.cpp 2018-08-02 16:32:56.000000000 -0400
-+++ /dev/null 2018-08-15 19:12:03.420596798 -0400
-@@ -1,49 +0,0 @@
--#include "webflowcredentialsdialog.h"
--
--#include <QVBoxLayout>
--#include <QLabel>
--
--#include "wizard/webview.h"
--
--namespace OCC {
--
--WebFlowCredentialsDialog::WebFlowCredentialsDialog(QWidget *parent)
-- : QDialog(parent)
--{
-- _layout = new QVBoxLayout(this);
--
-- //QString msg = tr("You have been logged out of %1 as user %2, please login again")
-- // .arg(_account->displayName(), _user);
-- _infoLabel = new QLabel();
-- _layout->addWidget(_infoLabel);
--
-- _webView = new WebView();
-- _layout->addWidget(_webView);
--
-- _errorLabel = new QLabel();
-- _errorLabel->hide();
-- _layout->addWidget(_errorLabel);
--
-- setLayout(_layout);
--
-- connect(_webView, &WebView::urlCatched, this, &WebFlowCredentialsDialog::urlCatched);
--}
--
--void WebFlowCredentialsDialog::setUrl(const QUrl &url) {
-- _webView->setUrl(url);
--}
--
--void WebFlowCredentialsDialog::setInfo(const QString &msg) {
-- _infoLabel->setText(msg);
--}
--
--void WebFlowCredentialsDialog::setError(const QString &error) {
-- if (error.isEmpty()) {
-- _errorLabel->hide();
-- } else {
-- _errorLabel->setText(error);
-- _errorLabel->show();
-- }
--}
--
--}
---- desktop-2.5.0-beta1/src/gui/creds/webflowcredentials.cpp 2018-08-02 16:32:56.000000000 -0400
-+++ /dev/null 2018-08-15 19:12:03.420596798 -0400
-@@ -1,258 +0,0 @@
--#include "webflowcredentials.h"
--
--#include "creds/httpcredentials.h"
--
--#include <QAuthenticator>
--#include <QNetworkAccessManager>
--#include <QNetworkReply>
--#include <QPointer>
--#include <QTimer>
--#include <keychain.h>
--#include <QDialog>
--#include <QVBoxLayout>
--#include <QLabel>
--
--#include "accessmanager.h"
--#include "account.h"
--#include "theme.h"
--#include "wizard/webview.h"
--#include "webflowcredentialsdialog.h"
--
--using namespace QKeychain;
--
--namespace OCC {
--
--Q_LOGGING_CATEGORY(lcWebFlowCredentials, "sync.credentials.webflow", QtInfoMsg)
--
--WebFlowCredentials::WebFlowCredentials()
-- : _ready(false),
-- _credentialsValid(false)
--{
--
--}
--
--WebFlowCredentials::WebFlowCredentials(const QString &user, const QString &password, const QSslCertificate &certificate, const QSslKey &key)
-- : _user(user)
-- , _password(password)
-- , _clientSslKey(key)
-- , _clientSslCertificate(certificate)
-- , _ready(true)
-- , _credentialsValid(true)
--{
--
--}
--
--QString WebFlowCredentials::authType() const {
-- return QString::fromLatin1("webflow");
--}
--
--QString WebFlowCredentials::user() const {
-- return _user;
--}
--
--QString WebFlowCredentials::password() const {
-- return _password;
--}
--
--QNetworkAccessManager *WebFlowCredentials::createQNAM() const {
-- qCInfo(lcWebFlowCredentials()) << "Get QNAM";
-- AccessManager *qnam = new AccessManager();
--
-- connect(qnam, &AccessManager::authenticationRequired, this, &WebFlowCredentials::slotAuthentication);
-- connect(qnam, &AccessManager::finished, this, &WebFlowCredentials::slotFinished);
--
-- return qnam;
--}
--
--bool WebFlowCredentials::ready() const {
-- return _ready;
--}
--
--void WebFlowCredentials::fetchFromKeychain() {
-- _wasFetched = true;
--
-- // Make sure we get the user fromt he config file
-- fetchUser();
--
-- if (ready()) {
-- emit fetched();
-- } else {
-- qCInfo(lcWebFlowCredentials()) << "Fetch from keyhchain!";
-- fetchFromKeychainHelper();
-- }
--}
--
--void WebFlowCredentials::askFromUser() {
-- _askDialog = new WebFlowCredentialsDialog();
--
-- QUrl url = _account->url();
-- QString path = url.path() + "/index.php/login/flow";
-- url.setPath(path);
-- _askDialog->setUrl(url);
--
-- QString msg = tr("You have been logged out of %1 as user %2. Please login again")
-- .arg(_account->displayName(), _user);
-- _askDialog->setInfo(msg);
--
-- _askDialog->show();
--
-- connect(_askDialog, &WebFlowCredentialsDialog::urlCatched, this, &WebFlowCredentials::slotAskFromUserCredentialsProvided);
--
-- qCWarning(lcWebFlowCredentials()) << "User needs to reauth!";
--}
--
--void WebFlowCredentials::slotAskFromUserCredentialsProvided(const QString &user, const QString &pass, const QString &host) {
-- Q_UNUSED(host);
--
-- if (_user != user) {
-- qCInfo(lcWebFlowCredentials()) << "Authed with the wrong user!";
--
-- QString msg = tr("Please login with the user: %1")
-- .arg(_user);
-- _askDialog->setError(msg);
--
-- QUrl url = _account->url();
-- QString path = url.path() + "/index.php/login/flow";
-- url.setPath(path);
-- _askDialog->setUrl(url);
--
-- return;
-- }
--
-- qCInfo(lcWebFlowCredentials()) << "Obtained a new password";
--
-- _password = pass;
-- _ready = true;
-- _credentialsValid = true;
-- persist();
-- emit asked();
--
-- _askDialog->close();
-- delete _askDialog;
-- _askDialog = NULL;
--}
--
--
--bool WebFlowCredentials::stillValid(QNetworkReply *reply) {
-- qCWarning(lcWebFlowCredentials()) << "Still valid?";
-- qCWarning(lcWebFlowCredentials()) << reply->error();
-- qCWarning(lcWebFlowCredentials()) << reply->errorString();
-- return (reply->error() != QNetworkReply::AuthenticationRequiredError);
--}
--
--void WebFlowCredentials::persist() {
-- if (_user.isEmpty()) {
-- // We don't even have a user nothing to see here move along
-- return;
-- }
--
-- _account->setCredentialSetting("user", _user);
-- _account->wantsAccountSaved(_account);
--
-- //TODO: Add ssl cert and key storing
-- WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
-- job->setInsecureFallback(false);
-- job->setKey(keychainKey(_account->url().toString(), _user, _account->id()));
-- job->setTextData(_password);
-- job->start();
--}
--
--void WebFlowCredentials::invalidateToken() {
-- // clear the session cookie.
-- _account->clearCookieJar();
--
-- // let QNAM forget about the password
-- // This needs to be done later in the event loop because we might be called (directly or
-- // indirectly) from QNetworkAccessManagerPrivate::authenticationRequired, which itself
-- // is a called from a BlockingQueuedConnection from the Qt HTTP thread. And clearing the
-- // cache needs to synchronize again with the HTTP thread.
-- QTimer::singleShot(0, _account, &Account::clearQNAMCache);
--}
--
--void WebFlowCredentials::forgetSensitiveData(){
-- _password = QString();
-- _ready = false;
--
-- fetchUser();
--
-- const QString kck = keychainKey(_account->url().toString(), _user, _account->id());
-- if (kck.isEmpty()) {
-- qCWarning(lcWebFlowCredentials()) << "InvalidateToken: User is empty, bailing out!";
-- return;
-- }
--
-- DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName());
-- job->setInsecureFallback(false);
-- job->setKey(kck);
-- job->start();
--
-- invalidateToken();
--}
--
--void WebFlowCredentials::setAccount(Account *account) {
-- AbstractCredentials::setAccount(account);
-- if (_user.isEmpty()) {
-- fetchUser();
-- }
--}
--
--QString WebFlowCredentials::fetchUser() {
-- _user = _account->credentialSetting("user").toString();
-- return _user;
--}
--
--void WebFlowCredentials::slotAuthentication(QNetworkReply *reply, QAuthenticator *authenticator) {
-- Q_UNUSED(reply);
--
-- if (!_ready) {
-- return;
-- }
--
-- if (_credentialsValid == false) {
-- return;
-- }
--
-- qCWarning(lcWebFlowCredentials()) << "Requires authentication";
--
-- authenticator->setUser(_user);
-- authenticator->setPassword(_password);
-- _credentialsValid = false;
--}
--
--void WebFlowCredentials::slotFinished(QNetworkReply *reply) {
-- qCInfo(lcWebFlowCredentials()) << "request finished";
--
-- if (reply->error() == QNetworkReply::NoError) {
-- _credentialsValid = true;
-- }
--}
--
--void WebFlowCredentials::fetchFromKeychainHelper() {
-- const QString kck = keychainKey(
-- _account->url().toString(),
-- _user,
-- _account->id());
--
-- ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
-- job->setInsecureFallback(false);
-- job->setKey(kck);
-- connect(job, &Job::finished, this, &WebFlowCredentials::slotReadPasswordJobDone);
-- job->start();
--}
--
--void WebFlowCredentials::slotReadPasswordJobDone(Job *incomingJob) {
-- QKeychain::ReadPasswordJob *job = static_cast<ReadPasswordJob *>(incomingJob);
-- QKeychain::Error error = job->error();
--
-- if (error == QKeychain::NoError) {
-- _password = job->textData();
-- _ready = true;
-- _credentialsValid = true;
-- } else {
-- _ready = false;
-- }
--
-- emit fetched();
--}
--
--}
---- desktop-2.5.0-beta1/src/gui/creds/webflowcredentialsdialog.h 2018-08-02 16:32:56.000000000 -0400
-+++ /dev/null 2018-08-15 19:12:03.420596798 -0400
-@@ -1,36 +0,0 @@
--#ifndef WEBFLOWCREDENTIALSDIALOG_H
--#define WEBFLOWCREDENTIALSDIALOG_H
--
--#include <QDialog>
--#include <QUrl>
--
--class QLabel;
--class QVBoxLayout;
--
--namespace OCC {
--
--class WebView;
--
--class WebFlowCredentialsDialog : public QDialog
--{
-- Q_OBJECT
--public:
-- WebFlowCredentialsDialog(QWidget *parent = 0);
--
-- void setUrl(const QUrl &url);
-- void setInfo(const QString &msg);
-- void setError(const QString &error);
--
--signals:
-- void urlCatched(const QString user, const QString pass, const QString host);
--
--private:
-- WebView *_webView;
-- QLabel *_errorLabel;
-- QLabel *_infoLabel;
-- QVBoxLayout *_layout;
--};
--
--}
--
--#endif // WEBFLOWCREDENTIALSDIALOG_H
---- desktop-2.5.0-beta1/src/gui/creds/credentialsfactory.cpp 2018-08-02 16:32:56.000000000 -0400
-+++ desktop-2.5.0-beta1/src/gui/creds/credentialsfactory.cpp 2018-08-15 19:29:27.240615471 -0400
-@@ -21,7 +21,6 @@
- #ifndef NO_SHIBBOLETH
- #include "creds/shibbolethcredentials.h"
- #endif
--#include "creds/webflowcredentials.h"
++# Disable webengine-based components
++option(NO_WEBENGINE "Build without webflow / flow2 support so QtWebEngine isn't required" OFF)
++if(NO_WEBENGINE)
++ message("Compiling without webengine")
++ add_definitions(-DNO_WEBENGINE=1)
++endif()
++
+ if(APPLE)
+ set( SOCKETAPI_TEAM_IDENTIFIER_PREFIX "" CACHE STRING "SocketApi prefix (including a following dot) that must match the codesign key's TeamIdentifier/Organizational Unit" )
+ endif()
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 9f854b006..881daec8e 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -4,11 +4,15 @@ endif()
- namespace OCC {
+ set(synclib_NAME ${APPLICATION_EXECUTABLE}sync)
-@@ -40,8 +39,6 @@
- } else if (type == "shibboleth") {
- return new ShibbolethCredentials;
- #endif
-- } else if (type == "webflow") {
-- return new WebFlowCredentials;
- } else {
- qCWarning(lcGuiCredentials, "Unknown credentials type: %s", qPrintable(type));
- return new DummyCredentials;
---- desktop-2.5.0-beta1/src/gui/creds/webflowcredentials.h 2018-08-02 16:32:56.000000000 -0400
-+++ /dev/null 2018-08-15 19:12:03.420596798 -0400
-@@ -1,79 +0,0 @@
--#ifndef WEBFLOWCREDENTIALS_H
--#define WEBFLOWCREDENTIALS_H
--
--#include <QSslCertificate>
--#include <QSslKey>
--
--#include "creds/abstractcredentials.h"
--
--class QDialog;
--class QLabel;
--class QNetworkReply;
--class QAuthenticator;
--
--namespace QKeychain {
-- class Job;
--}
--
--namespace OCC {
--
--class WebFlowCredentialsDialog;
--
--class WebFlowCredentials : public AbstractCredentials
--{
-- Q_OBJECT
--public:
-- explicit WebFlowCredentials();
-- WebFlowCredentials(const QString &user, const QString &password, const QSslCertificate &certificate = QSslCertificate(), const QSslKey &key = QSslKey());
--
-- QString authType() const override;
-- QString user() const override;
-- QString password() const;
-- QNetworkAccessManager *createQNAM() const override;
--
-- bool ready() const override;
--
-- void fetchFromKeychain() override;
-- void askFromUser() override;
--
-- bool stillValid(QNetworkReply *reply) override;
-- void persist() override;
-- void invalidateToken() override;
-- void forgetSensitiveData() override;
--
-- // To fetch the user name as early as possible
-- void setAccount(Account *account) override;
--
--private slots:
-- void slotAuthentication(QNetworkReply *reply, QAuthenticator *authenticator);
-- void slotFinished(QNetworkReply *reply);
--
-- void slotReadPasswordJobDone(QKeychain::Job *incomingJob);
-- void slotAskFromUserCredentialsProvided(const QString &user, const QString &pass, const QString &host);
--
--private:
-- /** Reads data from keychain locations
-- *
-- * Goes through
-- * slotReadClientCertPEMJobDone to
-- * slotReadClientCertPEMJobDone to
-- * slotReadJobDone
-- */
-- void fetchFromKeychainHelper();
--
-- QString fetchUser();
--
-- QString _user;
-- QString _password;
-- QSslKey _clientSslKey;
-- QSslCertificate _clientSslCertificate;
--
-- bool _ready;
-- bool _credentialsValid;
--
-- WebFlowCredentialsDialog *_askDialog;
--};
--
--}
--
--#endif // WEBFLOWCREDENTIALS_H
---- desktop-2.5.0-beta1/src/gui/CMakeLists.txt 2018-08-02 16:32:56.000000000 -0400
-+++ desktop-2.5.0-beta1/src/gui/CMakeLists.txt 2018-08-15 19:28:53.640614870 -0400
-@@ -41,7 +41,6 @@
- wizard/owncloudoauthcredspage.ui
- wizard/owncloudsetupnocredspage.ui
- wizard/owncloudwizardresultpage.ui
-- wizard/webview.ui
- )
+-find_package(Qt5 5.6 COMPONENTS Core Network Xml Concurrent WebEngineWidgets WebEngine REQUIRED)
++find_package(Qt5 5.6 COMPONENTS Core Network Xml Concurrent REQUIRED)
+ if (Qt5Core_VERSION VERSION_LESS 5.9.0)
+ message(STATUS "For HTTP/2 support, compile with Qt 5.9 or higher.")
+ endif()
- set(client_SRCS
-@@ -104,8 +103,6 @@
++if(NOT NO_WEBENGINE)
++ find_package(Qt5 5.6 COMPONENTS WebEngineWidgets WebEngine REQUIRED)
++endif()
++
+ if(NOT TOKEN_AUTH_ONLY)
+ find_package(Qt5Keychain REQUIRED)
+ endif()
+diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
+index 4372a9f23..d62f23d1e 100644
+--- a/src/gui/CMakeLists.txt
++++ b/src/gui/CMakeLists.txt
+@@ -108,24 +108,17 @@ set(client_SRCS
creds/credentialsfactory.cpp
creds/httpcredentialsgui.cpp
creds/oauth.cpp
+- creds/flow2auth.cpp
+ creds/keychainchunk.cpp
- creds/webflowcredentials.cpp
- creds/webflowcredentialsdialog.cpp
wizard/postfixlineedit.cpp
wizard/abstractcredswizardpage.cpp
wizard/owncloudadvancedsetuppage.cpp
-@@ -116,8 +113,6 @@
+ wizard/owncloudconnectionmethoddialog.cpp
+ wizard/owncloudhttpcredspage.cpp
+ wizard/owncloudoauthcredspage.cpp
+- wizard/flow2authcredspage.cpp
+- wizard/flow2authwidget.cpp
+ wizard/owncloudsetuppage.cpp
wizard/owncloudwizardcommon.cpp
wizard/owncloudwizard.cpp
wizard/owncloudwizardresultpage.cpp
- wizard/webviewpage.cpp
- wizard/webview.cpp
+ wizard/slideshow.cpp
)
- IF(NOT NO_SHIBBOLETH)
-@@ -290,7 +290,7 @@
+@@ -138,6 +131,18 @@ IF(NOT NO_SHIBBOLETH)
+ )
+ endif()
+
++IF(NOT NO_WEBENGINE)
++ list(APPEND client_SRCS
++ creds/flow2auth.cpp
++ creds/webflowcredentials.cpp
++ creds/webflowcredentialsdialog.cpp
++ wizard/flow2authcredspage.cpp
++ wizard/flow2authwidget.cpp
++ wizard/webviewpage.cpp
++ wizard/webview.cpp
++ )
++endif()
++
+ set(updater_SRCS
+ updater/ocupdater.cpp
+ updater/updateinfo.cpp
+@@ -298,7 +303,11 @@ else()
endif()
add_library(updater STATIC ${updater_SRCS})
-target_link_libraries(updater ${synclib_NAME} Qt5::Widgets Qt5::Network Qt5::Xml Qt5::WebEngineWidgets)
-+target_link_libraries(updater ${synclib_NAME} Qt5::Widgets Qt5::Network Qt5::Xml)
++if(NOT NO_WEBENGINE)
++ target_link_libraries(updater ${synclib_NAME} Qt5::Widgets Qt5::Network Qt5::Xml Qt5::WebEngineWidgets)
++else()
++ target_link_libraries(updater ${synclib_NAME} Qt5::Widgets Qt5::Network Qt5::Xml)
++endif()
target_include_directories(updater PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
---- desktop-2.5.0-beta2/src/gui/wizard/webview.cpp 2018-08-24 12:54:42.000000000 +0000
-+++ /dev/null 2018-10-03 06:10:44.230254545 +0000
-@@ -1,162 +0,0 @@
--#include "webview.h"
--
--#include <QWebEnginePage>
--#include <QWebEngineProfile>
--#include <QWebEngineUrlRequestInterceptor>
--#include <QWebEngineUrlRequestJob>
--#include <QWebEngineUrlSchemeHandler>
--#include <QWebEngineView>
--#include <QDesktopServices>
--#include <QProgressBar>
--#include <QLoggingCategory>
--#include <QLocale>
--
--#include "common/utility.h"
--
--namespace OCC {
--
--Q_LOGGING_CATEGORY(lcWizardWebiew, "gui.wizard.webview", QtInfoMsg)
--
--
--class WebViewPageUrlRequestInterceptor : public QWebEngineUrlRequestInterceptor
--{
-- Q_OBJECT
--public:
-- WebViewPageUrlRequestInterceptor(QObject *parent = 0);
-- void interceptRequest(QWebEngineUrlRequestInfo &info);
--};
--
--class WebViewPageUrlSchemeHandler : public QWebEngineUrlSchemeHandler
--{
-- Q_OBJECT
--public:
-- WebViewPageUrlSchemeHandler(QObject *parent = 0);
-- void requestStarted(QWebEngineUrlRequestJob *request);
--
--Q_SIGNALS:
-- void urlCatched(QString user, QString pass, QString host);
--};
--
--class WebEnginePage : public QWebEnginePage {
--public:
-- WebEnginePage(QWebEngineProfile *profile, QObject* parent = nullptr);
-- QWebEnginePage * createWindow(QWebEnginePage::WebWindowType type) override;
--};
--
--// We need a separate class here, since we cannot simply return the same WebEnginePage object
--// this leads to a strage segfault somewhere deep inside of the QWebEngine code
--class ExternalWebEnginePage : public QWebEnginePage {
--public:
-- ExternalWebEnginePage(QWebEngineProfile *profile, QObject* parent = nullptr);
-- bool acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame) override;
--};
--
--WebView::WebView(QWidget *parent)
-- : QWidget(parent),
-- _ui()
--{
-- _ui.setupUi(this);
--
-- _webview = new QWebEngineView(this);
-- _profile = new QWebEngineProfile(this);
-- _page = new WebEnginePage(_profile);
-- _interceptor = new WebViewPageUrlRequestInterceptor(this);
-- _schemeHandler = new WebViewPageUrlSchemeHandler(this);
--
-- const QString userAgent(Utility::userAgentString());
-- _profile->setHttpUserAgent(userAgent);
-- QWebEngineProfile::defaultProfile()->setHttpUserAgent(userAgent);
-- _profile->setRequestInterceptor(_interceptor);
-- _profile->installUrlSchemeHandler("nc", _schemeHandler);
--
-- /*
-- * Set a proper accept langauge to the language of the client
-- * code from: http://code.qt.io/cgit/qt/qtbase.git/tree/src/network/access/qhttpnetworkconnection.cpp
-- */
-- {
-- QString systemLocale = QLocale::system().name().replace(QChar::fromLatin1('_'),QChar::fromLatin1('-'));
-- QString acceptLanguage;
-- if (systemLocale == QLatin1String("C")) {
-- acceptLanguage = QString::fromLatin1("en,*");
-- } else if (systemLocale.startsWith(QLatin1String("en-"))) {
-- acceptLanguage = systemLocale + QLatin1String(",*");
-- } else {
-- acceptLanguage = systemLocale + QLatin1String(",en,*");
-- }
-- _profile->setHttpAcceptLanguage(acceptLanguage);
-- }
--
-- _webview->setPage(_page);
-- _ui.verticalLayout->addWidget(_webview);
--
-- connect(_webview, &QWebEngineView::loadProgress, _ui.progressBar, &QProgressBar::setValue);
-- connect(_schemeHandler, &WebViewPageUrlSchemeHandler::urlCatched, this, &WebView::urlCatched);
--}
--
--void WebView::setUrl(const QUrl &url) {
-- _page->setUrl(url);
--}
--
--WebViewPageUrlRequestInterceptor::WebViewPageUrlRequestInterceptor(QObject *parent)
-- : QWebEngineUrlRequestInterceptor(parent) {
--
--}
--
--void WebViewPageUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info) {
-- info.setHttpHeader("OCS-APIREQUEST", "true");
--}
--
--WebViewPageUrlSchemeHandler::WebViewPageUrlSchemeHandler(QObject *parent)
-- : QWebEngineUrlSchemeHandler(parent) {
--
--}
--
--void WebViewPageUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *request) {
-- QUrl url = request->requestUrl();
--
-- QString path = url.path().mid(1);
-- QStringList parts = path.split("&");
--
-- QString server;
-- QString user;
-- QString password;
--
-- for (QString part : parts) {
-- if (part.startsWith("server:")) {
-- server = part.mid(7);
-- } else if (part.startsWith("user:")) {
-- user = part.mid(5);
-- } else if (part.startsWith("password:")) {
-- password = part.mid(9);
-- }
-- }
--
-- qCInfo(lcWizardWebiew()) << "Got user: " << user << ", server: " << server;
--
-- emit urlCatched(user, password, server);
--}
--
--
--WebEnginePage::WebEnginePage(QWebEngineProfile *profile, QObject* parent) : QWebEnginePage(profile, parent) {
--
--}
--
--QWebEnginePage * WebEnginePage::createWindow(QWebEnginePage::WebWindowType type) {
-- ExternalWebEnginePage *view = new ExternalWebEnginePage(this->profile());
-- return view;
--}
--
--ExternalWebEnginePage::ExternalWebEnginePage(QWebEngineProfile *profile, QObject* parent) : QWebEnginePage(profile, parent) {
--
--}
--
--
--bool ExternalWebEnginePage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame)
--{
-- QDesktopServices::openUrl(url);
-- return false;
--}
--
--}
--
--#include "webview.moc"
---- desktop-2.5.0-beta1/src/gui/wizard/webviewpage.cpp 2018-08-02 16:32:56.000000000 -0400
-+++ /dev/null 2018-08-15 19:06:30.250590838 -0400
-@@ -1,73 +0,0 @@
--#include "webviewpage.h"
--
--#include <QWebEngineUrlRequestJob>
--#include <QProgressBar>
--#include <QVBoxLayout>
--
--#include "owncloudwizard.h"
--#include "creds/webflowcredentials.h"
--#include "webview.h"
--#include "account.h"
--
--namespace OCC {
--
--Q_LOGGING_CATEGORY(lcWizardWebiewPage, "gui.wizard.webviewpage", QtInfoMsg)
--
--
--WebViewPage::WebViewPage(QWidget *parent)
-- : AbstractCredentialsWizardPage()
--{
-- _ocWizard = qobject_cast<OwncloudWizard *>(parent);
--
-- qCInfo(lcWizardWebiewPage()) << "Time for a webview!";
-- _webView = new WebView(this);
--
-- QVBoxLayout *layout = new QVBoxLayout(this);
-- layout->addWidget(_webView);
-- setLayout(layout);
--
-- connect(_webView, &WebView::urlCatched, this, &WebViewPage::urlCatched);
--}
--
--void WebViewPage::initializePage() {
-- QString url;
-- if (_ocWizard->registration()) {
-- url = "https://nextcloud.com/register";
-- } else {
-- url = _ocWizard->ocUrl();
-- url += "/index.php/login/flow";
-- }
-- qCInfo(lcWizardWebiewPage()) << "Url to auth at: " << url;
-- _webView->setUrl(QUrl(url));
--}
--
--int WebViewPage::nextId() const {
-- return WizardCommon::Page_AdvancedSetup;
--}
--
--bool WebViewPage::isComplete() const {
-- return false;
--}
--
--AbstractCredentials* WebViewPage::getCredentials() const {
-- return new WebFlowCredentials(_user, _pass, _ocWizard->_clientSslCertificate, _ocWizard->_clientSslKey);
--}
--
--void WebViewPage::setConnected() {
-- qCInfo(lcWizardWebiewPage()) << "YAY! we are connected!";
--}
--
--void WebViewPage::urlCatched(QString user, QString pass, QString host) {
-- qCInfo(lcWizardWebiewPage()) << "Got user: " << user << ", server: " << host;
--
-- _user = user;
-- _pass = pass;
--
-- AccountPtr account = _ocWizard->account();
-- account->setUrl(host);
--
-- qCInfo(lcWizardWebiewPage()) << "URL: " << field("OCUrl").toString();
-- emit connectToOCUrl(host);
--}
--
--}
---- desktop-2.5.0-beta2/src/gui/wizard/webview.h 2018-08-24 12:54:42.000000000 +0000
-+++ /dev/null 2018-10-03 06:11:27.640255322 +0000
-@@ -1,42 +0,0 @@
--#ifndef WEBVIEW_H
--#define WEBVIEW_H
--
--#include <QUrl>
--#include <QWidget>
--
--#include "ui_webview.h"
--
--class QWebEngineView;
--class QWebEngineProfile;
--class QWebEnginePage;
--
--namespace OCC {
--
--class WebViewPageUrlRequestInterceptor;
--class WebViewPageUrlSchemeHandler;
--class WebEnginePage;
--
--class WebView : public QWidget
--{
-- Q_OBJECT
--public:
-- WebView(QWidget *parent = 0);
-- void setUrl(const QUrl &url);
--
--signals:
-- void urlCatched(const QString user, const QString pass, const QString host);
--
--private:
-- Ui_WebView _ui;
--
-- QWebEngineView *_webview;
-- QWebEngineProfile *_profile;
-- WebEnginePage *_page;
--
-- WebViewPageUrlRequestInterceptor *_interceptor;
-- WebViewPageUrlSchemeHandler *_schemeHandler;
--};
--
--}
--
--#endif // WEBVIEW_H
---- desktop-2.5.0-beta1/src/gui/wizard/webviewpage.h 2018-08-02 16:32:56.000000000 -0400
-+++ /dev/null 2018-08-15 19:25:56.010611692 -0400
-@@ -1,41 +0,0 @@
--#ifndef WEBVIEWPAGE_H
--#define WEBVIEWPAGE_H
--
--#include "wizard/abstractcredswizardpage.h"
--
--namespace OCC {
--
--class AbstractCredentials;
--class OwncloudWizard;
--class WebView;
--
--class WebViewPage : public AbstractCredentialsWizardPage
--{
-- Q_OBJECT
--public:
-- WebViewPage(QWidget *parent = 0);
--
-- void initializePage() Q_DECL_OVERRIDE;
-- int nextId() const Q_DECL_OVERRIDE;
-- bool isComplete() const;
--
-- AbstractCredentials* getCredentials() const;
-- void setConnected();
--
--signals:
-- void connectToOCUrl(const QString&);
--
--private slots:
-- void urlCatched(QString user, QString pass, QString host);
--
--private:
-- OwncloudWizard *_ocWizard;
-- WebView *_webView;
--
-- QString _user;
-- QString _pass;
--};
--
--}
--
--#endif // WEBVIEWPAGE_H
---- desktop-2.5.0-beta1/src/gui/wizard/owncloudsetuppage.cpp 2018-08-02 16:32:56.000000000 -0400
-+++ desktop-2.5.0-beta1/src/gui/wizard/owncloudsetuppage.cpp 2018-08-15 19:23:33.100609136 -0400
-@@ -161,7 +161,7 @@
+diff --git a/src/gui/accountmanager.cpp b/src/gui/accountmanager.cpp
+index eec375180..2d7b0bc30 100644
+--- a/src/gui/accountmanager.cpp
++++ b/src/gui/accountmanager.cpp
+@@ -253,6 +253,7 @@ AccountPtr AccountManager::loadAccountHelper(QSettings &settings)
+ acc->setUrl(urlConfig.toUrl());
+ }
+
++#ifndef NO_WEBENGINE
+ // Migrate to webflow
+ if (authType == QLatin1String("http")) {
+ authType = "webflow";
+@@ -266,6 +267,7 @@ AccountPtr AccountManager::loadAccountHelper(QSettings &settings)
+ settings.remove(key);
+ }
+ }
++#endif
+
+ qCInfo(lcAccountManager) << "Account for" << acc->url() << "using auth type" << authType;
+
+diff --git a/src/gui/creds/credentialsfactory.cpp b/src/gui/creds/credentialsfactory.cpp
+index 6062f70eb..723196d08 100644
+--- a/src/gui/creds/credentialsfactory.cpp
++++ b/src/gui/creds/credentialsfactory.cpp
+@@ -21,7 +21,9 @@
+ #ifndef NO_SHIBBOLETH
+ #include "creds/shibbolethcredentials.h"
+ #endif
++#ifndef NO_WEBENGINE
+ #include "creds/webflowcredentials.h"
++#endif
+
+ namespace OCC {
+
+@@ -40,8 +42,10 @@ namespace CredentialsFactory {
+ } else if (type == "shibboleth") {
+ return new ShibbolethCredentials;
+ #endif
++#ifndef NO_WEBENGINE
+ } else if (type == "webflow") {
+ return new WebFlowCredentials;
++#endif
+ } else {
+ qCWarning(lcGuiCredentials, "Unknown credentials type: %s", qPrintable(type));
+ return new DummyCredentials;
+diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp
+index 11b1fc80c..30df7cc7f 100644
+--- a/src/gui/wizard/owncloudsetuppage.cpp
++++ b/src/gui/wizard/owncloudsetuppage.cpp
+@@ -144,7 +144,11 @@ void OwncloudSetupPage::slotLogin()
void OwncloudSetupPage::slotGotoProviderList()
{
_ocWizard->setRegistration(true);
-- _ocWizard->setAuthType(DetermineAuthTypeJob::AuthType::WebViewFlow);
++#ifndef NO_WEBENGINE
+ _ocWizard->setAuthType(DetermineAuthTypeJob::AuthType::WebViewFlow);
++#else
+ _ocWizard->setAuthType(DetermineAuthTypeJob::AuthType::Basic);
++#endif
_authTypeKnown = true;
_checking = false;
emit completeChanged();
-@@ -278,8 +278,6 @@
- return WizardCommon::Page_OAuthCreds;
- case DetermineAuthTypeJob::Shibboleth:
- return WizardCommon::Page_ShibbolethCreds;
-- case DetermineAuthTypeJob::WebViewFlow:
-- return WizardCommon::Page_WebView;
- }
- return WizardCommon::Page_HttpCreds;
- }
---- desktop-2.5.0-beta1/src/gui/wizard/webview.ui 2018-08-02 16:32:56.000000000 -0400
-+++ /dev/null 2018-08-15 19:24:43.320610392 -0400
-@@ -1,80 +0,0 @@
--<?xml version="1.0" encoding="UTF-8"?>
--<ui version="4.0">
-- <class>WebView</class>
-- <widget class="QWidget" name="WebView">
-- <property name="geometry">
-- <rect>
-- <x>0</x>
-- <y>0</y>
-- <width>800</width>
-- <height>700</height>
-- </rect>
-- </property>
-- <property name="sizePolicy">
-- <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
-- <horstretch>0</horstretch>
-- <verstretch>0</verstretch>
-- </sizepolicy>
-- </property>
-- <property name="minimumSize">
-- <size>
-- <width>800</width>
-- <height>650</height>
-- </size>
-- </property>
-- <property name="windowTitle">
-- <string>Form</string>
-- </property>
-- <layout class="QGridLayout" name="gridLayout">
-- <property name="leftMargin">
-- <number>0</number>
-- </property>
-- <property name="topMargin">
-- <number>0</number>
-- </property>
-- <property name="rightMargin">
-- <number>0</number>
-- </property>
-- <property name="bottomMargin">
-- <number>0</number>
-- </property>
-- <item row="1" column="0">
-- <layout class="QVBoxLayout" name="verticalLayout">
-- <property name="spacing">
-- <number>0</number>
-- </property>
-- <item>
-- <widget class="QProgressBar" name="progressBar">
-- <property name="maximumSize">
-- <size>
-- <width>16777215</width>
-- <height>5</height>
-- </size>
-- </property>
-- <property name="styleSheet">
-- <string notr="true">QProgressBar::chunk {
-- background-color: rgba(0, 130, 201, 255);
--}</string>
-- </property>
-- <property name="value">
-- <number>0</number>
-- </property>
-- <property name="textVisible">
-- <bool>false</bool>
-- </property>
-- </widget>
-- </item>
-- <item>
-- <layout class="QHBoxLayout" name="resultLayout">
-- <property name="spacing">
-- <number>0</number>
-- </property>
-- </layout>
-- </item>
-- </layout>
-- </item>
-- </layout>
-- </widget>
-- <resources/>
-- <connections/>
--</ui>
---- desktop-2.5.0-beta1/src/gui/wizard/owncloudwizard.h 2018-08-02 16:32:56.000000000 -0400
-+++ desktop-2.5.0-beta1/src/gui/wizard/owncloudwizard.h 2018-08-15 19:22:00.430607478 -0400
-@@ -39,7 +39,6 @@
- class OwncloudWizardResultPage;
- class AbstractCredentials;
- class AbstractCredentialsWizardPage;
--class WebViewPage;
-
- /**
- * @brief The OwncloudWizard class
-@@ -106,7 +105,6 @@
- OwncloudAdvancedSetupPage *_advancedSetupPage;
- OwncloudWizardResultPage *_resultPage;
- AbstractCredentialsWizardPage *_credentialsPage;
-- WebViewPage *_webViewPage;
-
- QStringList _setupLog;
-
---- desktop-2.5.0-beta1/src/gui/wizard/owncloudwizard.cpp 2018-08-02 16:32:56.000000000 -0400
-+++ desktop-2.5.0-beta1/src/gui/wizard/owncloudwizard.cpp 2018-08-15 19:04:35.670588788 -0400
-@@ -26,7 +26,6 @@
+diff --git a/src/gui/wizard/owncloudwizard.cpp b/src/gui/wizard/owncloudwizard.cpp
+index 2076136ff..8cb91e250 100644
+--- a/src/gui/wizard/owncloudwizard.cpp
++++ b/src/gui/wizard/owncloudwizard.cpp
+@@ -27,8 +27,10 @@
#endif
#include "wizard/owncloudadvancedsetuppage.h"
#include "wizard/owncloudwizardresultpage.h"
--#include "wizard/webviewpage.h"
++#ifndef NO_WEBENGINE
+ #include "wizard/webviewpage.h"
+ #include "wizard/flow2authcredspage.h"
++#endif
#include "QProgressIndicator.h"
-@@ -51,7 +50,6 @@
+@@ -47,14 +49,18 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
+ , _setupPage(new OwncloudSetupPage(this))
+ , _httpCredsPage(new OwncloudHttpCredsPage(this))
+ , _browserCredsPage(new OwncloudOAuthCredsPage)
++#ifndef NO_WEBENGINE
+ , _flow2CredsPage(new Flow2AuthCredsPage)
++#endif
+ #ifndef NO_SHIBBOLETH
+ , _shibbolethCredsPage(new OwncloudShibbolethCredsPage)
+ #endif
, _advancedSetupPage(new OwncloudAdvancedSetupPage)
, _resultPage(new OwncloudWizardResultPage)
- , _credentialsPage(0)
-- , _webViewPage(new WebViewPage(this))
+ , _credentialsPage(nullptr)
++#ifndef NO_WEBENGINE
+ , _webViewPage(new WebViewPage(this))
++#endif
, _setupLog()
, _registration(false)
{
-@@ -64,7 +62,6 @@
+@@ -62,13 +68,17 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
+ setPage(WizardCommon::Page_ServerSetup, _setupPage);
+ setPage(WizardCommon::Page_HttpCreds, _httpCredsPage);
+ setPage(WizardCommon::Page_OAuthCreds, _browserCredsPage);
++#ifndef NO_WEBENGINE
+ setPage(WizardCommon::Page_Flow2AuthCreds, _flow2CredsPage);
++#endif
+ #ifndef NO_SHIBBOLETH
+ setPage(WizardCommon::Page_ShibbolethCreds, _shibbolethCredsPage);
#endif
setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage);
setPage(WizardCommon::Page_Result, _resultPage);
-- setPage(WizardCommon::Page_WebView, _webViewPage);
++#ifndef NO_WEBENGINE
+ setPage(WizardCommon::Page_WebView, _webViewPage);
++#endif
connect(this, &QDialog::finished, this, &OwncloudWizard::basicSetupFinished);
-@@ -79,7 +76,6 @@
+@@ -80,11 +90,15 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
+ connect(_setupPage, &OwncloudSetupPage::determineAuthType, this, &OwncloudWizard::determineAuthType);
+ connect(_httpCredsPage, &OwncloudHttpCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
+ connect(_browserCredsPage, &OwncloudOAuthCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
++#ifndef NO_WEBENGINE
+ connect(_flow2CredsPage, &Flow2AuthCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
++#endif
#ifndef NO_SHIBBOLETH
connect(_shibbolethCredsPage, &OwncloudShibbolethCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
#endif
-- connect(_webViewPage, &WebViewPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
++#ifndef NO_WEBENGINE
+ connect(_webViewPage, &WebViewPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
++#endif
connect(_advancedSetupPage, &OwncloudAdvancedSetupPage::createLocalAndRemoteFolders,
this, &OwncloudWizard::createLocalAndRemoteFolders);
connect(this, &QWizard::customButtonClicked, this, &OwncloudWizard::skipFolderConfiguration);
-@@ -168,10 +164,6 @@
+@@ -106,12 +120,16 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
+ // Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching)
+ connect(this, &OwncloudWizard::styleChanged, _setupPage, &OwncloudSetupPage::slotStyleChanged);
+ connect(this, &OwncloudWizard::styleChanged, _advancedSetupPage, &OwncloudAdvancedSetupPage::slotStyleChanged);
++#ifndef NO_WEBENGINE
+ connect(this, &OwncloudWizard::styleChanged, _flow2CredsPage, &Flow2AuthCredsPage::slotStyleChanged);
++#endif
+
+ customizeStyle();
+
++#ifndef NO_WEBENGINE
+ // allow Flow2 page to poll on window activation
+ connect(this, &OwncloudWizard::onActivate, _flow2CredsPage, &Flow2AuthCredsPage::slotPollNow);
++#endif
+ }
+
+ void OwncloudWizard::setAccount(AccountPtr account)
+@@ -180,9 +198,11 @@ void OwncloudWizard::successfulStep()
+ _browserCredsPage->setConnected();
+ break;
+
++#ifndef NO_WEBENGINE
+ case WizardCommon::Page_Flow2AuthCreds:
+ _flow2CredsPage->setConnected();
+ break;
++#endif
+
+ #ifndef NO_SHIBBOLETH
+ case WizardCommon::Page_ShibbolethCreds:
+@@ -190,9 +210,11 @@ void OwncloudWizard::successfulStep()
break;
#endif
-- case WizardCommon::Page_WebView:
-- _webViewPage->setConnected();
-- break;
--
++#ifndef NO_WEBENGINE
+ case WizardCommon::Page_WebView:
+ _webViewPage->setConnected();
+ break;
++#endif
+
case WizardCommon::Page_AdvancedSetup:
_advancedSetupPage->directoriesCreated();
- break;
-@@ -195,8 +187,6 @@
+@@ -217,10 +239,12 @@ void OwncloudWizard::setAuthType(DetermineAuthTypeJob::AuthType type)
#endif
if (type == DetermineAuthTypeJob::OAuth) {
_credentialsPage = _browserCredsPage;
-- } else if (type == DetermineAuthTypeJob::WebViewFlow) {
-- _credentialsPage = _webViewPage;
++#ifndef NO_WEBENGINE
+ } else if (type == DetermineAuthTypeJob::LoginFlowV2) {
+ _credentialsPage = _flow2CredsPage;
+ } else if (type == DetermineAuthTypeJob::WebViewFlow) {
+ _credentialsPage = _webViewPage;
++#endif
} else { // try Basic auth even for "Unknown"
_credentialsPage = _httpCredsPage;
}
---- desktop-2.5.0-beta1/src/CMakeLists.txt 2018-08-02 16:32:56.000000000 -0400
-+++ desktop-2.5.0-beta1/src/CMakeLists.txt 2018-08-15 20:59:59.390712646 -0400
-@@ -4,7 +4,7 @@
+@@ -245,7 +269,12 @@ void OwncloudWizard::slotCurrentPageChanged(int id)
+ }
- set(synclib_NAME ${APPLICATION_EXECUTABLE}sync)
+ setOption(QWizard::HaveCustomButton1, id == WizardCommon::Page_AdvancedSetup);
+- if (id == WizardCommon::Page_AdvancedSetup && (_credentialsPage == _browserCredsPage || _credentialsPage == _flow2CredsPage)) {
++ if (id == WizardCommon::Page_AdvancedSetup
++ && (_credentialsPage == _browserCredsPage
++#ifndef NO_WEBENGINE
++ || _credentialsPage == _flow2CredsPage
++#endif
++ )) {
+ // For OAuth, disable the back button in the Page_AdvancedSetup because we don't want
+ // to re-open the browser.
+ button(QWizard::BackButton)->setEnabled(false);
+diff --git a/src/gui/wizard/owncloudwizard.h b/src/gui/wizard/owncloudwizard.h
+index 3cbf89f71..2f398d416 100644
+--- a/src/gui/wizard/owncloudwizard.h
++++ b/src/gui/wizard/owncloudwizard.h
+@@ -39,8 +39,10 @@ class OwncloudAdvancedSetupPage;
+ class OwncloudWizardResultPage;
+ class AbstractCredentials;
+ class AbstractCredentialsWizardPage;
++#ifndef NO_WEBENGINE
+ class WebViewPage;
+ class Flow2AuthCredsPage;
++#endif
--find_package(Qt5 5.6 COMPONENTS Core Network Xml Concurrent WebEngineWidgets WebEngine REQUIRED)
-+find_package(Qt5 5.6 COMPONENTS Core Network Xml Concurrent REQUIRED)
- if (Qt5Core_VERSION VERSION_LESS 5.9.0)
- message(STATUS "For HTTP/2 support, compile with Qt 5.9 or higher.")
- endif()
+ /**
+ * @brief The OwncloudWizard class
+@@ -114,11 +116,15 @@ private:
+ #ifndef NO_SHIBBOLETH
+ OwncloudShibbolethCredsPage *_shibbolethCredsPage;
+ #endif
++#ifndef NO_WEBENGINE
+ Flow2AuthCredsPage *_flow2CredsPage;
++#endif
+ OwncloudAdvancedSetupPage *_advancedSetupPage;
+ OwncloudWizardResultPage *_resultPage;
+ AbstractCredentialsWizardPage *_credentialsPage;
++#ifndef NO_WEBENGINE
+ WebViewPage *_webViewPage;
++#endif
+
+ QStringList _setupLog;
+
+diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp
+index 76789a8ce..73f0bed0e 100644
+--- a/src/libsync/networkjobs.cpp
++++ b/src/libsync/networkjobs.cpp
+@@ -955,12 +955,20 @@ void DetermineAuthTypeJob::checkAllDone()
+
+ // WebViewFlow > OAuth > Shib > Basic
+ if (_account->serverVersionInt() >= Account::makeServerVersion(12, 0, 0)) {
++#ifndef NO_WEBENGINE
+ result = WebViewFlow;
++#else
++ result = Basic;
++#endif
+ }
+
+ // LoginFlowV2 > WebViewFlow > OAuth > Shib > Basic
+ if (_account->serverVersionInt() >= Account::makeServerVersion(16, 0, 0)) {
++#ifndef NO_WEBENGINE
+ result = LoginFlowV2;
++#else
++ result = Basic;
++#endif
+ }
+
+ // If we determined that we need the webview flow (GS for example) then we switch to that
+--
+2.25.0
+
diff --git a/user/nextcloud-client/openssl.patch b/user/nextcloud-client/openssl.patch
deleted file mode 100644
index 426fa0cfb..000000000
--- a/user/nextcloud-client/openssl.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- desktop-2.5.0-beta2/CMakeLists.txt 2018-08-24 12:54:42.000000000 +0000
-+++ desktop-2.5.0-beta2/CMakeLists.txt 2018-10-03 06:19:15.840263697 +0000
-@@ -183,7 +183,7 @@ if(BUILD_CLIENT)
- endif()
- find_package(Sphinx)
- find_package(PdfLatex)
-- find_package(OpenSSL 1.1 REQUIRED )
-+ find_package(OpenSSL 1.0 REQUIRED )
-
- find_package(ZLIB REQUIRED)
- find_package(GLib2)
diff --git a/user/nextcloud-client/test-fix-include.patch b/user/nextcloud-client/test-fix-include.patch
new file mode 100644
index 000000000..da8423022
--- /dev/null
+++ b/user/nextcloud-client/test-fix-include.patch
@@ -0,0 +1,22 @@
+From f9c6449c050cad673cf37971d9815a35e6ffb5dd Mon Sep 17 00:00:00 2001
+From: tuxmaster5000 <837503+tuxmaster5000@users.noreply.github.com>
+Date: Fri, 12 Oct 2018 15:56:26 +0200
+Subject: [PATCH] Fix include file
+
+---
+ test/testnextcloudpropagator.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/testnextcloudpropagator.cpp b/test/testnextcloudpropagator.cpp
+index 6ad1a6b37..dc2e476ad 100644
+--- a/test/testnextcloudpropagator.cpp
++++ b/test/testnextcloudpropagator.cpp
+@@ -8,7 +8,7 @@
+ #include <QDebug>
+
+ #include "propagatedownload.h"
+-#include "nextcloudpropagator_p.h"
++#include "owncloudpropagator_p.h"
+
+ using namespace OCC;
+ namespace OCC {