Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KDE PIM Runtime
Commits
cf68f33c
Commit
cf68f33c
authored
Sep 17, 2020
by
Shashwat Jolly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use etebase error codes for detecting login failures
parent
4769aebf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
resources/etesync/etesyncclientstate.cpp
resources/etesync/etesyncclientstate.cpp
+5
-0
resources/etesync/setupwizard.cpp
resources/etesync/setupwizard.cpp
+3
-3
No files found.
resources/etesync/etesyncclientstate.cpp
View file @
cf68f33c
...
...
@@ -83,6 +83,11 @@ bool EteSyncClientState::login(const QString &serverUrl, const QString &username
mPassword
=
password
;
mClientXXX
=
etebase_client_new
(
QStringLiteral
(
"Akonadi EteSync Resource"
),
mServerUrl
);
if
(
!
mClientXXX
)
{
qCDebug
(
ETESYNC_LOG
)
<<
"Could not initialise Etebase client"
;
qCDebug
(
ETESYNC_LOG
)
<<
"Etebase error"
<<
etebase_error_get_message
();
return
false
;
}
mAccountXXX
=
etebase_account_login
(
mClientXXX
.
get
(),
mUsername
,
mPassword
);
if
(
!
mAccountXXX
)
{
qCDebug
(
ETESYNC_LOG
)
<<
"Could not fetch Etebase account"
;
...
...
resources/etesync/setupwizard.cpp
View file @
cf68f33c
...
...
@@ -118,11 +118,11 @@ bool LoginPage::validatePage()
{
if
(
!
mLoginResult
)
{
qCDebug
(
ETESYNC_LOG
)
<<
"loginResult error"
<<
mErrorCode
;
if
(
mErrorCode
==
Ete
Sync
ErrorCode
::
ETE
SYNC
_ERROR_CODE_UNAUTHORIZED
||
mErrorCode
==
EteSyncErrorCode
::
ETESYNC_ERROR_CODE_HTTP
)
{
if
(
mErrorCode
==
Ete
base
ErrorCode
::
ETE
BASE
_ERROR_CODE_UNAUTHORIZED
)
{
mLoginLabel
->
setText
(
i18n
(
"Incorrect login credentials. Please try again."
));
}
else
if
(
mErrorCode
==
Ete
Sync
ErrorCode
::
ETE
SYNC
_ERROR_CODE_
ENCODING
)
{
}
else
if
(
mErrorCode
==
Ete
base
ErrorCode
::
ETE
BASE
_ERROR_CODE_
URL_PARSE
)
{
mLoginLabel
->
setText
(
i18n
(
"Please ensure that the server URL is correct. The URL should start with http:// or https://."
));
}
else
if
(
mErrorCode
==
Ete
Sync
ErrorCode
::
ETE
SYNC
_ERROR_CODE_CONNECTION
)
{
}
else
if
(
mErrorCode
==
Ete
base
ErrorCode
::
ETE
BASE
_ERROR_CODE_CONNECTION
)
{
mLoginLabel
->
setText
(
i18n
(
"Could not connect to the server. Please ensure that the server URL is correct."
));
}
else
{
mLoginLabel
->
setText
(
i18n
(
charArrFromQString
(
mErrorMessage
)));
...
...
Write
Preview
Markdown
is supported
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