Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
KAccounts Providers
Commits
60367561
Commit
60367561
authored
Sep 22, 2020
by
Nicolas Fella
Browse files
[nextcloud] Remove unused old webengine integration
parent
b951e9a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
60367561
...
...
@@ -16,7 +16,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${ECM_MODULE_P
find_package
(
Intltool REQUIRED
)
find_package
(
KAccounts REQUIRED
)
find_package
(
Qt5
${
QT_REQUIRED_VERSION
}
CONFIG REQUIRED Core Qml
WebEngineWidgets
WebEngine
)
find_package
(
Qt5
${
QT_REQUIRED_VERSION
}
CONFIG REQUIRED Core Qml WebEngine
)
find_package
(
KF5
${
KF5_MIN_VERSION
}
REQUIRED KIO I18n Declarative Package
)
include
(
KDEInstallDirs
)
...
...
plugins/nextcloud-ui/CMakeLists.txt
View file @
60367561
...
...
@@ -9,7 +9,6 @@ add_library(nextcloud_plugin_kaccounts MODULE
target_link_libraries
(
nextcloud_plugin_kaccounts
Qt5::Core
Qt5::WebEngineWidgets
Qt5::WebEngine
KF5::KIOCore
KF5::I18n
...
...
plugins/nextcloud-ui/nextcloudcontroller.cpp
View file @
60367561
...
...
@@ -13,13 +13,6 @@
#include
<KLocalizedString>
#include
<QJsonDocument>
#include
<QJsonObject>
#include
<QtWidgets>
#include
<QtNetwork>
#include
<QWebEngineView>
#include
<QWebEnginePage>
#include
<QWebEngineHttpRequest>
#include
<QWebEngineProfile>
#include
<QFileSystemWatcher>
#include
<QDesktopServices>
// Document for login flow : https://docs.nextcloud.com/server/stable/developer_manual/client_apis/LoginFlow/index.html
...
...
@@ -105,8 +98,6 @@ void NextcloudController::fileChecked(KJob* job)
m_state
=
WebLogin
;
Q_EMIT
stateChanged
();
// Call webview for login
openWebView
();
}
// When url entered by user is wrong
...
...
@@ -119,36 +110,9 @@ void NextcloudController::wrongUrlDetected()
// Open Webview for nextcloud login.
// Document for login flow : https://docs.nextcloud.com/server/stable/developer_manual/client_apis/LoginFlow/index.html
void
NextcloudController
::
openWebView
()
{
QWebEngineHttpRequest
request
;
// set proper headers
request
.
setUrl
(
QUrl
::
fromUserInput
(
m_server
+
"/index.php/login/flow"
));
request
.
setHeader
(
QByteArray
::
fromStdString
(
"USER_AGENT"
),
QByteArray
::
fromStdString
(
"Mozilla/5.0 nextcloud-ui-plugin"
)
);
request
.
setHeader
(
QByteArray
::
fromStdString
(
"OCS-APIREQUEST"
),
QByteArray
::
fromStdString
(
"true"
)
);
m_view
->
load
(
request
);
// Delete cookies because it is a one time webview
m_view
->
page
()
->
profile
()
->
setPersistentCookiesPolicy
(
QWebEngineProfile
::
NoPersistentCookies
);
// To catch the url of scheme *nc* on the final login
QDesktopServices
::
setUrlHandler
(
"nc"
,
this
,
"finalUrlHandler"
);
m_view
->
show
();
m_view
->
resize
(
424
,
650
);
}
void
NextcloudController
::
finalUrlHandler
(
const
QUrl
&
url
){
m_finalUrl
=
url
;
m_view
->
close
();
delete
m_view
;
// To fetch m_username and m_password from final url
QString
finalURLtoString
=
m_finalUrl
.
toString
();
...
...
plugins/nextcloud-ui/nextcloudcontroller.h
View file @
60367561
...
...
@@ -10,10 +10,6 @@
#include
<QObject>
#include
<QStringList>
#include
<QtWidgets>
#include
<QWebEngineView>
#include
<QWebEnginePage>
#include
<QWebEngineHttpRequest>
#include
<QWebEngineUrlRequestInterceptor>
#include
<QQuickWebEngineProfile>
...
...
@@ -76,7 +72,6 @@ private:
void
figureOutServer
(
const
QUrl
&
url
);
void
setWorking
(
bool
start
);
void
serverCheckResult
();
void
openWebView
();
void
wrongUrlDetected
();
QByteArray
m_json
;
...
...
@@ -85,7 +80,6 @@ private:
QString
m_username
;
QString
m_password
;
QUrl
m_finalUrl
;
QWebEngineView
*
m_view
=
new
QWebEngineView
;
QStringList
m_disabledServices
;
bool
m_isWorking
=
false
;
bool
m_isLoginComplete
=
false
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment