Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 8e36fc8a authored by Laurent Montel's avatar Laurent Montel 😁

Const'ify

parent 8231dbf6
......@@ -49,7 +49,7 @@ void O1::setRequestParameters(const QList<O0RequestParameter> &v)
requestParameters_ = v;
}
QString O1::callbackUrl()
QString O1::callbackUrl() const
{
return callbackUrl_;
}
......@@ -59,7 +59,7 @@ void O1::setCallbackUrl(const QString &v)
callbackUrl_ = v;
}
QUrl O1::authorizeUrl()
QUrl O1::authorizeUrl() const
{
return authorizeUrl_;
}
......@@ -70,7 +70,7 @@ void O1::setAuthorizeUrl(const QUrl &value)
Q_EMIT authorizeUrlChanged();
}
QUrl O1::accessTokenUrl()
QUrl O1::accessTokenUrl() const
{
return accessTokenUrl_;
}
......
......@@ -34,17 +34,17 @@ public:
/// It should contain a `%1` place marker, to be replaced by `O0BaseAuth::localPort()`.
/// Defaults to `O2_CALLBACK_URL`.
Q_PROPERTY(QString callbackUrl READ callbackUrl WRITE setCallbackUrl)
QString callbackUrl();
QString callbackUrl() const;
void setCallbackUrl(const QString &value);
/// Authorization URL.
Q_PROPERTY(QUrl authorizeUrl READ authorizeUrl WRITE setAuthorizeUrl NOTIFY authorizeUrlChanged)
QUrl authorizeUrl();
QUrl authorizeUrl() const;
void setAuthorizeUrl(const QUrl &value);
/// Access token URL.
Q_PROPERTY(QUrl accessTokenUrl READ accessTokenUrl WRITE setAccessTokenUrl NOTIFY accessTokenUrlChanged)
QUrl accessTokenUrl();
QUrl accessTokenUrl() const;
void setAccessTokenUrl(const QUrl &value);
/// Constructor.
......
......@@ -98,7 +98,7 @@ void O2::setUsername(const QString &value)
Q_EMIT usernameChanged();
}
QString O2::password()
QString O2::password() const
{
return password_;
}
......@@ -109,7 +109,7 @@ void O2::setPassword(const QString &value)
Q_EMIT passwordChanged();
}
QString O2::scope()
QString O2::scope() const
{
return scope_;
}
......@@ -120,7 +120,7 @@ void O2::setScope(const QString &value)
Q_EMIT scopeChanged();
}
QString O2::requestUrl()
QString O2::requestUrl() const
{
return requestUrl_.toString();
}
......@@ -262,7 +262,7 @@ void O2::onVerificationReceived(const QMap<QString, QString> &response)
}
}
QString O2::code()
QString O2::code() const
{
QString key = QString(O2_KEY_CODE).arg(clientId_);
return store_->value(key);
......@@ -424,7 +424,7 @@ void O2::setLocalhostPolicy(const QString &value)
localhostPolicy_ = value;
}
QString O2::apiKey()
QString O2::apiKey() const
{
return apiKey_;
}
......@@ -434,7 +434,7 @@ void O2::setApiKey(const QString &value)
apiKey_ = value;
}
QByteArray O2::replyContent()
QByteArray O2::replyContent() const
{
return replyServer_->replyContent();
}
......
......@@ -38,12 +38,12 @@ public:
/// Resource owner password.
/// O2 instances with the same (username, password) share the same "linked" and "token" properties.
Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged)
QString password();
QString password() const;
void setPassword(const QString &value);
/// Scope of authentication.
Q_PROPERTY(QString scope READ scope WRITE setScope NOTIFY scopeChanged)
QString scope();
QString scope() const;
void setScope(const QString &value);
/// Localhost policy. By default it's value is http://127.0.0.1:%1/, however some services may
......@@ -54,13 +54,13 @@ public:
/// API key.
Q_PROPERTY(QString apiKey READ apiKey WRITE setApiKey)
QString apiKey();
QString apiKey() const;
void setApiKey(const QString &value);
/// Page content on local host after successful oauth.
/// Provide it in case you do not want to close the browser, but display something
Q_PROPERTY(QByteArray replyContent READ replyContent WRITE setReplyContent)
QByteArray replyContent();
QByteArray replyContent() const;
void setReplyContent(const QByteArray &value);
/// Allow ignoring SSL errors?
......@@ -71,7 +71,7 @@ public:
/// Request URL.
Q_PROPERTY(QString requestUrl READ requestUrl WRITE setRequestUrl NOTIFY requestUrlChanged)
QString requestUrl();
QString requestUrl() const;
void setRequestUrl(const QString &value);
/// Token request URL.
......@@ -90,7 +90,7 @@ public:
explicit O2(QObject *parent = nullptr);
/// Get authentication code.
QString code();
QString code() const;
/// Get refresh token.
QString refreshToken();
......
......@@ -75,7 +75,7 @@ QMap<QString, QString> O2ReplyServer::parseQueryParams(QByteArray *data)
return queryParams;
}
QByteArray O2ReplyServer::replyContent()
QByteArray O2ReplyServer::replyContent() const
{
return replyContent_;
}
......
......@@ -16,7 +16,7 @@ public:
/// Page content on local host after successful oauth - in case you do not want to close the browser, but display something
Q_PROPERTY(QByteArray replyContent READ replyContent WRITE setReplyContent)
QByteArray replyContent();
QByteArray replyContent() const;
void setReplyContent(const QByteArray &value);
Q_SIGNALS:
......
Markdown is supported
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