Commit a3b91aae authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify

parent 1273d81a
Pipeline #41743 passed with stage
in 9 minutes and 1 second
......@@ -56,7 +56,7 @@ void LdapSearchPrivate::result()
mOp.abandon(mId);
return;
}
int res = mOp.waitForResult(mId, LDAPSEARCH_BLOCKING_TIMEOUT);
const int res = mOp.waitForResult(mId, LDAPSEARCH_BLOCKING_TIMEOUT);
qCDebug(LDAP_LOG) << "LDAP result:" << res;
......@@ -73,8 +73,7 @@ void LdapSearchPrivate::result()
//binding
if (res == LdapOperation::RES_BIND) {
QByteArray servercc;
servercc = mOp.serverCred();
const QByteArray servercc = mOp.serverCred();
qCDebug(LDAP_LOG) << "LdapSearch RES_BIND";
if (mConn->ldapErrorCode() == KLDAP_SUCCESS) { //bind succeeded
......@@ -169,7 +168,7 @@ void LdapSearchPrivate::result()
bool LdapSearchPrivate::connect()
{
int ret = mConn->connect();
const int ret = mConn->connect();
if (ret != KLDAP_SUCCESS) {
mError = ret;
mErrorString = mConn->connectionError();
......@@ -300,7 +299,7 @@ bool LdapSearch::search(const LdapUrl &url, int count)
}
}
bool critical = true;
int pagesize = url.extension(QStringLiteral("x-pagesize"), critical).toInt();
const int pagesize = url.extension(QStringLiteral("x-pagesize"), critical).toInt();
return d->startSearch(url.dn(), url.scope(), url.filter(),
url.attributes(), pagesize, count);
}
......
......@@ -285,7 +285,7 @@ void LdapServer::setUrl(const LdapUrl &url)
bool critical = true;
d->mHost = url.host();
int port = url.port();
const int port = url.port();
if (port <= 0) {
d->mPort = 389;
} else {
......
......@@ -64,7 +64,7 @@ LdapUrl::~LdapUrl()
void LdapUrl::setDn(const LdapDN &dn)
{
QString tmp = dn.toString();
const QString tmp = dn.toString();
if (tmp.startsWith(QLatin1Char('/'))) {
setPath(tmp);
} else {
......@@ -137,9 +137,7 @@ LdapUrl::Extension LdapUrl::extension(const QString &key) const
QString LdapUrl::extension(const QString &key, bool &critical) const
{
Extension ext;
ext = extension(key);
const Extension ext = extension(key);
critical = ext.critical;
return ext.value;
}
......
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