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 a8a85765 authored by Luigi Toscano's avatar Luigi Toscano

Port the Jabber directory to categorized logging

Use a specific logging category, trying to use the same naming
used in the port of the original code for Jabber (taken from Kopete).
parent eb8386fb
......@@ -98,6 +98,11 @@ ecm_qt_declare_logging_category(ksirk_SRCS
IDENTIFIER KSIRK_LOG
CATEGORY_NAME org.kde.ksirk)
ecm_qt_declare_logging_category(ksirk_SRCS
HEADER jabber_protocol_debug.h
IDENTIFIER JABBER_PROTOCOL_LOG
CATEGORY_NAME org.kde.ksirk.jabber)
set(ksirk_UI
Dialogs/qplayersetupdialog.ui
Dialogs/newGameDialog.ui
......
This diff is collapsed.
......@@ -16,7 +16,6 @@
* *************************************************************************
*/
#include <kdebug.h>
#include <KLocalizedString>
#include <kiconloader.h>
#include <kstandarddirs.h>
......@@ -91,7 +90,7 @@ bool JabberBaseContact::isReachable ()
void JabberBaseContact::updateContact ( const XMPP::RosterItem & item )
{
kDebug ( JABBER_DEBUG_GLOBAL ) << "Synchronizing local copy of " << contactId() << " with information received from server. (name='" << item.name() << "' groups='" << item.groups() << "')";
qCDebug(JABBER_PROTOCOL_LOG) << "Synchronizing local copy of " << contactId() << " with information received from server. (name='" << item.name() << "' groups='" << item.groups() << "')";
mRosterItem = item;
......@@ -114,7 +113,7 @@ void JabberBaseContact::updateContact ( const XMPP::RosterItem & item )
if ( !item.name().isEmpty () && item.name() != item.jid().bare()
&& metaContact()->customDisplayName() != item.name () )
{
kDebug ( JABBER_DEBUG_GLOBAL ) << "setting display name of " << contactId () << " to " << item.name();
qCDebug(JABBER_PROTOCOL_LOG) << "setting display name of " << contactId () << " to " << item.name();
metaContact()->setDisplayName ( item.name () );
}
}
......@@ -196,13 +195,13 @@ void JabberBaseContact::updateContact ( const XMPP::RosterItem & item )
foreach ( Kopete::Group *group, groupsToRemoveFrom )
{
kDebug ( JABBER_DEBUG_GLOBAL ) << "Removing " << contactId() << " from group " << group->displayName ();
qCDebug(JABBER_PROTOCOL_LOG) << "Removing " << contactId() << " from group " << group->displayName ();
metaContact()->removeFromGroup ( group );
}
foreach ( Kopete::Group *group, groupsToAddTo )
{
kDebug ( JABBER_DEBUG_GLOBAL ) << "Adding " << contactId() << " to group " << group->displayName ();
qCDebug(JABBER_PROTOCOL_LOG) << "Adding " << contactId() << " to group " << group->displayName ();
metaContact()->addToGroup ( group );
}
}
......@@ -293,7 +292,7 @@ void JabberBaseContact::updateResourceList ()
void JabberBaseContact::reevaluateStatus ()
{
kDebug (JABBER_DEBUG_GLOBAL) << "Determining new status for " << contactId ();
qCDebug(JABBER_PROTOCOL_LOG) << "Determining new status for " << contactId ();
Kopete::OnlineStatus status;
XMPP::Resource resource = account()->resourcePool()->bestResource ( mRosterItem.jid () );
......@@ -316,7 +315,7 @@ void JabberBaseContact::reevaluateStatus ()
updateResourceList ();
kDebug (JABBER_DEBUG_GLOBAL) << "New status for " << contactId () << " is " << status.description ();
qCDebug(JABBER_PROTOCOL_LOG) << "New status for " << contactId () << " is " << status.description ();
setOnlineStatus ( status );
/*
......@@ -398,7 +397,7 @@ void JabberBaseContact::slotUserInfo( )
void JabberBaseContact::setPropertiesFromVCard ( const XMPP::VCard &vCard )
{
kDebug ( JABBER_DEBUG_GLOBAL ) << "Updating vCard for " << contactId ();
qCDebug(JABBER_PROTOCOL_LOG) << "Updating vCard for " << contactId ();
// update vCard cache timestamp if this is not a temporary contact
if ( metaContact() && !metaContact()->isTemporary () )
......@@ -626,7 +625,7 @@ void JabberBaseContact::setPropertiesFromVCard ( const XMPP::VCard &vCard )
// photo() is a QByteArray
if ( !vCard.photo().isEmpty() )
{
kDebug( JABBER_DEBUG_GLOBAL ) << "Contact has a photo embedded into his vCard.";
qCDebug(JABBER_PROTOCOL_LOG) << "Contact has a photo embedded into his vCard.";
// QImage is used to save to disk in PNG later.
contactPhoto = QImage::fromData( vCard.photo() );
......@@ -644,7 +643,7 @@ void JabberBaseContact::setPropertiesFromVCard ( const XMPP::VCard &vCard )
}
kDebug( JABBER_DEBUG_GLOBAL ) << "Contact photo is a URI.";
qCDebug(JABBER_PROTOCOL_LOG) << "Contact photo is a URI.";
contactPhoto = QImage( tempPhotoPath );
......@@ -662,7 +661,7 @@ void JabberBaseContact::setPropertiesFromVCard ( const XMPP::VCard &vCard )
// Save the image to the disk, then set the property.
if(!entry.path.isNull())
{
kDebug( JABBER_DEBUG_GLOBAL ) << "Setting photo for contact: " << contactId();
qCDebug(JABBER_PROTOCOL_LOG) << "Setting photo for contact: " << contactId();
setProperty( protocol()->propPhoto, entry.path );
}
......
......@@ -19,7 +19,6 @@
#include <kopetecontact.h>
#include <kdebug.h>
#include <QAction>
#include <kselectaction.h>
#include <KLocalizedString>
......
......@@ -18,15 +18,15 @@
***************************************************************************/
#include <qobject.h>
#include <kdebug.h>
#include <ksocketfactory.h>
#include "jabber_protocol_debug.h"
#include "jabberbytestream.h"
// #include "jabberprotocol.h"
JabberByteStream::JabberByteStream ( QObject *parent )
: ByteStream ( parent )
{
kDebug ( ) << "Instantiating new Jabber byte stream.";
qCDebug(JABBER_PROTOCOL_LOG) << "Instantiating new Jabber byte stream.";
// reset close tracking flag
mClosing = false;
......@@ -36,7 +36,7 @@ JabberByteStream::JabberByteStream ( QObject *parent )
void JabberByteStream::connect ( QString host, int port )
{
kDebug ( ) << k_funcinfo << "Connecting to " << host << ", port " << port << endl;
qCDebug(JABBER_PROTOCOL_LOG) << Q_FUNC_INFO << "Connecting to " << host << ", port " << port << endl;
mClosing = false;
......@@ -59,14 +59,14 @@ bool JabberByteStream::isOpen () const
void JabberByteStream::close ()
{
kDebug ( ) << "Closing stream.";
qCDebug(JABBER_PROTOCOL_LOG) << "Closing stream.";
// close the socket and set flag that we are closing it ourselves
mClosing = true;
if (mSocket) {
kDebug ( ) << k_funcinfo << "socket is not null" << endl;
qCDebug(JABBER_PROTOCOL_LOG) << Q_FUNC_INFO << "socket is not null" << endl;
mSocket->close();
kDebug ( ) << k_funcinfo << "socket closed" << endl;
qCDebug(JABBER_PROTOCOL_LOG) << Q_FUNC_INFO << "socket closed" << endl;
delete mSocket;
mSocket=NULL;
}
......@@ -106,7 +106,7 @@ void JabberByteStream::slotConnected ()
void JabberByteStream::slotConnectionClosed ()
{
kDebug ( ) << "Socket has been closed.";
qCDebug(JABBER_PROTOCOL_LOG) << "Socket has been closed.";
// depending on who closed the socket, emit different signals
if ( !mClosing )
......@@ -124,7 +124,7 @@ void JabberByteStream::slotConnectionClosed ()
void JabberByteStream::slotReadyRead ()
{
kDebug ( ) << "called: available: " << socket()->bytesAvailable ();
qCDebug(JABBER_PROTOCOL_LOG) << "called: available: " << socket()->bytesAvailable ();
appendRead ( socket()->readAll() );
emit readyRead ();
......@@ -140,7 +140,7 @@ void JabberByteStream::slotBytesWritten ( qint64 bytes )
void JabberByteStream::slotError ( QAbstractSocket::SocketError code )
{
kDebug ( ) << "Socket error '" << mSocket->errorString() << "' - Code : " << code;
qCDebug(JABBER_PROTOCOL_LOG) << "Socket error '" << mSocket->errorString() << "' - Code : " << code;
emit error ( code );
}
......
......@@ -19,6 +19,7 @@
*************************************************************************
*/
#include "jabbercapabilitiesmanager.h"
#include "jabber_protocol_debug.h"
#include <qstring.h>
#include <qstringlist.h>
......@@ -28,7 +29,6 @@
#include <qtextstream.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include <xmpp_tasks.h>
......@@ -171,7 +171,7 @@ void JabberCapabilitiesManager::CapabilitiesInformation::addJid(const Jid& jid,
void JabberCapabilitiesManager::CapabilitiesInformation::removeJid(const Jid& jid)
{
kDebug(JABBER_DEBUG_GLOBAL) << "Unregistering " << QString(jid.full()).replace('%',"%%");
qCDebug(JABBER_PROTOCOL_LOG) << "Unregistering " << QString(jid.full()).replace('%',"%%");
JidList::Iterator it = m_jids.begin();
while( it != m_jids.end() )
......@@ -189,7 +189,7 @@ void JabberCapabilitiesManager::CapabilitiesInformation::removeJid(const Jid& ji
QPair<Jid,JabberAccount*> JabberCapabilitiesManager::CapabilitiesInformation::nextJid(const Jid& jid, const Task* t)
{
kDebug(JABBER_DEBUG_GLOBAL) << "Looking for next JID";
qCDebug(JABBER_PROTOCOL_LOG) << "Looking for next JID";
JidList::ConstIterator it = m_jids.constBegin(), itEnd = m_jids.constEnd();
for( ; it != itEnd; ++it)
......@@ -199,14 +199,14 @@ QPair<Jid,JabberAccount*> JabberCapabilitiesManager::CapabilitiesInformation::ne
it++;
if (it == itEnd)
{
kDebug(JABBER_DEBUG_GLOBAL) << "No more JIDs";
qCDebug(JABBER_PROTOCOL_LOG) << "No more JIDs";
return QPair<Jid,JabberAccount*>(Jid(),0L);
}
else if( (*it).second->isConnected() )
{
//qDebug("caps.cpp: Account isn't active");
kDebug(JABBER_DEBUG_GLOBAL) << "Account isn't connected.";
qCDebug(JABBER_PROTOCOL_LOG) << "Account isn't connected.";
return QPair<Jid,JabberAccount*>( (*it).first,(*it).second );
}
......@@ -270,7 +270,7 @@ void JabberCapabilitiesManager::CapabilitiesInformation::fromXml(const QDomEleme
{
if( element.tagName() != "info")
{
kDebug(JABBER_DEBUG_GLOBAL) << "Invalid info element";
qCDebug(JABBER_PROTOCOL_LOG) << "Invalid info element";
return;
}
......@@ -282,7 +282,7 @@ void JabberCapabilitiesManager::CapabilitiesInformation::fromXml(const QDomEleme
QDomElement infoElement = node.toElement();
if( infoElement.isNull() )
{
kDebug(JABBER_DEBUG_GLOBAL) << "Null element";
qCDebug(JABBER_PROTOCOL_LOG) << "Null element";
continue;
}
......@@ -300,7 +300,7 @@ void JabberCapabilitiesManager::CapabilitiesInformation::fromXml(const QDomEleme
}
else
{
kDebug(JABBER_DEBUG_GLOBAL) << "Unknown element";
qCDebug(JABBER_PROTOCOL_LOG) << "Unknown element";
}
m_discovered = true;
......@@ -335,7 +335,7 @@ JabberCapabilitiesManager::~JabberCapabilitiesManager()
void JabberCapabilitiesManager::removeAccount(JabberAccount *account)
{
kDebug(JABBER_DEBUG_GLOBAL) << "Removing account " << account->accountId();
qCDebug(JABBER_PROTOCOL_LOG) << "Removing account " << account->accountId();
QList<CapabilitiesInformation> info = d->capabilitiesInformationMap.values();
......@@ -394,7 +394,7 @@ void JabberCapabilitiesManager::updateCapabilities(JabberAccount *account, const
{
if( !d->capabilitiesInformationMap[*newCapsIt].discovered() && d->capabilitiesInformationMap[*newCapsIt].pendingRequests() == 0 )
{
kDebug(JABBER_DEBUG_GLOBAL) << QString("Sending disco request to %1, node=%2").arg(QString(jid.full()).replace('%',"%%")).arg(node + '#' + (*newCapsIt).extensions());
qCDebug(JABBER_PROTOCOL_LOG) << QString("Sending disco request to %1, node=%2").arg(QString(jid.full()).replace('%',"%%")).arg(node + '#' + (*newCapsIt).extensions());
d->capabilitiesInformationMap[*newCapsIt].setPendingRequests(1);
requestDiscoInfo(account, jid, node + '#' + (*newCapsIt).extensions());
......@@ -404,7 +404,7 @@ void JabberCapabilitiesManager::updateCapabilities(JabberAccount *account, const
else
{
// Remove all caps specifications
kDebug(JABBER_DEBUG_GLOBAL) << QString("Illegal caps info from %1: node=%2, ver=%3").arg(QString(jid.full()).replace('%',"%%")).arg(node).arg(version);
qCDebug(JABBER_PROTOCOL_LOG) << QString("Illegal caps info from %1: node=%2, ver=%3").arg(QString(jid.full()).replace('%',"%%")).arg(node).arg(version);
d->jidCapabilitiesMap.remove( jid.full() );
}
......@@ -442,7 +442,7 @@ void JabberCapabilitiesManager::discoRequestFinished()
DiscoItem item = discoInfo->item();
Jid jid = discoInfo->jid();
kDebug(JABBER_DEBUG_GLOBAL) << QString("Disco response from %1, node=%2, success=%3").arg(QString(jid.full()).replace('%',"%%")).arg(discoInfo->node()).arg(discoInfo->success());
qCDebug(JABBER_PROTOCOL_LOG) << QString("Disco response from %1, node=%2, success=%3").arg(QString(jid.full()).replace('%',"%%")).arg(discoInfo->node()).arg(discoInfo->success());
const QString &tokens = discoInfo->node();
int idx = tokens.lastIndexOf('#');
......@@ -472,7 +472,7 @@ void JabberCapabilitiesManager::discoRequestFinished()
// Notify affected jids.
QStringList jids = d->capabilitiesInformationMap[capabilities].jids();
kDebug(JABBER_DEBUG_GLOBAL) << "notify affected jids";
qCDebug(JABBER_PROTOCOL_LOG) << "notify affected jids";
foreach( QString jid , jids )
{
emit capabilitiesChanged(jid);
......@@ -483,18 +483,18 @@ void JabberCapabilitiesManager::discoRequestFinished()
QPair<Jid,JabberAccount*> jidAccountPair = d->capabilitiesInformationMap[capabilities].nextJid(jid,discoInfo->parent());
if( jidAccountPair.second )
{
kDebug(JABBER_DEBUG_GLOBAL) << QString("Falling back on %1.").arg(QString(jidAccountPair.first.full()).replace('%',"%%"));
qCDebug(JABBER_PROTOCOL_LOG) << QString("Falling back on %1.").arg(QString(jidAccountPair.first.full()).replace('%',"%%"));
requestDiscoInfo( jidAccountPair.second, jidAccountPair.first, discoInfo->node() );
}
else
{
kDebug(JABBER_DEBUG_GLOBAL) << "No valid disco request avalable.";
qCDebug(JABBER_PROTOCOL_LOG) << "No valid disco request avalable.";
d->capabilitiesInformationMap[capabilities].setPendingRequests(0);
}
}
}
else
kDebug(JABBER_DEBUG_GLOBAL) << QString("Current client node '%1' does not match response '%2'").arg(jidCapabilities.node()).arg(node);
qCDebug(JABBER_PROTOCOL_LOG) << QString("Current client node '%1' does not match response '%2'").arg(jidCapabilities.node()).arg(node);
//for (unsigned int i = 0; i < item.features().list().count(); i++)
// printf(" Feature: %s\n",item.features().list()[i].toLatin1());
......@@ -517,12 +517,12 @@ void JabberCapabilitiesManager::loadCachedInformation()
QFile cacheFile(capsFileName);
if( !cacheFile.open(QIODevice::ReadOnly) )
{
kDebug(JABBER_DEBUG_GLOBAL) << "Could not open the Capabilities cache from disk.";
qCDebug(JABBER_PROTOCOL_LOG) << "Could not open the Capabilities cache from disk.";
return;
}
if( !doc.setContent(&cacheFile) )
{
kDebug(JABBER_DEBUG_GLOBAL) << "Could not set the Capabilities cache from file.";
qCDebug(JABBER_PROTOCOL_LOG) << "Could not set the Capabilities cache from file.";
return;
}
cacheFile.close();
......@@ -530,7 +530,7 @@ void JabberCapabilitiesManager::loadCachedInformation()
QDomElement caps = doc.documentElement();
if( caps.tagName() != "capabilities" )
{
kDebug(JABBER_DEBUG_GLOBAL) << "Invalid capabilities element.";
qCDebug(JABBER_PROTOCOL_LOG) << "Invalid capabilities element.";
return;
}
......@@ -540,7 +540,7 @@ void JabberCapabilitiesManager::loadCachedInformation()
QDomElement element = node.toElement();
if( element.isNull() )
{
kDebug(JABBER_DEBUG_GLOBAL) << "Found a null element.";
qCDebug(JABBER_PROTOCOL_LOG) << "Found a null element.";
continue;
}
......@@ -553,7 +553,7 @@ void JabberCapabilitiesManager::loadCachedInformation()
}
else
{
kDebug(JABBER_DEBUG_GLOBAL) << "Unknow element";
qCDebug(JABBER_PROTOCOL_LOG) << "Unknow element";
}
}
}
......@@ -639,7 +639,7 @@ void JabberCapabilitiesManager::saveInformation()
QFile capsFile(capsFileName);
if( !capsFile.open(QIODevice::WriteOnly) )
{
kDebug(JABBER_DEBUG_GLOBAL ) << "Error while opening Capabilities cache file.";
qCDebug(JABBER_PROTOCOL_LOG) << "Error while opening Capabilities cache file.";
return;
}
......
......@@ -21,13 +21,12 @@
***************************************************************************/
#include "jabberclient.h"
#include "jabber_protocol_debug.h"
#include <QTimer>
#include <QRegExp>
#include <QtCrypto>
#include <KDebug>
#include <bsocket.h>
#include <filetransfer.h>
#include <xmpp_tasks.h>
......@@ -620,7 +619,7 @@ JabberClient::ErrorCode JabberClient::connect ( const XMPP::Jid &jid, const QStr
*/
if ( ( forceTLS () || useSSL () || probeSSL () ) && !QCA::isSupported ("tls" ) )
{
kDebug() << "no TLS";
qCDebug(JABBER_PROTOCOL_LOG) << "no TLS";
return NoTLS;
}
......@@ -652,7 +651,7 @@ JabberClient::ErrorCode JabberClient::connect ( const XMPP::Jid &jid, const QStr
*/
if ( QCA::isSupported ("tls") )
{
kDebug() << "QCA tls";
qCDebug(JABBER_PROTOCOL_LOG) << "QCA tls";
if (d->jabberTLS == 0)
d->jabberTLS = new QCA::TLS;
d->jabberTLS->setTrustedCertificates(QCA::systemStore());
......@@ -702,7 +701,7 @@ JabberClient::ErrorCode JabberClient::connect ( const XMPP::Jid &jid, const QStr
/*
* Setup client layer.
*/
kDebug() << "Setup client layer";
qCDebug(JABBER_PROTOCOL_LOG) << "Setup client layer";
if (d->jabberClient != 0)
delete d->jabberClient;
d->jabberClient = new XMPP::Client ( this );
......@@ -733,10 +732,10 @@ JabberClient::ErrorCode JabberClient::connect ( const XMPP::Jid &jid, const QStr
*/
{
using namespace XMPP;
kDebug() << "Connecting subscription";
qCDebug(JABBER_PROTOCOL_LOG) << "Connecting subscription";
QObject::connect ( d->jabberClient, SIGNAL (subscription(Jid,QString,QString)),
this, SLOT (slotSubscription(Jid,QString)) );
kDebug() << "Connecting rosterRequestFinished";
qCDebug(JABBER_PROTOCOL_LOG) << "Connecting rosterRequestFinished";
QObject::connect ( d->jabberClient, SIGNAL (rosterRequestFinished(bool,int,QString)),
this, SLOT (slotRosterRequestFinished(bool,int,QString)) );
QObject::connect ( d->jabberClient, SIGNAL (rosterItemAdded(RosterItem)),
......@@ -780,7 +779,7 @@ JabberClient::ErrorCode JabberClient::connect ( const XMPP::Jid &jid, const QStr
d->jabberClient->setTimeZone ( timeZoneName (), timeZoneOffset () );
kDebug() << "connect to server" << jid.domain() << jid.node() << jid.resource() << jid.bare() << jid.full() << auth;
qCDebug(JABBER_PROTOCOL_LOG) << "connect to server" << jid.domain() << jid.node() << jid.resource() << jid.bare() << jid.full() << auth;
d->jabberClient->connectToServer ( d->jabberClientStream, jid, auth );
return Ok;
......@@ -986,7 +985,7 @@ void JabberClient::slotCSNeedAuthParams ( bool user, bool pass, bool realm )
void JabberClient::slotCSAuthenticated ()
{
kDebug();
qCDebug(JABBER_PROTOCOL_LOG);
emit debugMessage ( "Connected to Jabber server." );
/*
......
......@@ -17,7 +17,7 @@
* *
***************************************************************************/
#include <kdebug.h>
#include "jabber_protocol_debug.h"
#include "jabberconnector.h"
#include "jabberbytestream.h"
// #include "jabberprotocol.h"
......@@ -25,7 +25,7 @@
JabberConnector::JabberConnector ( QObject *parent )
: XMPP::Connector ( parent )
{
kDebug() << "New Jabber connector.";
qCDebug(JABBER_PROTOCOL_LOG) << "New Jabber connector.";
mErrorCode = 0;
......@@ -45,7 +45,7 @@ JabberConnector::~JabberConnector ()
void JabberConnector::connectToServer ( const QString &server )
{
kDebug() << "Initiating connection to " << server;
qCDebug(JABBER_PROTOCOL_LOG) << "Initiating connection to " << server;
/*
* FIXME: we should use a SRV lookup to determine the
......@@ -56,14 +56,14 @@ void JabberConnector::connectToServer ( const QString &server )
mErrorCode = 0;
kDebug() << mHost << mPort;
qCDebug(JABBER_PROTOCOL_LOG) << mHost << mPort;
mByteStream->connect ( mHost, mPort );
}
void JabberConnector::slotConnected ()
{
kDebug() << "We are connected.";
qCDebug(JABBER_PROTOCOL_LOG) << "We are connected.";
// FIXME: setPeerAddress() is something different, find out correct usage later
//KInetSocketAddress inetAddress = mStreamSocket->address().asInet().makeIPv6 ();
......@@ -75,7 +75,7 @@ void JabberConnector::slotConnected ()
void JabberConnector::slotError ( int code )
{
kDebug() << "Error detected: " << code;
qCDebug(JABBER_PROTOCOL_LOG) << "Error detected: " << code;
mErrorCode = code;
emit error ();
......@@ -105,7 +105,7 @@ void JabberConnector::done ()
void JabberConnector::setOptHostPort ( const QString &host, quint16 port )
{
kDebug() << "Manually specifying host " << host << " and port " << port;
qCDebug(JABBER_PROTOCOL_LOG) << "Manually specifying host " << host << " and port " << port;
mHost = host;
mPort = port;
......@@ -114,7 +114,7 @@ void JabberConnector::setOptHostPort ( const QString &host, quint16 port )
void JabberConnector::setOptSSL ( bool ssl )
{
kDebug() << "Setting SSL to " << ssl;
qCDebug(JABBER_PROTOCOL_LOG) << "Setting SSL to " << ssl;
setUseSSL ( ssl );
......
This diff is collapsed.
......@@ -17,8 +17,8 @@
*/
#include "jabbercontactpool.h"
#include "jabber_protocol_debug.h"
#include <kdebug.h>
#include <kmessagebox.h>
#include <kopeteaccountmanager.h>
#include <kopetecontactlist.h>
......@@ -68,7 +68,7 @@ JabberContact *JabberContactPool::addContact ( const XMPP::RosterItem &contact,
JabberContactPoolItem *mContactItem = findPoolItem ( contact );
if ( mContactItem)
{
kDebug(JABBER_DEBUG_GLOBAL) << "Updating existing contact " << contact.jid().full() << " - " << mContactItem->contact();
qCDebug(JABBER_PROTOCOL_LOG) << "Updating existing contact " << contact.jid().full() << " - " << mContactItem->contact();
// It exists, update it.
mContactItem->contact()->updateContact ( contact );
......@@ -87,7 +87,7 @@ JabberContact *JabberContactPool::addContact ( const XMPP::RosterItem &contact,
return retval;
}
kDebug(JABBER_DEBUG_GLOBAL) << "Adding new contact " << contact.jid().full();
qCDebug(JABBER_PROTOCOL_LOG) << "Adding new contact " << contact.jid().full();
JabberTransport *transport=0l;
QString legacyId;
......@@ -122,7 +122,7 @@ JabberBaseContact *JabberContactPool::addGroupContact ( const XMPP::RosterItem &
(const char*)("JabberGroupContact") : (const char*)("JabberGroupMemberContact") ) )
{
kDebug(JABBER_DEBUG_GLOBAL) << "Updating existing contact " << mContact.jid().full();
qCDebug(JABBER_PROTOCOL_LOG) << "Updating existing contact " << mContact.jid().full();
// It exists, update it.
mContactItem->contact()->updateContact ( mContact );
......@@ -135,7 +135,7 @@ JabberBaseContact *JabberContactPool::addGroupContact ( const XMPP::RosterItem &
{
//this happen if we receive a MUC invitaiton: when the invitaiton is received, it's from the muc itself
//and then kopete will create a temporary contact for it. but it will not be a good contact.
kDebug(JABBER_DEBUG_GLOBAL) << "Bad contact will be removed and re-added " << mContact.jid().full();
qCDebug(JABBER_PROTOCOL_LOG) << "Bad contact will be removed and re-added " << mContact.jid().full();
Kopete::MetaContact *old_mc=mContactItem->contact()->metaContact();
delete mContactItem->contact();
mContactItem = 0L;
......@@ -148,7 +148,7 @@ JabberBaseContact *JabberContactPool::addGroupContact ( const XMPP::RosterItem &
}
kDebug(JABBER_DEBUG_GLOBAL) << "Adding new contact " << mContact.jid().full();
qCDebug(JABBER_PROTOCOL_LOG) << "Adding new contact " << mContact.jid().full();
// create new contact instance and add it to the dictionary
JabberBaseContact *newContact;
......@@ -171,7 +171,7 @@ JabberBaseContact *JabberContactPool::addGroupContact ( const XMPP::RosterItem &
void JabberContactPool::removeContact ( const XMPP::Jid &jid )
{
kDebug(JABBER_DEBUG_GLOBAL) << "Removing contact " << jid.full();
qCDebug(JABBER_PROTOCOL_LOG) << "Removing contact " << jid.full();
foreach(JabberContactPoolItem *mContactItem, mPool)
{
......@@ -194,13 +194,13 @@ void JabberContactPool::removeContact ( const XMPP::Jid &jid )
}
}
kDebug(JABBER_DEBUG_GLOBAL) << "WARNING: No match found!";
qCDebug(JABBER_PROTOCOL_LOG) << "WARNING: No match found!";
}
void JabberContactPool::slotContactDestroyed ( Kopete::Contact *contact )
{
kDebug(JABBER_DEBUG_GLOBAL) << "Contact deleted, collecting the pieces...";
qCDebug(JABBER_PROTOCOL_LOG) << "Contact deleted, collecting the pieces...";
JabberBaseContact *jabberContact = static_cast<JabberBaseContact *>( contact );
//WARNING this ptr is not usable, we are in the Kopete::Contact destructor
......@@ -231,7 +231,7 @@ void JabberContactPool::slotContactDestroyed ( Kopete::Contact *contact )
void JabberContactPool::clear ()
{
kDebug(JABBER_DEBUG_GLOBAL) << "Clearing the contact pool.";
qCDebug(JABBER_PROTOCOL_LOG) << "Clearing the contact pool.";
foreach(JabberContactPoolItem *mContactItem, mPool)
{
......@@ -247,7 +247,7 @@ void JabberContactPool::clear ()
void JabberContactPool::setDirty ( const XMPP::Jid &jid, bool dirty )
{
kDebug(JABBER_DEBUG_GLOBAL) << "Setting flag for " << jid.full() << " to " << dirty;
qCDebug(JABBER_PROTOCOL_LOG) << "Setting flag for " << jid.full() << " to " << dirty;
foreach(JabberContactPoolItem *mContactItem, mPool)
{
......@@ -258,19 +258,19 @@ void JabberContactPool::setDirty ( const XMPP::Jid &jid, bool dirty )
}
}
kDebug(JABBER_DEBUG_GLOBAL) << "WARNING: No match found!";
qCDebug(JABBER_PROTOCOL_LOG) << "WARNING: No match found!";
}
void JabberContactPool::cleanUp ()
{
kDebug(JABBER_DEBUG_GLOBAL) << "Cleaning dirty items from contact pool.";
qCDebug(JABBER_PROTOCOL_LOG) << "Cleaning dirty items from contact pool.";
foreach(JabberContactPoolItem *mContactItem, mPool)
{
if ( mContactItem->dirty () )
{
kDebug(JABBER_DEBUG_GLOBAL) << "Removing dirty contact " << mContactItem->contact()->contactId ();
qCDebug(JABBER_PROTOCOL_LOG) << "Removing dirty contact " << mContactItem->contact()->contactId ();
/*
* The following deletion will cause slotContactDestroyed()
......
......@@ -17,8 +17,8 @@
*/
#include "jabbergroupcontact.h"
#include "jabber_protocol_debug.h"
#include <kdebug.h>
#include <KLocalizedString>
#include <kfiledialog.h>
#include <kinputdialog.h>
......@@ -89,7 +89,7 @@ JabberGroupContact::JabberGroupContact (const XMPP::RosterItem &rosterItem, Jabb
JabberGroupContact::~JabberGroupContact ()
{
kDebug ( JABBER_DEBUG_GLOBAL ) ;
qCDebug(JABBER_PROTOCOL_LOG) ;
if(mManager)
{
......@@ -100,13 +100,13 @@ JabberGroupContact::~JabberGroupContact ()
{
/*if(mManager)
mManager->removeContact( contact );*/
kDebug ( JABBER_DEBUG_GLOBAL ) << "Deleting KC " << contact->contactId ();
qCDebug(JABBER_PROTOCOL_LOG) << "Deleting KC " << contact->contactId ();
contact->deleteLater();
}
foreach ( Kopete::MetaContact *metaContact, mMetaContactList )
{
kDebug ( JABBER_DEBUG_GLOBAL ) << "Deleting KMC " << metaContact->metaContactId ();
qCDebug(JABBER_PROTOCOL_LOG) << "Deleting KMC " << metaContact->metaContactId ();
metaContact->deleteLater();
}
}
......@@ -129,7 +129,7 @@ Kopete::ChatSession *JabberGroupContact::manager ( Kopete::Contact::CanCreateFla
{
if(!mManager && canCreate == Kopete::Contact::CanCreate)
{
kWarning (JABBER_DEBUG_GLOBAL) << "somehow, the chat manager was removed, and the contact is still there";
qCWarning(JABBER_PROTOCOL_LOG) << "somehow, the chat manager was removed, and the contact is still there";
mManager = new JabberGroupChatManager ( protocol (), mSelfContact,
Kopete::ContactPtrList (), XMPP::Jid ( rosterItem().jid().userHost() ) );
......@@ -150,7 +150,7 @@ void JabberGroupContact::handleIncomingMessage (const XMPP::Message & message)