Commit 94ea6585 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify + use Q_REQUIRED_RESULT

parent 0063f277
Pipeline #163597 passed with stages
in 2 minutes and 22 seconds
......@@ -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;
......
......@@ -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);
......
......@@ -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) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment