Commit 1cce548b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use qCDebug

parent 170415ce
......@@ -36,6 +36,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kldap_config.h.cmake ${CMAKE_CURRENT_
########### next target ###############
set(kldap_LIB_SRCS
ldap_debug.cpp
ber.cpp
ldif.cpp
ldapurl.cpp
......
......@@ -21,7 +21,7 @@
#include "ber.h"
#include "kldap_config.h"
#include <qdebug.h>
#include "ldap_debug.h"
#include <QtCore/QList>
#include <qvarlengtharray.h>
......@@ -209,10 +209,10 @@ int Ber::printf(const QString &format, ...)
ret = ber_printf(d->mBer, fmt);
break;
default:
qWarning() << "Invalid BER format parameter: '" << fmt << "'";
qCWarning(LDAP_LOG) << "Invalid BER format parameter: '" << fmt << "'";
ret = -1;
}
qDebug() << "ber_printf format:" << fmt << "ret:" << ret;
qCDebug(LDAP_LOG) << "ber_printf format:" << fmt << "ret:" << ret;
if (ret == -1) {
break;
}
......@@ -349,11 +349,11 @@ int Ber::scanf(const QString &format, ...)
ret = ber_scanf(d->mBer, fmt);
break;
default:
qWarning() << "Invalid BER format parameter: '" << fmt << "'";
qCWarning(LDAP_LOG) << "Invalid BER format parameter: '" << fmt << "'";
ret = -1;
}
qDebug() << "ber_scanf format:" << fmt << "ret:" << ret;
qCDebug(LDAP_LOG) << "ber_scanf format:" << fmt << "ret:" << ret;
if (ret == -1) {
break;
}
......
/* This file is part of the KDE project
Copyright (C) 2014 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "ldap_debug.h"
Q_LOGGING_CATEGORY(LDAP_LOG, "log_ldap")
/* This file is part of the KDE project
Copyright (C) 2014 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef LDAP_DEBUG_H
#define LDAP_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(LDAP_LOG)
#endif
......@@ -22,7 +22,7 @@
#include "ldapmodel.h"
#include "ldapmodelnode_p.h"
#include <qdebug.h>
#include "ldap_debug.h"
#include <klocalizedstring.h>
using namespace KLDAP;
......
......@@ -23,7 +23,7 @@
#include <qprogressdialog.h>
#include <kcombobox.h>
#include <qdebug.h>
#include "ldap_debug.h"
#include <klocalizedstring.h>
#include <klineedit.h>
#include <kmessagebox.h>
......@@ -336,7 +336,7 @@ void LdapConfigWidget::Private::sendQuery()
_url.setAttributes(QStringList(mAttr));
_url.setScope(LdapUrl::Base);
qDebug() << "sendQuery url:" << _url.toDisplayString();
qCDebug(LDAP_LOG) << "sendQuery url:" << _url.toDisplayString();
LdapSearch search;
connect(&search, SIGNAL(data(KLDAP::LdapSearch*,KLDAP::LdapObject)),
......@@ -360,7 +360,7 @@ void LdapConfigWidget::Private::sendQuery()
mProg->setValue(0);
mProg->exec();
if (mCancelled) {
qDebug() << "query canceled!";
qCDebug(LDAP_LOG) << "query canceled!";
search.abandon();
} else {
if (search.error()) {
......@@ -395,7 +395,7 @@ void LdapConfigWidget::Private::queryDNClicked()
void LdapConfigWidget::Private::loadData(LdapSearch *, const LdapObject &object)
{
qDebug() << "object:" << object.toString();
qCDebug(LDAP_LOG) << "object:" << object.toString();
mProg->setValue(mProg->value() + 1);
LdapAttrMap::ConstIterator end(object.attributes().constEnd());
for (LdapAttrMap::ConstIterator it = object.attributes().constBegin();
......
......@@ -24,7 +24,7 @@
#include <stdlib.h>
#include <klocalizedstring.h>
#include <qdebug.h>
#include "ldap_debug.h"
#ifdef SASL2_FOUND
#include <sasl/sasl.h>
......@@ -208,7 +208,7 @@ QString LdapConnection::ldapErrorString() const
bool LdapConnection::setSizeLimit(int sizelimit)
{
Q_ASSERT(d->mLDAP);
qDebug() << "sizelimit:" << sizelimit;
qCDebug(LDAP_LOG) << "sizelimit:" << sizelimit;
if (setOption(LDAP_OPT_SIZELIMIT, &sizelimit) != LDAP_OPT_SUCCESS) {
return false;
}
......@@ -228,7 +228,7 @@ int LdapConnection::sizeLimit() const
bool LdapConnection::setTimeLimit(int timelimit)
{
Q_ASSERT(d->mLDAP);
qDebug() << "timelimit:" << timelimit;
qCDebug(LDAP_LOG) << "timelimit:" << timelimit;
if (setOption(LDAP_OPT_TIMELIMIT, &timelimit) != LDAP_OPT_SUCCESS) {
return false;
}
......@@ -261,7 +261,7 @@ int LdapConnection::connect()
url += d->mServer.host();
url += QLatin1Char(':');
url += QString::number(d->mServer.port());
qDebug() << "ldap url:" << url;
qCDebug(LDAP_LOG) << "ldap url:" << url;
#ifdef HAVE_LDAP_INITIALIZE
ret = ldap_initialize(&d->mLDAP, url.toLatin1().constData());
#else
......@@ -277,7 +277,7 @@ int LdapConnection::connect()
return ret;
}
qDebug() << "setting version to:" << version;
qCDebug(LDAP_LOG) << "setting version to:" << version;
if (setOption(LDAP_OPT_PROTOCOL_VERSION, &version) != LDAP_OPT_SUCCESS) {
ret = ldapErrorCode();
d->mConnectionError = i18n("Cannot set protocol version to %1.", version);
......@@ -286,7 +286,7 @@ int LdapConnection::connect()
}
#if defined(LDAP_OPT_TIMEOUT)
qDebug() << "setting timeout to:" << timeout;
qCDebug(LDAP_LOG) << "setting timeout to:" << timeout;
if (timeout) {
if (setOption(LDAP_OPT_TIMEOUT, &timeout) != LDAP_OPT_SUCCESS) {
......@@ -301,9 +301,9 @@ int LdapConnection::connect()
#endif
//FIXME: accessing to certificate handling would be good
qDebug() << "setting security to:" << d->mServer.security();
qCDebug(LDAP_LOG) << "setting security to:" << d->mServer.security();
if (d->mServer.security() == LdapServer::TLS) {
qDebug() << "start TLS";
qCDebug(LDAP_LOG) << "start TLS";
#ifdef HAVE_LDAP_START_TLS_S
if ((ret = ldap_start_tls_s(d->mLDAP, NULL, NULL)) != LDAP_SUCCESS) {
d->mConnectionError = ldapErrorString();
......@@ -317,7 +317,7 @@ int LdapConnection::connect()
#endif
}
qDebug() << "setting sizelimit to:" << d->mServer.sizeLimit();
qCDebug(LDAP_LOG) << "setting sizelimit to:" << d->mServer.sizeLimit();
if (d->mServer.sizeLimit()) {
if (!setSizeLimit(d->mServer.sizeLimit())) {
ret = ldapErrorCode();
......@@ -327,7 +327,7 @@ int LdapConnection::connect()
}
}
qDebug() << "setting timelimit to:" << d->mServer.timeLimit();
qCDebug(LDAP_LOG) << "setting timelimit to:" << d->mServer.timeLimit();
if (d->mServer.timeLimit()) {
if (!setTimeLimit(d->mServer.timeLimit())) {
ret = ldapErrorCode();
......@@ -338,7 +338,7 @@ int LdapConnection::connect()
}
#ifdef SASL2_FOUND
qDebug() << "initializing SASL client";
qCDebug(LDAP_LOG) << "initializing SASL client";
int saslresult = sasl_client_new("ldap", d->mServer.host().toLatin1(),
0, 0, callbacks, 0, &d->mSASLconn);
if (saslresult != SASL_OK) {
......@@ -366,7 +366,7 @@ void LdapConnection::close()
d->mSASLconn = 0;
}
#endif
qDebug() << "connection closed!";
qCDebug(LDAP_LOG) << "connection closed!";
}
#else //LDAP_FOUND
......
......@@ -22,7 +22,7 @@
#include <algorithm>
#include <qdebug.h>
#include "ldap_debug.h"
using namespace KLDAP;
......@@ -40,7 +40,7 @@ public:
bool LdapDN::LdapDNPrivate::isValidRDNString(const QString &rdn) const
{
qDebug() << "Testing rdn:" << rdn;
qCDebug(LDAP_LOG) << "Testing rdn:" << rdn;
// If it is a muli-valued rdn, split it into its constituent parts
const QStringList rdnParts = splitOnNonEscapedChar(rdn, QLatin1Char('+'));
......@@ -76,9 +76,9 @@ QStringList LdapDN::LdapDNPrivate::splitOnNonEscapedChar(const QString &str,
const QChar prev = str[std::max(0, index - 1)];
if (prev != QLatin1Char('\\')) {
// Found a component of a multi-valued RDN
//qDebug() << "Found" << ch << "at index" << index;
//qCDebug(LDAP_LOG) << "Found" << ch << "at index" << index;
QString tmp = str.mid(strPartStartIndex, index - strPartStartIndex);
//qDebug() << "Adding part:" << tmp;
//qCDebug(LDAP_LOG) << "Adding part:" << tmp;
strParts.append(tmp);
strPartStartIndex = index + 1;
}
......@@ -88,7 +88,7 @@ QStringList LdapDN::LdapDNPrivate::splitOnNonEscapedChar(const QString &str,
// Add on the part after the last found delimeter
QString tmp = str.mid(strPartStartIndex);
//qDebug() << "Adding part:" << tmp;
//qCDebug(LDAP_LOG) << "Adding part:" << tmp;
strParts.append(tmp);
return strParts;
......@@ -153,7 +153,7 @@ QString LdapDN::toString(int depth) const
QString dn;
for (int i = depth; i >= 0; i--) {
dn += rdns.at(rdns.size() - 1 - i) + QLatin1Char(',');
qDebug() << "dn =" << dn;
qCDebug(LDAP_LOG) << "dn =" << dn;
}
dn = dn.left(dn.length() - 1); // Strip off the extraneous comma
......@@ -178,7 +178,7 @@ QString LdapDN::rdnString(int depth) const
bool LdapDN::isValid() const
{
qDebug() << "Testing dn:" << d->m_dn;
qCDebug(LDAP_LOG) << "Testing dn:" << d->m_dn;
// Break the string into rdn's
const QStringList rdns = d->splitOnNonEscapedChar(d->m_dn, QLatin1Char(','));
......
......@@ -23,7 +23,7 @@
#include "ldapmodelnode_p.h"
#include "ldapsearch.h"
#include <qdebug.h>
#include "ldap_debug.h"
#include <klocalizedstring.h>
using namespace KLDAP;
......@@ -91,7 +91,7 @@ QModelIndex LdapModel::index(int row, int col, const QModelIndex &parent) const
if (childItem) {
return createIndex(row, col, childItem);
}
qDebug() << "Could not create valid index for row =" << row << ", col =" << col;
qCDebug(LDAP_LOG) << "Could not create valid index for row =" << row << ", col =" << col;
return QModelIndex();
}
......
......@@ -22,7 +22,7 @@
#include "ldapmodelnode_p.h"
#include "ldapsearch.h"
#include <qdebug.h>
#include "ldap_debug.h"
using namespace KLDAP;
......@@ -71,17 +71,17 @@ bool LdapModel::LdapModelPrivate::search(const LdapDN &searchBase,
void LdapModel::LdapModelPrivate::setSearchType(SearchType t, LdapModelDNNode *item)
{
//qDebug() << "item =" << item;
//qCDebug(LDAP_LOG) << "item =" << item;
m_searchType = t;
m_searchItem = item;
}
void LdapModel::LdapModelPrivate::recreateRootItem()
{
//qDebug();
//qCDebug(LDAP_LOG);
delete m_root;
m_root = new LdapModelDNNode;
//qDebug() << "&m_root =" << &m_root;
//qCDebug(LDAP_LOG) << "&m_root =" << &m_root;
}
void LdapModel::LdapModelPrivate::createConnections()
......@@ -94,18 +94,18 @@ void LdapModel::LdapModelPrivate::createConnections()
void LdapModel::LdapModelPrivate::populateRootToBaseDN()
{
//qDebug();
//qCDebug(LDAP_LOG);
if (baseDN().isEmpty()) {
// Query the server for the base DN
//qDebug() << "Searching for the baseDN";
//qCDebug(LDAP_LOG) << "Searching for the baseDN";
setSearchType(LdapModelPrivate::NamingContexts, rootNode());
search(LdapDN(), LdapUrl::Base, QString(), QStringList() << QLatin1String("namingContexts"));
return;
}
// Start a search for the details of the baseDN object
//qDebug() << "Searching for attributes of the baseDN";
//qCDebug(LDAP_LOG) << "Searching for attributes of the baseDN";
searchResults().clear();
setSearchType(LdapModelPrivate::BaseDN, rootNode());
search(baseDN(), LdapUrl::Base, QString(), QStringList() << QLatin1String("dn") << QLatin1String("objectClass"));
......@@ -114,7 +114,7 @@ void LdapModel::LdapModelPrivate::populateRootToBaseDN()
void LdapModel::LdapModelPrivate::gotSearchResult(KLDAP::LdapSearch *search)
{
Q_UNUSED(search);
qDebug();
qCDebug(LDAP_LOG);
switch (searchType()) {
case LdapModelPrivate::NamingContexts: {
......@@ -123,7 +123,7 @@ void LdapModel::LdapModelPrivate::gotSearchResult(KLDAP::LdapSearch *search)
if (!searchResults().isEmpty() &&
searchResults().at(0).hasAttribute(QLatin1String("namingContexts"))) {
baseDN = QLatin1String(searchResults().at(0).value(QLatin1String("namingContexts")));
//qDebug() << "Found baseDN =" << baseDN;
//qCDebug(LDAP_LOG) << "Found baseDN =" << baseDN;
}
setBaseDN(LdapDN(baseDN));
......@@ -136,7 +136,7 @@ void LdapModel::LdapModelPrivate::gotSearchResult(KLDAP::LdapSearch *search)
break;
}
case LdapModelPrivate::BaseDN: {
//qDebug() << "Found details of the baseDN object."
//qCDebug(LDAP_LOG) << "Found details of the baseDN object."
// << "Creating objects down to this level.";
// Get the baseDN LdapObject
......@@ -150,7 +150,7 @@ void LdapModel::LdapModelPrivate::gotSearchResult(KLDAP::LdapSearch *search)
LdapModelDNNode *item = 0;
for (int i = 0; i < depth; ++i) {
QString dn = baseDN().toString(i);
qDebug() << "Creating item for DN :" << dn;
qCDebug(LDAP_LOG) << "Creating item for DN :" << dn;
//LdapObject obj( dn );
item = new LdapModelDNNode(parent, LdapDN(dn));
......@@ -172,7 +172,7 @@ void LdapModel::LdapModelPrivate::gotSearchResult(KLDAP::LdapSearch *search)
break;
}
case LdapModelPrivate::ChildObjects: {
//qDebug() << "Found" << searchResults().size() << "child objects";
//qCDebug(LDAP_LOG) << "Found" << searchResults().size() << "child objects";
if (searchResults().size() != 0) {
// Create an index for the soon-to-be-a-parent item
......@@ -205,8 +205,8 @@ void LdapModel::LdapModelPrivate::gotSearchData(KLDAP::LdapSearch *search,
const KLDAP::LdapObject &obj)
{
Q_UNUSED(search);
//qDebug();
//qDebug() << "Object:";
//qDebug() << obj.toString();
//qCDebug(LDAP_LOG);
//qCDebug(LDAP_LOG) << "Object:";
//qCDebug(LDAP_LOG) << obj.toString();
searchResults().append(obj);
}
......@@ -20,7 +20,7 @@
#include "ldapmodelnode_p.h"
#include <qdebug.h>
#include "ldap_debug.h"
using namespace KLDAP;
......@@ -61,7 +61,7 @@ LdapModelDNNode::LdapModelDNNode(LdapModelDNNode *parent,
m_childItems(),
m_dn(dn)
{
qDebug() << "Creating DN =" << m_dn.toString();
qCDebug(LDAP_LOG) << "Creating DN =" << m_dn.toString();
}
LdapModelDNNode::~LdapModelDNNode()
......@@ -123,7 +123,7 @@ LdapModelAttrNode::LdapModelAttrNode(LdapModelDNNode *parent,
m_attrName(attrName),
m_attrData(attrData)
{
qDebug() << "Creating Name =" << m_attrName << " Data =" << m_attrData;
qCDebug(LDAP_LOG) << "Creating Name =" << m_attrName << " Data =" << m_attrData;
}
LdapModelAttrNode::~LdapModelAttrNode()
......
......@@ -21,7 +21,7 @@
#include "ldapoperation.h"
#include "kldap_config.h"
#include <qdebug.h>
#include "ldap_debug.h"
#include <QtCore/QTime>
......@@ -213,19 +213,19 @@ static int kldap_sasl_interact(sasl_interact_t *interact, LdapOperation::SASL_Da
switch (interact->id) {
case SASL_CB_GETREALM:
value = data->creds.realm;
qDebug() << "SASL_REALM=" << value;
qCDebug(LDAP_LOG) << "SASL_REALM=" << value;
break;
case SASL_CB_AUTHNAME:
value = data->creds.authname;
qDebug() << "SASL_AUTHNAME=" << value;
qCDebug(LDAP_LOG) << "SASL_AUTHNAME=" << value;
break;
case SASL_CB_PASS:
value = data->creds.password;
qDebug() << "SASL_PASSWD=[hidden]";
qCDebug(LDAP_LOG) << "SASL_PASSWD=[hidden]";
break;
case SASL_CB_USER:
value = data->creds.authzid;
qDebug() << "SASL_AUTHZID=" << value;
qCDebug(LDAP_LOG) << "SASL_AUTHZID=" << value;
break;
}
if (value.isEmpty()) {
......@@ -288,7 +288,7 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
return KLDAP_SASL_ERROR;
}
}
qDebug() << "sasl_client_start mech: "
qCDebug(LDAP_LOG) << "sasl_client_start mech: "
<< mechusing << " outlen " << outlen
<< " result: " << saslresult;
} while (saslresult == SASL_INTERACT);
......@@ -297,7 +297,7 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
}
} else {
qDebug() << "sasl_client_step";
qCDebug(LDAP_LOG) << "sasl_client_step";
do {
saslresult = sasl_client_step(saslconn, sdata.data(), sdata.size(),
&client_interact, &out, &outlen);
......@@ -307,7 +307,7 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
}
}
} while (saslresult == SASL_INTERACT);
qDebug() << "sasl_client_step result" << saslresult;
qCDebug(LDAP_LOG) << "sasl_client_step result" << saslresult;
if (saslresult != SASL_CONTINUE && saslresult != SASL_OK) {
return KLDAP_SASL_ERROR;
}
......@@ -317,7 +317,7 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
ccred.bv_len = outlen;
if (async) {
qDebug() << "ldap_sasl_bind";
qCDebug(LDAP_LOG) << "ldap_sasl_bind";
int msgid;
ret =
ldap_sasl_bind(ld, server.bindDn().toUtf8().data(), mech.toLatin1(),
......@@ -325,13 +325,13 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
if (ret == 0) {
ret = msgid;
}
qDebug() << "ldap_sasl_bind msgid" << ret;
qCDebug(LDAP_LOG) << "ldap_sasl_bind msgid" << ret;
} else {
qDebug() << "ldap_sasl_bind_s";
qCDebug(LDAP_LOG) << "ldap_sasl_bind_s";
ret =
ldap_sasl_bind_s(ld, server.bindDn().toUtf8().data(), mech.toLatin1(),
&ccred, 0, 0, &scred);
qDebug() << "ldap_sasl_bind_s ret" << ret;
qCDebug(LDAP_LOG) << "ldap_sasl_bind_s ret" << ret;
if (scred) {
sdata = QByteArray(scred->bv_val, scred->bv_len);
} else {
......@@ -353,10 +353,10 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
}
ccred.bv_val = pass.data();
ccred.bv_len = pass.size();
qDebug() << "binding to server, bindname: " << bindname << " password: *****";
qCDebug(LDAP_LOG) << "binding to server, bindname: " << bindname << " password: *****";
if (async) {
qDebug() << "ldap_sasl_bind (simple)";
qCDebug(LDAP_LOG) << "ldap_sasl_bind (simple)";
#ifndef HAVE_WINLDAP_H
int msgid = 0;
ret = ldap_sasl_bind(ld, bindname.data(), 0, &ccred, 0, 0, &msgid);
......@@ -367,7 +367,7 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
ret = ldap_simple_bind(ld, bindname.data(), pass.data());
#endif
} else {
qDebug() << "ldap_sasl_bind_s (simple)";
qCDebug(LDAP_LOG) << "ldap_sasl_bind_s (simple)";
#ifndef HAVE_WINLDAP_H
ret = ldap_sasl_bind_s(ld, bindname.data(), 0, &ccred, 0, 0, 0);
#else
......@@ -380,14 +380,14 @@ int LdapOperation::LdapOperationPrivate::bind(const QByteArray &creds,
int LdapOperation::LdapOperationPrivate::processResult(int rescode, LDAPMessage *msg)
{
//qDebug();
//qCDebug(LDAP_LOG);
int retval;
LDAP *ld = (LDAP *) mConnection->handle();
qDebug() << "rescode: " << rescode;
qCDebug(LDAP_LOG) << "rescode: " << rescode;
switch (rescode) {
case RES_SEARCH_ENTRY: {
//qDebug() << "Found search entry";
//qCDebug(LDAP_LOG) << "Found search entry";
mObject.clear();
LdapAttrMap attrs;
char *name;
......@@ -449,11 +449,11 @@ int LdapOperation::LdapOperationPrivate::processResult(int rescode, LDAPMessage
retval = KLDAP_SUCCESS;
#endif
if (retval != KLDAP_SUCCESS && retval != KLDAP_SASL_BIND_IN_PROGRESS) {
qDebug() << "RES_BIND error: " << retval;
qCDebug(LDAP_LOG) << "RES_BIND error: " << retval;
ldap_msgfree(msg);
return -1;
}
qDebug() << "RES_BIND rescode" << rescode << "retval:" << retval;
qCDebug(LDAP_LOG) << "RES_BIND rescode" << rescode << "retval:" << retval;
if (servercred) {
mServerCred = QByteArray(servercred->bv_val, servercred->bv_len);
ber_bvfree(servercred);
......@@ -470,7 +470,7 @@ int LdapOperation::LdapOperationPrivate::processResult(int rescode, LDAPMessage
retval =
ldap_parse_result(ld, msg, &errcodep, &matcheddn, &errmsg, &referralsp,
&serverctrls, 0);
qDebug() << "rescode" << rescode << "retval:" << retval
qCDebug(LDAP_LOG) << "rescode" << rescode << "retval:" << retval
<< "matcheddn:" << matcheddn << "errcode:"
<< errcodep << "errmsg:" << errmsg;
if (retval != KLDAP_SUCCESS) {
......@@ -511,7 +511,7 @@ int LdapOperation::LdapOperationPrivate::processResult(int rescode, LDAPMessage
static void addModOp(LDAPMod ***pmods, int mod_type, const QString &attr,
const QByteArray *value = 0)
{
// qDebug() << "type:" << mod_type << "attr:" << attr <<
// qCDebug(LDAP_LOG) << "type:" << mod_type << "attr:" << attr <<
// "value:" << QString::fromUtf8(value,value.size()) <<
// "size:" << value.size();
LDAPMod **mods;
......@@ -571,7 +571,7 @@ static void addModOp(LDAPMod ***pmods, int mod_type, const QString &attr,
(BerValue **) malloc(sizeof(BerValue *) * 2);
mods[ i ]->mod_vals.modv_bvals[ 0 ] = berval;
mods[ i ]->mod_vals.modv_bvals[ 1 ] = 0;
// qDebug() << "new bervalue struct" << attr << value;
// qCDebug(LDAP_LOG) << "new bervalue struct" << attr << value;
} else {
uint j = 0;
while (mods[ i ]->mod_vals.modv_bvals[ j ] != 0) {
......@@ -587,7 +587,7 @@ static void addModOp(LDAPMod ***pmods, int mod_type, const QString &attr,
}
mods[ i ]->mod_vals.modv_bvals[ j ] = berval;
mods[ i ]->mod_vals.modv_bvals[ j + 1 ] = 0;
qDebug() << j << ". new bervalue";
qCDebug(LDAP_LOG) << j << ". new bervalue";
}
}
......@@ -599,7 +599,7 @@ static void addControlOp(LDAPControl ***pctrls, const QString &oid,
ctrls = *pctrls;
qDebug() << "oid:'" << oid << "' val: '" << value << "'";
qCDebug(LDAP_LOG) << "oid:'" << oid << "' val: '" << value << "'";
int vallen = value.size();
ctrl->ldctl_value.bv_len = vallen;
if (vallen) {
......@@ -698,7 +698,7 @@ int LdapOperation::search(const LdapDN &base, LdapUrl::Scope scope,
break;
}
qDebug() << "asyncSearch() base=\"" << base.toString()
qCDebug(LDAP_LOG) << "asyncSearch() base=\"" << base.toString()
<< "\" scope=" << (int)scope
<< "filter=\"" << filter