Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 722419 Details for
Bug 800863
net-misc/nextcloud-client-3.2.3: QtWebengine is now an optional dependency
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
backport optional webengine patch
3.2.3-optional-webengine.patch (text/plain), 15.64 KB, created by
FlyingWaffle
on 2021-07-06 18:53:20 UTC
(
hide
)
Description:
backport optional webengine patch
Filename:
MIME Type:
Creator:
FlyingWaffle
Created:
2021-07-06 18:53:20 UTC
Size:
15.64 KB
patch
obsolete
>diff --git a/CMakeLists.txt b/CMakeLists.txt >index 600be4e27..e0f2674d7 100644 >--- a/CMakeLists.txt >+++ b/CMakeLists.txt >@@ -18,6 +18,10 @@ else () > include ( ${CMAKE_SOURCE_DIR}/NEXTCLOUD.cmake ) > endif() > >+if(WITH_WEBENGINE) >+ add_compile_definitions(WITH_WEBENGINE=1) >+endif() >+ > # Default suffix if the theme doesn't define one > if(NOT DEFINED APPLICATION_VIRTUALFILE_SUFFIX) > set(APPLICATION_VIRTUALFILE_SUFFIX "${APPLICATION_SHORTNAME}_virtual" CACHE STRING "Virtual file suffix (not including the .)") >diff --git a/NEXTCLOUD.cmake b/NEXTCLOUD.cmake >index 82f1bd4b7..1d246eecf 100644 >--- a/NEXTCLOUD.cmake >+++ b/NEXTCLOUD.cmake >@@ -27,6 +27,8 @@ option( WITH_CRASHREPORTER "Build crashreporter" OFF ) > #set( CRASHREPORTER_SUBMIT_URL "https://crash-reports.owncloud.com/submit" CACHE STRING "URL for crash reporter" ) > #set( CRASHREPORTER_ICON ":/owncloud-icon.png" ) > >+option(WITH_WEBENGINE "Enable use of QWebEngine" ON) >+ > ## Updater options > option( BUILD_UPDATER "Build updater" OFF ) > >diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt >index f29349582..f070b1769 100644 >--- a/src/CMakeLists.txt >+++ b/src/CMakeLists.txt >@@ -4,7 +4,11 @@ endif() > > set(synclib_NAME ${APPLICATION_EXECUTABLE}sync) > >-find_package(Qt5 5.12 COMPONENTS Core Network Xml Concurrent WebEngineWidgets WebEngine REQUIRED) >+find_package(Qt5 5.12 COMPONENTS Core Network Xml Concurrent REQUIRED) >+if(WITH_WEBENGINE) >+ find_package(Qt5 5.12 COMPONENTS WebEngineWidgets WebEngine REQUIRED) >+endif() >+ > get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) > message(STATUS "Using Qt ${Qt5Core_VERSION} (${QT_QMAKE_EXECUTABLE})") > >diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt >index ca10e588d..9931e0f8a 100644 >--- a/src/gui/CMakeLists.txt >+++ b/src/gui/CMakeLists.txt >@@ -133,13 +133,18 @@ set(client_SRCS > wizard/owncloudwizardcommon.cpp > wizard/owncloudwizard.cpp > wizard/owncloudwizardresultpage.cpp >- wizard/webviewpage.cpp >- wizard/webview.cpp > wizard/slideshow.cpp > wizard/welcomepage.cpp > wizard/linklabel.cpp > ) > >+if (WITH_WEBENGINE) >+ list(APPEND client_SRCS >+ wizard/webviewpage.cpp >+ wizard/webview.cpp >+ ) >+endif() >+ > IF(BUILD_UPDATER) > set(updater_SRCS > updater/ocupdater.cpp >@@ -275,10 +280,13 @@ target_link_libraries(nextcloudCore > Qt5::Qml > Qt5::Quick > Qt5::QuickControls2 >- Qt5::WebEngineWidgets > ${synclib_NAME} > ) > >+if(WITH_WEBENGINE) >+ target_link_libraries(nextcloudCore PUBLIC Qt5::WebEngineWidgets) >+endif() >+ > set_target_properties(nextcloudCore > PROPERTIES > AUTOUIC ON >diff --git a/src/gui/creds/webflowcredentials.cpp b/src/gui/creds/webflowcredentials.cpp >index 17b8630b5..b40d4f993 100644 >--- a/src/gui/creds/webflowcredentials.cpp >+++ b/src/gui/creds/webflowcredentials.cpp >@@ -16,7 +16,9 @@ > #include "account.h" > #include "configfile.h" > #include "theme.h" >+#ifdef WITH_WEBENGINE > #include "wizard/webview.h" >+#endif // WITH_WEBENGINE > #include "webflowcredentialsdialog.h" > > using namespace QKeychain; >@@ -144,8 +146,12 @@ void WebFlowCredentials::askFromUser() { > // Do a DetermineAuthTypeJob to make sure that the server is still using Flow2 > auto job = new DetermineAuthTypeJob(_account->sharedFromThis(), this); > connect(job, &DetermineAuthTypeJob::authType, [this](DetermineAuthTypeJob::AuthType type) { >- // LoginFlowV2 > WebViewFlow > OAuth > Shib > Basic >+ // LoginFlowV2 > WebViewFlow > OAuth > Shib > Basic >+#ifdef WITH_WEBENGINE > bool useFlow2 = (type != DetermineAuthTypeJob::WebViewFlow); >+#else // WITH_WEBENGINE >+ bool useFlow2 = true; >+#endif // WITH_WEBENGINE > > _askDialog = new WebFlowCredentialsDialog(_account, useFlow2); > >diff --git a/src/gui/creds/webflowcredentialsdialog.cpp b/src/gui/creds/webflowcredentialsdialog.cpp >index 42b4ee22f..98681cccb 100644 >--- a/src/gui/creds/webflowcredentialsdialog.cpp >+++ b/src/gui/creds/webflowcredentialsdialog.cpp >@@ -8,16 +8,20 @@ > #include "owncloudgui.h" > #include "headerbanner.h" > #include "wizard/owncloudwizardcommon.h" >+#ifdef WITH_WEBENGINE > #include "wizard/webview.h" >+#endif // WITH_WEBENGINE > #include "wizard/flow2authwidget.h" > > namespace OCC { > > WebFlowCredentialsDialog::WebFlowCredentialsDialog(Account *account, bool useFlow2, QWidget *parent) >- : QDialog(parent), >- _useFlow2(useFlow2), >- _flow2AuthWidget(nullptr), >- _webView(nullptr) >+ : QDialog(parent) >+ , _useFlow2(useFlow2) >+ , _flow2AuthWidget(nullptr) >+#ifdef WITH_WEBENGINE >+ , _webView(nullptr) >+#endif // WITH_WEBENGINE > { > setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); > >@@ -49,10 +53,12 @@ WebFlowCredentialsDialog::WebFlowCredentialsDialog(Account *account, bool useFlo > > _flow2AuthWidget->startAuth(account); > } else { >+#ifdef WITH_WEBENGINE > _webView = new WebView(); > _containerLayout->addWidget(_webView); > > connect(_webView, &WebView::urlCatched, this, &WebFlowCredentialsDialog::urlCatched); >+#endif // WITH_WEBENGINE > } > > auto app = static_cast<Application *>(qApp); >@@ -73,12 +79,14 @@ WebFlowCredentialsDialog::WebFlowCredentialsDialog(Account *account, bool useFlo > void WebFlowCredentialsDialog::closeEvent(QCloseEvent* e) { > Q_UNUSED(e) > >+#ifdef WITH_WEBENGINE > if (_webView) { > // Force calling WebView::~WebView() earlier so that _profile and _page are > // deleted in the correct order. > _webView->deleteLater(); > _webView = nullptr; > } >+#endif // WITH_WEBENGINE > > if (_flow2AuthWidget) { > _flow2AuthWidget->resetAuth(); >@@ -90,8 +98,12 @@ void WebFlowCredentialsDialog::closeEvent(QCloseEvent* e) { > } > > void WebFlowCredentialsDialog::setUrl(const QUrl &url) { >+#ifdef WITH_WEBENGINE > if (_webView) > _webView->setUrl(url); >+#else // WITH_WEBENGINE >+ Q_UNUSED(url); >+#endif // WITH_WEBENGINE > } > > void WebFlowCredentialsDialog::setInfo(const QString &msg) { >diff --git a/src/gui/creds/webflowcredentialsdialog.h b/src/gui/creds/webflowcredentialsdialog.h >index 50ed7088d..35fb6b3bb 100644 >--- a/src/gui/creds/webflowcredentialsdialog.h >+++ b/src/gui/creds/webflowcredentialsdialog.h >@@ -13,7 +13,9 @@ class QVBoxLayout; > namespace OCC { > > class HeaderBanner; >+#ifdef WITH_WEBENGINE > class WebView; >+#endif // WITH_WEBENGINE > class Flow2AuthWidget; > > class WebFlowCredentialsDialog : public QDialog >@@ -50,7 +52,9 @@ private: > bool _useFlow2; > > Flow2AuthWidget *_flow2AuthWidget; >+#ifdef WITH_WEBENGINE > WebView *_webView; >+#endif // WITH_WEBENGINE > > QLabel *_errorLabel; > QLabel *_infoLabel; >diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp >index fa8a221d0..0e6e06ca4 100644 >--- a/src/gui/wizard/owncloudsetuppage.cpp >+++ b/src/gui/wizard/owncloudsetuppage.cpp >@@ -119,21 +119,6 @@ void OwncloudSetupPage::setupCustomization() > _ui.leUrl->setPalette(leUrlPalette); > } > >-#ifdef WITH_PROVIDERS >-void OwncloudSetupPage::slotLogin() >-{ >- _ocWizard->setRegistration(false); >-} >-void OwncloudSetupPage::slotGotoProviderList() >-{ >- _ocWizard->setRegistration(true); >- _ocWizard->setAuthType(DetermineAuthTypeJob::AuthType::WebViewFlow); >- _authTypeKnown = true; >- _checking = false; >- emit completeChanged(); >-} >-#endif >- > // slot hit from textChanged of the url entry field. > void OwncloudSetupPage::slotUrlChanged(const QString &url) > { >@@ -228,8 +213,10 @@ int OwncloudSetupPage::nextId() const > return WizardCommon::Page_OAuthCreds; > case DetermineAuthTypeJob::LoginFlowV2: > return WizardCommon::Page_Flow2AuthCreds; >+#ifdef WITH_WEBENGINE > case DetermineAuthTypeJob::WebViewFlow: > return WizardCommon::Page_WebView; >+#endif // WITH_WEBENGINE > } > return WizardCommon::Page_HttpCreds; > } >diff --git a/src/gui/wizard/owncloudsetuppage.h b/src/gui/wizard/owncloudsetuppage.h >index 485a2bd62..8e96a2ab3 100644 >--- a/src/gui/wizard/owncloudsetuppage.h >+++ b/src/gui/wizard/owncloudsetuppage.h >@@ -67,11 +67,6 @@ public slots: > protected slots: > void slotUrlChanged(const QString &); > void slotUrlEditFinished(); >-#ifdef WITH_PROVIDERS >- void slotLogin(); >- void slotGotoProviderList(); >-#endif >- > void setupCustomization(); > > signals: >diff --git a/src/gui/wizard/owncloudwizard.cpp b/src/gui/wizard/owncloudwizard.cpp >index 0127b2f16..565abe301 100644 >--- a/src/gui/wizard/owncloudwizard.cpp >+++ b/src/gui/wizard/owncloudwizard.cpp >@@ -54,7 +54,11 @@ OwncloudWizard::OwncloudWizard(QWidget *parent) > , _flow2CredsPage(new Flow2AuthCredsPage) > , _advancedSetupPage(new OwncloudAdvancedSetupPage(this)) > , _resultPage(new OwncloudWizardResultPage) >+#ifdef WITH_WEBENGINE > , _webViewPage(new WebViewPage(this)) >+#else // WITH_WEBENGINE >+ , _webViewPage(nullptr) >+#endif // WITH_WEBENGINE > { > setObjectName("owncloudWizard"); > >@@ -66,7 +70,9 @@ OwncloudWizard::OwncloudWizard(QWidget *parent) > setPage(WizardCommon::Page_Flow2AuthCreds, _flow2CredsPage); > setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage); > setPage(WizardCommon::Page_Result, _resultPage); >+#ifdef WITH_WEBENGINE > setPage(WizardCommon::Page_WebView, _webViewPage); >+#endif // WITH_WEBENGINE > > connect(this, &QDialog::finished, this, &OwncloudWizard::basicSetupFinished); > >@@ -78,7 +84,9 @@ OwncloudWizard::OwncloudWizard(QWidget *parent) > connect(_httpCredsPage, &OwncloudHttpCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl); > connect(_browserCredsPage, &OwncloudOAuthCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl); > connect(_flow2CredsPage, &Flow2AuthCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl); >+#ifdef WITH_WEBENGINE > connect(_webViewPage, &WebViewPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl); >+#endif // WITH_WEBENGINE > connect(_advancedSetupPage, &OwncloudAdvancedSetupPage::createLocalAndRemoteFolders, > this, &OwncloudWizard::createLocalAndRemoteFolders); > connect(this, &QWizard::customButtonClicked, this, &OwncloudWizard::skipFolderConfiguration); >@@ -230,9 +238,11 @@ void OwncloudWizard::successfulStep() > _flow2CredsPage->setConnected(); > break; > >+#ifdef WITH_WEBENGINE > case WizardCommon::Page_WebView: > _webViewPage->setConnected(); > break; >+#endif // WITH_WEBENGINE > > case WizardCommon::Page_AdvancedSetup: > _advancedSetupPage->directoriesCreated(); >@@ -256,8 +266,10 @@ void OwncloudWizard::setAuthType(DetermineAuthTypeJob::AuthType type) > _credentialsPage = _browserCredsPage; > } else if (type == DetermineAuthTypeJob::LoginFlowV2) { > _credentialsPage = _flow2CredsPage; >+#ifdef WITH_WEBENGINE > } else if (type == DetermineAuthTypeJob::WebViewFlow) { > _credentialsPage = _webViewPage; >+#endif // WITH_WEBENGINE > } else { // try Basic auth even for "Unknown" > _credentialsPage = _httpCredsPage; > } >@@ -281,7 +293,11 @@ void OwncloudWizard::slotCurrentPageChanged(int id) > button(QWizard::NextButton)->setHidden(true); > // Need to set it from here, otherwise it has no effect > _welcomePage->setLoginButtonDefault(); >- } else if (id == WizardCommon::Page_WebView || id == WizardCommon::Page_Flow2AuthCreds) { >+ } else if ( >+#ifdef WITH_WEBENGINE >+ id == WizardCommon::Page_WebView || >+#endif // WITH_WEBENGINE >+ id == WizardCommon::Page_Flow2AuthCreds) { > setButtonLayout({ QWizard::Stretch, QWizard::BackButton }); > } else if (id == WizardCommon::Page_AdvancedSetup) { > setButtonLayout({ QWizard::Stretch, QWizard::CustomButton1, QWizard::BackButton, QWizard::NextButton }); >diff --git a/src/gui/wizard/owncloudwizard.h b/src/gui/wizard/owncloudwizard.h >index e8480d3bd..ff253587f 100644 >--- a/src/gui/wizard/owncloudwizard.h >+++ b/src/gui/wizard/owncloudwizard.h >@@ -128,7 +128,7 @@ private: > OwncloudAdvancedSetupPage *_advancedSetupPage; > OwncloudWizardResultPage *_resultPage; > AbstractCredentialsWizardPage *_credentialsPage = nullptr; >- WebViewPage *_webViewPage; >+ WebViewPage *_webViewPage = nullptr; > > QStringList _setupLog; > >diff --git a/src/gui/wizard/owncloudwizardcommon.h b/src/gui/wizard/owncloudwizardcommon.h >index 30b4dfb80..7c6eef5ab 100644 >--- a/src/gui/wizard/owncloudwizardcommon.h >+++ b/src/gui/wizard/owncloudwizardcommon.h >@@ -46,7 +46,9 @@ namespace WizardCommon { > Page_HttpCreds, > Page_OAuthCreds, > Page_Flow2AuthCreds, >+#ifdef WITH_WEBENGINE > Page_WebView, >+#endif // WITH_WEBENGINE > Page_AdvancedSetup, > Page_Result > }; >diff --git a/src/gui/wizard/welcomepage.cpp b/src/gui/wizard/welcomepage.cpp >index 668c5b02f..83f4b416f 100644 >--- a/src/gui/wizard/welcomepage.cpp >+++ b/src/gui/wizard/welcomepage.cpp >@@ -13,6 +13,7 @@ > */ > > #include "welcomepage.h" >+#include "guiutility.h" > #include "theme.h" > #include "wizard/owncloudwizard.h" > #include "wizard/slideshow.h" >@@ -94,11 +95,18 @@ void WelcomePage::setupLoginButton() > > void WelcomePage::setupCreateAccountButton() > { >+#ifdef WITH_WEBENGINE > connect(_ui->createAccountButton, &QPushButton::clicked, this, [this](bool /*checked*/) { > _ocWizard->setRegistration(true); > _nextPage = WizardCommon::Page_WebView; > _ocWizard->next(); > }); >+#else // WITH_WEBENGINE >+ connect(_ui->createAccountButton, &QPushButton::clicked, this, [this](bool /*checked*/) { >+ _ocWizard->setRegistration(true); >+ Utility::openBrowser(QStringLiteral("https://nextcloud.com/register")); >+ }); >+#endif // WITH_WEBENGINE > } > > void WelcomePage::setupHostYourOwnServerLabel() >diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp >index 1330ff518..65b1b5474 100644 >--- a/src/libsync/networkjobs.cpp >+++ b/src/libsync/networkjobs.cpp >@@ -30,6 +30,7 @@ > #include <QCoreApplication> > #include <QJsonDocument> > #include <QJsonObject> >+#include <qloggingcategory.h> > #ifndef TOKEN_AUTH_ONLY > #include <QPainter> > #include <QPainterPath> >@@ -958,7 +959,11 @@ void DetermineAuthTypeJob::start() > auto flow = gs.toObject().value("desktoplogin"); > if (flow != QJsonValue::Undefined) { > if (flow.toInt() == 1) { >+#ifdef WITH_WEBENGINE > _resultOldFlow = WebViewFlow; >+#else // WITH_WEBENGINE >+ qCWarning(lcDetermineAuthTypeJob) << "Server does only support flow1, but this client was compiled without support for flow1"; >+#endif // WITH_WEBENGINE > } > } > } >@@ -985,20 +990,24 @@ void DetermineAuthTypeJob::checkAllDone() > > auto result = _resultPropfind; > >+#ifdef WITH_WEBENGINE > // WebViewFlow > OAuth > Basic > if (_account->serverVersionInt() >= Account::makeServerVersion(12, 0, 0)) { > result = WebViewFlow; > } >+#endif // WITH_WEBENGINE > > // LoginFlowV2 > WebViewFlow > OAuth > Basic > if (_account->serverVersionInt() >= Account::makeServerVersion(16, 0, 0)) { > result = LoginFlowV2; > } > >+#ifdef WITH_WEBENGINE > // If we determined that we need the webview flow (GS for example) then we switch to that > if (_resultOldFlow == WebViewFlow) { > result = WebViewFlow; > } >+#endif // WITH_WEBENGINE > > // If we determined that a simple get gave us an authentication required error > // then the server enforces basic auth and we got no choice but to use this >diff --git a/src/libsync/networkjobs.h b/src/libsync/networkjobs.h >index 1b0e212d4..8c34e2992 100644 >--- a/src/libsync/networkjobs.h >+++ b/src/libsync/networkjobs.h >@@ -446,7 +446,9 @@ public: > NoAuthType, // used only before we got a chance to probe the server > Basic, // also the catch-all fallback for backwards compatibility reasons > OAuth, >+#ifdef WITH_WEBENGINE > WebViewFlow, >+#endif // WITH_WEBENGINE > LoginFlowV2 > }; > Q_ENUM(AuthType)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 800863
:
722404
| 722419