Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,43 +271,6 @@ if(BUILD_CLIENT)
endif()
endif()

option(BUILD_WITH_WEBENGINE "BUILD_WITH_WEBENGINE" ON)
if (BUILD_WITH_WEBENGINE)
find_package(Qt${QT_VERSION_MAJOR}WebEngineCore ${REQUIRED_QT_VERSION} CONFIG QUIET)
if(APPLE)
set_package_properties(Qt${QT_VERSION_MAJOR}WebEngineCore PROPERTIES
DESCRIPTION "Qt${QT_VERSION_MAJOR} WebEngineCore component."
TYPE RECOMMENDED
)
else()
set_package_properties(Qt${QT_VERSION_MAJOR}WebEngineCore PROPERTIES
DESCRIPTION "Qt${QT_VERSION_MAJOR} WebEngine component."
TYPE REQUIRED
)
endif()

find_package(Qt${QT_MAJOR_VERSION}WebEngineWidgets ${REQUIRED_QT_VERSION} CONFIG QUIET)
if(APPLE)
set_package_properties(Qt${QT_MAJOR_VERSION}WebEngineWidgets PROPERTIES
DESCRIPTION "Qt${QT_MAJOR_VERSION} WebEngineWidgets component."
TYPE RECOMMENDED
)
else()
set_package_properties(Qt${QT_MAJOR_VERSION}WebEngineWidgets PROPERTIES
DESCRIPTION "Qt${QT_MAJOR_VERSION} WebEngineWidgets component."
TYPE REQUIRED
)
endif()

if(Qt${QT_MAJOR_VERSION}WebEngineCore_FOUND AND Qt${QT_MAJOR_VERSION}WebEngineWidgets_FOUND)
message(STATUS "Enable use of Qt6 WebEngine module")
set(WITH_WEBENGINE 1)
else()
unset(WITH_WEBENGINE)
message(STATUS "Disable use of Qt6 WebEngine module")
endif()
endif()

if (NOT DEFINED APPLICATION_ICON_NAME)
set(APPLICATION_ICON_NAME ${APPLICATION_SHORTNAME})
endif()
Expand Down
6 changes: 1 addition & 5 deletions admin/nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
};

inherit (pkgs.lib.lists) optional optionals;
inherit (pkgs.lib.strings) hasPrefix optionalString;
isARM = hasPrefix "aarch64" system;
inherit (pkgs.lib.strings) optionalString;

buildMacOSSymlinks = pkgs.runCommand "nextcloud-build-symlinks" {} ''
mkdir -p $out/bin
Expand Down Expand Up @@ -53,9 +52,6 @@

libsForQt5.karchive
libsForQt5.qtkeychain
] ++ optionals (!isARM) [
# Qt WebEngine not available on ARM
qt5.qtwebengine
] ++ optionals stdenv.isLinux [
inotify-tools
libcloudproviders
Expand Down
6 changes: 1 addition & 5 deletions admin/osx/mac-crafter/Sources/Commands/Build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ struct Build: AsyncParsableCommand {

@Flag(help: "Build File Provider Module.")
var buildFileProviderModule = false

@Flag(help: "Build without QtWebEngine.")
var withoutWebEngine = false

@Flag(help: "Build without Sparkle auto-updater.")
var disableAutoUpdater = false
Expand Down Expand Up @@ -201,8 +198,7 @@ struct Build: AsyncParsableCommand {
"\(craftBlueprintName).osxArchs=\(arch)",
"\(craftBlueprintName).buildTests=\(buildTests ? "True" : "False")",
"\(craftBlueprintName).buildMacOSBundle=\(disableAppBundle ? "False" : "True")",
"\(craftBlueprintName).buildFileProviderModule=\(buildFileProviderModule ? "True" : "False")",
"\(craftBlueprintName).buildWithWebEngine=\(withoutWebEngine ? "False" : "True")"
"\(craftBlueprintName).buildFileProviderModule=\(buildFileProviderModule ? "True" : "False")"
]

if let overrideServerUrl {
Expand Down
25 changes: 0 additions & 25 deletions admin/osx/mac-crafter/Sources/Utils/Signer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,30 +127,6 @@ enum Signer: Signing {
return output.contains("Mach-O 64-bit executable")
}

///
/// Find and sign the Qt web engine helper app inside the QtWebEngineCore framework.
///
/// This needs explicit treatment because codesign does not automatically sign it when signing the upstream framework bundle.
///
private static func signQtWebEngineProcessApp(in bundle: URL, with codeSignIdentity: String) async {
let location = bundle
.appendingPathComponent("Contents")
.appendingPathComponent("Frameworks")
.appendingPathComponent("QtWebEngineCore.framework")
.appendingPathComponent("Versions")
.appendingPathComponent("A")
.appendingPathComponent("Helpers")
.appendingPathComponent("QtWebEngineProcess.app")

let entitlements = location
.appendingPathComponent("Contents")
.appendingPathComponent("Resources")
.appendingPathComponent("QtWebEngineProcess")
.appendingPathExtension("entitlements")

await sign(at: location, with: codeSignIdentity, entitlements: entitlements)
}

///
/// Find and sign the Sparkle downloader inside the Sparkle framework.
///
Expand Down Expand Up @@ -278,7 +254,6 @@ enum Signer: Signing {
await sign(at: extensionInMainBundle, with: codeSignIdentity, entitlements: extensionEntitlements)
}

await signQtWebEngineProcessApp(in: location, with: codeSignIdentity)
await signSparkleDownloader(in: location, with: codeSignIdentity)
await signSparkleUpdaterApp(in: location, with: codeSignIdentity)
await signSparkleInstaller(in: location, with: codeSignIdentity)
Expand Down
4 changes: 0 additions & 4 deletions admin/win/msi/collect-transform.xsl.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,4 @@
<xsl:key name="vc-redist-64-search" match="wix:Component[contains(wix:File/@Source, 'vc_redist.x64.exe')]" use="@Id" />
<xsl:template match="wix:Component[key('vc-redist-64-search', @Id)]" />
<xsl:template match="wix:ComponentRef[key('vc-redist-64-search', @Id)]" />

<xsl:key name="qt6-webengine-core-pdb" match="wix:Component[contains(wix:File/@Source, 'Qt6WebEngineCore.pdb')]" use="@Id" />
<xsl:template match="wix:Component[key('qt6-webengine-core-pdb', @Id)]" />
<xsl:template match="wix:ComponentRef[key('qt6-webengine-core-pdb', @Id)]" />
</xsl:stylesheet>
2 changes: 0 additions & 2 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@

#cmakedefine01 NEXTCLOUD_DEV

#cmakedefine WITH_WEBENGINE

#cmakedefine01 CLIENTSIDEENCRYPTION_ENFORCE_USB_TOKEN

#cmakedefine ENCRYPTION_HARDWARE_TOKEN_DRIVER_PATH "@ENCRYPTION_HARDWARE_TOKEN_DRIVER_PATH@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ swift run mac-crafter \
--disable-auto-updater \
--build-file-provider-module \
--code-sign-identity="Apple Development" \
--without-web-engine \
"$DESKTOP_CLIENT_PROJECT_ROOT"
12 changes: 0 additions & 12 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ set(client_UI_SRCS
mnemonicdialog.ui
vfsdownloaderrordialog.ui
wizard/flow2authwidget.ui
wizard/webview.ui
)

qt_add_resources(client_UI_SRCS ../../resources.qrc ${CMAKE_SOURCE_DIR}/theme.qrc)
Expand Down Expand Up @@ -242,13 +241,6 @@ if (NOT DISABLE_ACCOUNT_MIGRATION)
)
endif()

if (WITH_WEBENGINE)
list(APPEND client_SRCS
wizard/webview.h
wizard/webview.cpp
)
endif()

IF(BUILD_UPDATER)
set(updater_SRCS
updater/ocupdater.h
Expand Down Expand Up @@ -527,10 +519,6 @@ foreach(FILE IN LISTS client_UI_SRCS)
set_property(SOURCE ${FILE} PROPERTY SKIP_UNITY_BUILD_INCLUSION ON)
endforeach()

if(WITH_WEBENGINE)
target_link_libraries(nextcloudCore PUBLIC Qt::WebEngineWidgets Qt::WebEngineCore)
endif()

set_target_properties(nextcloudCore
PROPERTIES
AUTOUIC ON
Expand Down
38 changes: 7 additions & 31 deletions src/gui/creds/webflowcredentials.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-2.0-or-later
Expand All @@ -11,9 +11,6 @@
#include "account.h"
#include "configfile.h"
#include "theme.h"
#ifdef WITH_WEBENGINE
#include "wizard/webview.h"
#endif // WITH_WEBENGINE
#include "webflowcredentialsdialog.h"
#include "networkjobs.h"

Expand Down Expand Up @@ -148,37 +145,16 @@
}

void WebFlowCredentials::askFromUser() {
// Determine if the old flow has to be used (GS for now)
// 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 > Shib > Basic
#ifdef WITH_WEBENGINE
bool useFlow2 = (type != DetermineAuthTypeJob::WebViewFlow);
#else // WITH_WEBENGINE
Q_UNUSED(type)
bool useFlow2 = true;
#endif // WITH_WEBENGINE

_askDialog = new WebFlowCredentialsDialog(_account, useFlow2);

if (!useFlow2) {
QUrl url = _account->url();
QString path = url.path() + "/index.php/login/flow";
url.setPath(path);
_askDialog->setUrl(url);
}
_askDialog = new WebFlowCredentialsDialog(_account);

QString msg = tr("You have been logged out of your account %1 at %2. Please login again.")
.arg(_account->prettyName(), _account->url().toDisplayString());
_askDialog->setInfo(msg);
QString msg = tr("You have been logged out of your account %1 at %2. Please login again.")

Check warning on line 150 in src/gui/creds/webflowcredentials.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/creds/webflowcredentials.cpp:150:13 [cppcoreguidelines-init-variables]

variable 'msg' is not initialized
.arg(_account->prettyName(), _account->url().toDisplayString());
_askDialog->setInfo(msg);

_askDialog->show();
_askDialog->show();

connect(_askDialog, &WebFlowCredentialsDialog::urlCatched, this, &WebFlowCredentials::slotAskFromUserCredentialsProvided);
connect(_askDialog, &WebFlowCredentialsDialog::onClose, this, &WebFlowCredentials::slotAskFromUserCancelled);
});
job->start();
connect(_askDialog, &WebFlowCredentialsDialog::urlCatched, this, &WebFlowCredentials::slotAskFromUserCredentialsProvided);
connect(_askDialog, &WebFlowCredentialsDialog::onClose, this, &WebFlowCredentials::slotAskFromUserCancelled);

qCDebug(lcWebFlowCredentials()) << "User needs to reauth!";
}
Expand Down
55 changes: 10 additions & 45 deletions src/gui/creds/webflowcredentialsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,20 @@

#include "webflowcredentialsdialog.h"

#include "config.h"

#include "theme.h"
#include "application.h"
#include "guiutility.h"
#include "owncloudgui.h"

#ifdef WITH_WEBENGINE
#include "wizard/webview.h"
#endif // WITH_WEBENGINE

#include "wizard/flow2authwidget.h"

#include <QVBoxLayout>
#include <QLabel>

namespace OCC {

WebFlowCredentialsDialog::WebFlowCredentialsDialog(Account *account, bool useFlow2, QWidget *parent)
WebFlowCredentialsDialog::WebFlowCredentialsDialog(Account *account, QWidget *parent)

Check warning on line 20 in src/gui/creds/webflowcredentialsdialog.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/creds/webflowcredentialsdialog.cpp:20:52 [bugprone-easily-swappable-parameters]

2 adjacent parameters of 'WebFlowCredentialsDialog' of similar type ('int *') are easily swapped by mistake

Check warning on line 20 in src/gui/creds/webflowcredentialsdialog.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/creds/webflowcredentialsdialog.cpp:20:1 [cppcoreguidelines-pro-type-member-init]

constructor does not initialize these fields: , , _errorLabel, _infoLabel, _layout, _containerLayout
: QDialog(parent)
, _useFlow2(useFlow2)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

Expand All @@ -44,27 +37,18 @@
_infoLabel->setAlignment(Qt::AlignCenter);
_containerLayout->addWidget(_infoLabel);

if (_useFlow2) {
_flow2AuthWidget = new Flow2AuthWidget();
_containerLayout->addWidget(_flow2AuthWidget);

connect(_flow2AuthWidget, &Flow2AuthWidget::authResult, this, &WebFlowCredentialsDialog::slotFlow2AuthResult);
_flow2AuthWidget = new Flow2AuthWidget();
_containerLayout->addWidget(_flow2AuthWidget);

// Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching)
connect(this, &WebFlowCredentialsDialog::styleChanged, _flow2AuthWidget, &Flow2AuthWidget::slotStyleChanged);
connect(_flow2AuthWidget, &Flow2AuthWidget::authResult, this, &WebFlowCredentialsDialog::slotFlow2AuthResult);

// allow Flow2 page to poll on window activation
connect(this, &WebFlowCredentialsDialog::onActivate, _flow2AuthWidget, &Flow2AuthWidget::slotPollNow);
// Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching)
connect(this, &WebFlowCredentialsDialog::styleChanged, _flow2AuthWidget, &Flow2AuthWidget::slotStyleChanged);

_flow2AuthWidget->startAuth(account);
} else {
#ifdef WITH_WEBENGINE
_webView = new WebView();
_containerLayout->addWidget(_webView, 1);
// allow Flow2 page to poll on window activation
connect(this, &WebFlowCredentialsDialog::onActivate, _flow2AuthWidget, &Flow2AuthWidget::slotPollNow);

connect(_webView, &WebView::urlCatched, this, &WebFlowCredentialsDialog::urlCatched);
#endif // WITH_WEBENGINE
}
_flow2AuthWidget->startAuth(account);

auto app = dynamic_cast<Application *>(qApp);
connect(app, &Application::isShowingSettingsDialog, this, &WebFlowCredentialsDialog::slotShowSettingsDialog);
Expand All @@ -85,15 +69,6 @@
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();
_flow2AuthWidget->deleteLater();
Expand All @@ -103,16 +78,6 @@
emit onClose();
}

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) {
_infoLabel->setText(msg);
}
Expand All @@ -121,7 +86,7 @@
// bring window to top
slotShowSettingsDialog();

if (_useFlow2 && _flow2AuthWidget) {
if (_flow2AuthWidget) {

Check warning on line 89 in src/gui/creds/webflowcredentialsdialog.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/creds/webflowcredentialsdialog.cpp:89:9 [readability-implicit-bool-conversion]

implicit conversion 'OCC::Flow2AuthWidget *' -> bool
_flow2AuthWidget->setError(error);
return;
}
Expand Down
18 changes: 1 addition & 17 deletions src/gui/creds/webflowcredentialsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,27 @@
#ifndef WEBFLOWCREDENTIALSDIALOG_H
#define WEBFLOWCREDENTIALSDIALOG_H

#include "config.h"

#include "accountfwd.h"

Check failure on line 9 in src/gui/creds/webflowcredentialsdialog.h

View workflow job for this annotation

GitHub Actions / build

src/gui/creds/webflowcredentialsdialog.h:9:10 [clang-diagnostic-error]

'accountfwd.h' file not found
#include "creds/flow2auth.h"

#include <QDialog>
#include <QUrl>

class QLabel;
class QVBoxLayout;

namespace OCC {

#ifdef WITH_WEBENGINE
class WebView;
#endif // WITH_WEBENGINE
class Flow2AuthWidget;

class WebFlowCredentialsDialog : public QDialog
{
Q_OBJECT
public:
WebFlowCredentialsDialog(Account *account, bool useFlow2, QWidget *parent = nullptr);
WebFlowCredentialsDialog(Account *account, QWidget *parent = nullptr);

void setUrl(const QUrl &url);
void setInfo(const QString &msg);
void setError(const QString &error);

[[nodiscard]] bool isUsingFlow2() const {
return _useFlow2;
}

protected:
void closeEvent(QCloseEvent * e) override;
void changeEvent(QEvent *) override;
Expand All @@ -55,12 +44,7 @@
private:
void customizeStyle();

bool _useFlow2;

Flow2AuthWidget *_flow2AuthWidget = nullptr;
#ifdef WITH_WEBENGINE
WebView *_webView = nullptr;
#endif // WITH_WEBENGINE

QLabel *_errorLabel;
QLabel *_infoLabel;
Expand Down
Loading
Loading