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
PIM
KSmtp
Commits
94ea6585
Commit
94ea6585
authored
Apr 13, 2022
by
Laurent Montel
😁
Browse files
Const'ify + use Q_REQUIRED_RESULT
parent
0063f277
Pipeline
#163597
passed with stages
in 2 minutes and 22 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/serverresponse_p.h
View file @
94ea6585
...
...
@@ -15,11 +15,11 @@ class ServerResponse
{
public:
explicit
ServerResponse
(
int
code
=
0
,
const
QByteArray
&
text
=
QByteArray
(),
bool
multiline
=
false
);
int
code
()
const
;
QByteArray
text
()
const
;
bool
isCode
(
int
other
)
const
;
Q_REQUIRED_RESULT
int
code
()
const
;
Q_REQUIRED_RESULT
QByteArray
text
()
const
;
Q_REQUIRED_RESULT
bool
isCode
(
int
other
)
const
;
bool
isMultiline
()
const
;
Q_REQUIRED_RESULT
bool
isMultiline
()
const
;
private:
QByteArray
m_text
;
...
...
src/session_p.h
View file @
94ea6585
...
...
@@ -39,7 +39,7 @@ public:
void
setState
(
Session
::
State
s
);
void
startSsl
();
QSsl
::
SslProtocol
negotiatedEncryption
()
const
;
Q_REQUIRED_RESULT
QSsl
::
SslProtocol
negotiatedEncryption
()
const
;
public
Q_SLOTS
:
void
handleSslError
(
const
KSslErrorUiData
&
data
);
...
...
src/sessionthread.cpp
View file @
94ea6585
...
...
@@ -170,8 +170,8 @@ ServerResponse SessionThread::parseResponse(const QByteArray &resp)
QByteArray
response
(
resp
);
// Remove useless CRLF
int
indexOfCR
=
response
.
indexOf
(
"
\r
"
);
int
indexOfLF
=
response
.
indexOf
(
"
\n
"
);
const
int
indexOfCR
=
response
.
indexOf
(
"
\r
"
);
const
int
indexOfLF
=
response
.
indexOf
(
"
\n
"
);
if
(
indexOfCR
>
0
)
{
response
.
truncate
(
indexOfCR
);
...
...
@@ -181,7 +181,7 @@ ServerResponse SessionThread::parseResponse(const QByteArray &resp)
}
// Server response code
QByteArray
code
=
response
.
left
(
3
);
const
QByteArray
code
=
response
.
left
(
3
);
bool
ok
=
false
;
const
int
returnCode
=
code
.
toInt
(
&
ok
);
if
(
!
ok
)
{
...
...
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