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
b2061665
Commit
b2061665
authored
Sep 21, 2020
by
Nicolas Fella
Browse files
[nextcloud] Add state property to controller
parent
ee7b88de
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/nextcloud-ui/nextcloudcontroller.cpp
View file @
b2061665
...
...
@@ -88,6 +88,8 @@ void NextcloudController::fileChecked(KJob* job)
QUrl
url
=
KIO
::
upUrl
(
kJob
->
url
());
m_server
=
url
.
toString
();
m_state
=
WebLogin
;
Q_EMIT
stateChanged
();
// Call webview for login
openWebView
();
}
...
...
@@ -200,6 +202,8 @@ void NextcloudController::authCheckResult(KJob *job)
}
else
{
m_errorMessage
.
clear
();
m_isLoginComplete
=
true
;
m_state
=
Services
;
Q_EMIT
stateChanged
();
Q_EMIT
isLoginCompleteChanged
();
}
...
...
plugins/nextcloud-ui/nextcloudcontroller.h
View file @
b2061665
...
...
@@ -28,8 +28,17 @@ class NextcloudController : public QObject
Q_PROPERTY
(
bool
isWorking
READ
isWorking
NOTIFY
isWorkingChanged
)
Q_PROPERTY
(
bool
isLoginComplete
READ
isLoginComplete
NOTIFY
isLoginCompleteChanged
)
Q_PROPERTY
(
QString
errorMessage
READ
errorMessage
NOTIFY
errorMessageChanged
)
Q_PROPERTY
(
State
state
MEMBER
m_state
NOTIFY
stateChanged
)
public:
enum
State
{
ServerUrl
=
0
,
WebLogin
,
Services
,
};
Q_ENUM
(
State
)
NextcloudController
(
QObject
*
parent
=
0
);
~
NextcloudController
();
...
...
@@ -44,6 +53,7 @@ Q_SIGNALS:
void
errorMessageChanged
();
void
isLoginCompleteChanged
();
void
wizardFinished
(
const
QString
&
username
,
const
QString
&
password
,
const
QVariantMap
&
data
);
void
stateChanged
();
private
Q_SLOTS
:
void
fileChecked
(
KJob
*
job
);
...
...
@@ -69,6 +79,7 @@ private:
QStringList
m_disabledServices
;
bool
m_isWorking
=
false
;
bool
m_isLoginComplete
=
false
;
State
m_state
=
ServerUrl
;
};
...
...
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