Commit f7a1cef9 authored by Laurent Montel's avatar Laurent Montel 😁 Committed by Pali Rohár

Use qCDebug

parent 0a6d20c7
......@@ -7,6 +7,7 @@ include_directories(
${KOPETE_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}/ui
${CMAKE_CURRENT_SOURCE_DIR}/libkyahoo
${CMAKE_CURRENT_BINARY_DIR}/
${JASPER_INCLUDE_DIR}
)
......@@ -46,6 +47,7 @@ set(kopete_yahoo_PART_SRCS
yahooverifyaccount.cpp
yahoowebcam.cpp )
ecm_qt_declare_logging_category(kopete_yahoo_PART_SRCS HEADER yahoo_protocol_debug.h IDENTIFIER YAHOO_PROTOCOL_LOG CATEGORY_NAME org.kde.kopete.yahoo)
add_library(kopete_yahoo MODULE ${kopete_yahoo_PART_SRCS})
......
include_directories( ${JASPER_INCLUDE_DIR} )
include_directories( ${JASPER_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../)
add_subdirectory( tests )
......@@ -70,6 +70,7 @@ receivefiletask.cpp
yahoochattask.cpp
)
ecm_qt_declare_logging_category(libkyahoo_SRCS HEADER yahoo_protocol_debug.h IDENTIFIER YAHOO_PROTOCOL_LOG CATEGORY_NAME org.kde.kopete.yahoo)
if(MINGW)
set_source_files_properties(yahoo_fn.c PROPERTIES COMPILE_FLAGS "--std=c99")
endif(MINGW)
......
......@@ -22,11 +22,11 @@
#include "yahootypes.h"
#include "client.h"
#include <qstring.h>
#include <kdebug.h>
#include "yahoo_protocol_debug.h"
AliveTask::AliveTask(Task* parent) : Task(parent)
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
}
AliveTask::~AliveTask()
......@@ -35,7 +35,7 @@ AliveTask::~AliveTask()
void AliveTask::onGo()
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
YMSGTransfer *t = new YMSGTransfer(Yahoo::ServicePing7);
t->setParam( 0, client()->userId().toLocal8Bit() );
......
......@@ -18,7 +18,7 @@
*
*/
#include <kdebug.h>
#include "yahoo_protocol_debug.h"
#include"bytestream.h"
#include <QByteArray>
......
......@@ -20,11 +20,11 @@
#include "yahootypes.h"
#include "client.h"
#include <kdebug.h>
#include "yahoo_protocol_debug.h"
ChangeStatusTask::ChangeStatusTask(Task* parent) : Task(parent)
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
}
ChangeStatusTask::~ChangeStatusTask()
......@@ -33,7 +33,7 @@ ChangeStatusTask::~ChangeStatusTask()
void ChangeStatusTask::onGo()
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
if( m_status == Yahoo::StatusInvisible ) // status --> Invisible
{
......
......@@ -22,7 +22,6 @@
class QString;
/**
@author André Duffeck
*/
......
......@@ -22,11 +22,11 @@
#include "yahootypes.h"
#include "client.h"
#include <qstring.h>
#include <kdebug.h>
#include "yahoo_protocol_debug.h"
ChatSessionTask::ChatSessionTask(Task* parent) : Task(parent)
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
}
ChatSessionTask::~ChatSessionTask()
......@@ -35,7 +35,7 @@ ChatSessionTask::~ChatSessionTask()
void ChatSessionTask::onGo()
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
YMSGTransfer *t = new YMSGTransfer( Yahoo::ServiceChatSession );
t->setId( client()->sessionID() );
......
......@@ -24,7 +24,7 @@
#include <QTimer>
#include <QPixmap>
#include <kdebug.h>
#include "yahoo_protocol_debug.h"
#include <k3socketbase.h>
#include "yahooclientstream.h"
......@@ -153,7 +153,7 @@ Client::~Client()
void Client::connect( const QString &host, const uint port, const QString &userId, const QString &pass )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
d->host = host;
d->port = port;
d->user = userId;
......@@ -178,9 +178,9 @@ void Client::cancelConnect()
void Client::cs_connected()
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
emit connected();
kDebug(YAHOO_RAW_DEBUG) << " starting login task ... ";
qCDebug(YAHOO_PROTOCOL_LOG) << " starting login task ... ";
// Clear stealth settings
d->stealthedBuddies.clear();
......@@ -192,7 +192,7 @@ void Client::cs_connected()
void Client::close()
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
m_pingTimer->stop();
m_aliveTimer->stop();
if( d->active )
......@@ -233,7 +233,7 @@ QString Client::errorInformation()
// SLOTS //
void Client::streamError( int error )
{
kDebug(YAHOO_RAW_DEBUG) << "CLIENT ERROR (Error " << error << ")";
qCDebug(YAHOO_PROTOCOL_LOG) << "CLIENT ERROR (Error " << error << ")";
QString msg;
d->active = false;
......@@ -271,7 +271,7 @@ void Client::streamDisconnected()
void Client::lt_loginFinished()
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
slotLoginResponse( d->loginTask->statusCode(), d->loginTask->statusString() );
}
......@@ -301,19 +301,19 @@ void Client::slotLoginResponse( int response, const QString &msg )
close();
}
kDebug(YAHOO_RAW_DEBUG) << "Emitting loggedIn";
qCDebug(YAHOO_PROTOCOL_LOG) << "Emitting loggedIn";
emit loggedIn( response, msg );
}
void Client::lt_gotSessionID( uint id )
{
kDebug(YAHOO_RAW_DEBUG) << "Got SessionID: " << id;
qCDebug(YAHOO_PROTOCOL_LOG) << "Got SessionID: " << id;
d->sessionID = id;
}
void Client::slotGotCookies()
{
kDebug(YAHOO_RAW_DEBUG) << "Y: " << d->loginTask->yCookie()
qCDebug(YAHOO_PROTOCOL_LOG) << "Y: " << d->loginTask->yCookie()
<< " T: " << d->loginTask->tCookie()
<< " C: " << d->loginTask->cCookie() << endl;
d->yCookie = d->loginTask->yCookie();
......@@ -424,7 +424,7 @@ void Client::cancelFileTransfer( unsigned int transferId )
void Client::changeStatus( Yahoo::Status status, const QString &message, Yahoo::StatusType type )
{
kDebug(YAHOO_RAW_DEBUG) << "status: " << status
qCDebug(YAHOO_PROTOCOL_LOG) << "status: " << status
<< " message: " << message
<< " type: " << type << endl;
ChangeStatusTask *cst = new ChangeStatusTask( d->root );
......@@ -452,10 +452,10 @@ void Client::sendPing()
{
if( !d->active )
{
kDebug(YAHOO_RAW_DEBUG) << "Disconnected. NOT sending a PING.";
qCDebug(YAHOO_PROTOCOL_LOG) << "Disconnected. NOT sending a PING.";
return;
}
kDebug(YAHOO_RAW_DEBUG) << "Sending a PING.";
qCDebug(YAHOO_PROTOCOL_LOG) << "Sending a PING.";
PingTask *pt = new PingTask( d->root );
pt->go( true );
}
......@@ -464,10 +464,10 @@ void Client::sendAlive()
{
if( !d->active )
{
kDebug(YAHOO_RAW_DEBUG) << "Disconnected. NOT sending a ALIVE.";
qCDebug(YAHOO_PROTOCOL_LOG) << "Disconnected. NOT sending a ALIVE.";
return;
}
kDebug(YAHOO_RAW_DEBUG) << "Sending a ALIVE.";
qCDebug(YAHOO_PROTOCOL_LOG) << "Sending a ALIVE.";
AliveTask *at = new AliveTask( d->root );
at->go( true );
}
......@@ -527,7 +527,7 @@ void Client::moveBuddy( const QString &userId, const QString &oldGroup, const QS
void Client::processPictureQueue()
{
kDebug(YAHOO_RAW_DEBUG) << k_funcinfo << endl;
qCDebug(YAHOO_PROTOCOL_LOG) << endl;
d->buddyListReady = true;
if( d->pictureRequestQueue.isEmpty() )
{
......@@ -537,7 +537,6 @@ void Client::processPictureQueue()
requestPicture( d->pictureRequestQueue.front() );
d->pictureRequestQueue.pop_front();
if( !d->pictureRequestQueue.isEmpty() )
{
QTimer::singleShot( 1000, this, SLOT(processPictureQueue()) );
......@@ -571,7 +570,7 @@ void Client::downloadPicture( const QString &userId, KUrl url, int checksum )
void Client::uploadPicture( KUrl url )
{
kDebug(YAHOO_RAW_DEBUG) << "URL: " << url.url();
qCDebug(YAHOO_PROTOCOL_LOG) << "URL: " << url.url();
SendPictureTask *spt = new SendPictureTask( d->root );
spt->setType( SendPictureTask::UploadPicture );
spt->setFilename( url.fileName() );
......@@ -584,7 +583,7 @@ void Client::uploadPicture( KUrl url )
void Client::sendPictureChecksum( const QString &userId, int checksum )
{
kDebug(YAHOO_RAW_DEBUG) << "checksum: " << checksum;
qCDebug(YAHOO_PROTOCOL_LOG) << "checksum: " << checksum;
SendPictureTask *spt = new SendPictureTask( d->root );
spt->setType( SendPictureTask::SendChecksum );
spt->setChecksum( checksum );
......@@ -595,7 +594,7 @@ void Client::sendPictureChecksum( const QString &userId, int checksum )
void Client::sendPictureInformation( const QString &userId, const QString &url, int checksum )
{
kDebug(YAHOO_RAW_DEBUG) << "checksum: " << checksum;
qCDebug(YAHOO_PROTOCOL_LOG) << "checksum: " << checksum;
SendPictureTask *spt = new SendPictureTask( d->root );
spt->setType( SendPictureTask::SendInformation );
spt->setChecksum( checksum );
......@@ -609,7 +608,7 @@ void Client::setPictureStatus( Yahoo::PictureStatus status )
if( d->pictureFlag == status )
return;
kDebug(YAHOO_RAW_DEBUG) << "Setting PictureStatus to: " << status;
qCDebug(YAHOO_PROTOCOL_LOG) << "Setting PictureStatus to: " << status;
d->pictureFlag = status;
SendPictureTask *spt = new SendPictureTask( d->root );
spt->setType( SendPictureTask::SendStatus );
......@@ -639,7 +638,6 @@ void Client::closeOutgoingWebcam()
d->webcamTask->closeOutgoingWebcam();
}
void Client::grantWebcamAccess( const QString &userId )
{
d->webcamTask->grantAccess( userId );
......@@ -739,7 +737,7 @@ void Client::leaveChat()
// ***** other *****
void Client::notifyError( const QString &info, const QString & errorString, LogLevel level )
{
kDebug(YAHOO_RAW_DEBUG) << QStringLiteral("\nThe following error occurred: %1\n Reason: %2\n LogLevel: %3")
qCDebug(YAHOO_PROTOCOL_LOG) << QStringLiteral("\nThe following error occurred: %1\n Reason: %2\n LogLevel: %3")
.arg(info).arg(errorString).arg(level) << endl;
d->errorString = errorString;
d->errorInformation = info;
......@@ -784,7 +782,6 @@ void Client::setStatus( Yahoo::Status status )
d->status = status;
}
void Client::setStatusOnConnect( Yahoo::Status status )
{
d->statusOnConnect = status;
......@@ -852,18 +849,18 @@ QString Client::cCookie()
void Client::distribute( Transfer * transfer )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
if( !rootTask()->take( transfer ) )
kDebug(YAHOO_RAW_DEBUG) << "CLIENT: root task refused transfer";
qCDebug(YAHOO_PROTOCOL_LOG) << "CLIENT: root task refused transfer";
delete transfer;
}
void Client::send( Transfer* request )
{
kDebug(YAHOO_RAW_DEBUG) << "CLIENT::send()";
qCDebug(YAHOO_PROTOCOL_LOG) << "CLIENT::send()";
if( !d->stream )
{
kDebug(YAHOO_RAW_DEBUG) << "CLIENT - NO STREAM TO SEND ON!";
qCDebug(YAHOO_PROTOCOL_LOG) << "CLIENT - NO STREAM TO SEND ON!";
return;
}
......
......@@ -21,11 +21,11 @@
#include "client.h"
#include <qstring.h>
#include <qstringlist.h>
#include <kdebug.h>
#include "yahoo_protocol_debug.h"
ConferenceTask::ConferenceTask(Task* parent) : Task(parent)
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
}
ConferenceTask::~ConferenceTask()
......@@ -75,7 +75,7 @@ bool ConferenceTask::forMe( const Transfer* transfer ) const
void ConferenceTask::parseInvitation( YMSGTransfer *t )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
int i = 0;
QString who = t->firstParam( 50 );
......@@ -101,7 +101,7 @@ void ConferenceTask::parseInvitation( YMSGTransfer *t )
void ConferenceTask::parseMessage( YMSGTransfer *t )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
QString room = t->firstParam( 57 );
QString from = t->firstParam( 3 );
......@@ -118,7 +118,7 @@ void ConferenceTask::parseMessage( YMSGTransfer *t )
void ConferenceTask::parseUserJoined( YMSGTransfer *t )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
QString room = t->firstParam( 57 );
QString who = t->firstParam( 53 );
......@@ -129,7 +129,7 @@ void ConferenceTask::parseUserJoined( YMSGTransfer *t )
void ConferenceTask::parseUserLeft( YMSGTransfer *t )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
QString room = t->firstParam( 57 );
QString who = t->firstParam( 56 );
......@@ -140,7 +140,7 @@ void ConferenceTask::parseUserLeft( YMSGTransfer *t )
void ConferenceTask::parseUserDeclined( YMSGTransfer *t )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
QString room = t->firstParam( 57 );
QString who = t->firstParam( 54 );
......@@ -152,7 +152,7 @@ void ConferenceTask::parseUserDeclined( YMSGTransfer *t )
void ConferenceTask::inviteConference( const QString &room, const QStringList &members, const QString &msg )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceConfInvite);
t->setId( client()->sessionID() );
......@@ -170,7 +170,7 @@ void ConferenceTask::inviteConference( const QString &room, const QStringList &m
void ConferenceTask::addInvite( const QString &room, const QStringList &who, const QStringList &members, const QString &msg )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceConfAddInvite);
t->setId( client()->sessionID() );
......@@ -196,7 +196,7 @@ void ConferenceTask::addInvite( const QString &room, const QStringList &who, con
void ConferenceTask::joinConference( const QString &room, const QStringList &members )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceConfLogon);
t->setId( client()->sessionID() );
......@@ -210,7 +210,7 @@ void ConferenceTask::joinConference( const QString &room, const QStringList &mem
void ConferenceTask::declineConference( const QString &room, const QStringList &members, const QString &msg )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceConfDecline);
t->setId( client()->sessionID() );
......@@ -225,7 +225,7 @@ void ConferenceTask::declineConference( const QString &room, const QStringList &
}
void ConferenceTask::leaveConference( const QString &room, const QStringList &members )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceConfLogoff);
t->setId( client()->sessionID() );
......@@ -239,7 +239,7 @@ void ConferenceTask::leaveConference( const QString &room, const QStringList &me
void ConferenceTask::sendMessage( const QString &room, const QStringList &members, const QString &msg )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
YMSGTransfer *t = new YMSGTransfer(Yahoo::ServiceConfMsg);
t->setId( client()->sessionID() );
......
......@@ -21,7 +21,6 @@
#ifndef LIBKYAHOO_CONNECTOR_H
#define LIBKYAHOO_CONNECTOR_H
#include <qobject.h>
#include "qhostaddress.h"
......
......@@ -29,8 +29,7 @@
#include <QTextStream>
#include <QByteArray>
#include <kdebug.h>
#include "yahoo_protocol_debug.h"
#include <kurl.h>
#include "ymsgprotocol.h"
......@@ -55,7 +54,7 @@ void CoreProtocol::addIncomingData( const QByteArray & incomingBytes )
{
// store locally
int oldsize = m_in.size();
kDebug(YAHOO_RAW_DEBUG) << incomingBytes.size() << " bytes. already had " << oldsize << " bytes";
qCDebug(YAHOO_PROTOCOL_LOG) << incomingBytes.size() << " bytes. already had " << oldsize << " bytes";
m_in.resize( oldsize + incomingBytes.size() );
memcpy( m_in.data() + oldsize, incomingBytes.data(), incomingBytes.size() );
......@@ -70,11 +69,11 @@ void CoreProtocol::addIncomingData( const QByteArray & incomingBytes )
while ( m_in.size() && ( parsedBytes = wireToTransfer(m_in) ) )
{
transferCount++;
kDebug(YAHOO_RAW_DEBUG) << " parsed transfer " << transferCount << " in chunk of "<< parsedBytes << " bytes";
qCDebug(YAHOO_PROTOCOL_LOG) << " parsed transfer " << transferCount << " in chunk of "<< parsedBytes << " bytes";
int size = m_in.size();
if ( parsedBytes < size )
{
kDebug(YAHOO_RAW_DEBUG) << " more data in chunk! ( I have parsed " << parsedBytes << " and total data of " << size << ")";
qCDebug(YAHOO_PROTOCOL_LOG) << " more data in chunk! ( I have parsed " << parsedBytes << " and total data of " << size << ")";
// remove parsed bytes from the buffer
m_in.remove( 0, parsedBytes );
}
......@@ -82,7 +81,7 @@ void CoreProtocol::addIncomingData( const QByteArray & incomingBytes )
m_in.truncate( 0 );
}
if ( m_state == NeedMore )
kDebug(YAHOO_RAW_DEBUG) << " message was incomplete, waiting for more...";
qCDebug(YAHOO_PROTOCOL_LOG) << " message was incomplete, waiting for more...";
/*
if ( m_eventProtocol->state() == EventProtocol::OutOfSync )
{
......@@ -90,23 +89,23 @@ void CoreProtocol::addIncomingData( const QByteArray & incomingBytes )
m_in.truncate( 0 );
}
*/
kDebug(YAHOO_RAW_DEBUG) << " done processing chunk";
qCDebug(YAHOO_PROTOCOL_LOG) << " done processing chunk";
}
Transfer* CoreProtocol::incomingTransfer()
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
if ( m_state == Available )
{
// kDebug(YAHOO_RAW_DEBUG) << " - got a transfer";
// qCDebug(YAHOO_PROTOCOL_LOG) << " - got a transfer";
m_state = NoData;
return m_inTransfer;
m_inTransfer = 0;
}
else
{
kDebug(YAHOO_RAW_DEBUG) << " no milk today";
qCDebug(YAHOO_PROTOCOL_LOG) << " no milk today";
return 0;
}
}
......@@ -114,7 +113,7 @@ Transfer* CoreProtocol::incomingTransfer()
void cp_dump( const QByteArray &bytes )
{
#ifdef YAHOO_COREPROTOCOL_DEBUG
kDebug(YAHOO_RAW_DEBUG) << " contains " << bytes.count() << " bytes";
qCDebug(YAHOO_PROTOCOL_LOG) << " contains " << bytes.count() << " bytes";
for ( uint i = 0; i < bytes.count(); ++i )
{
printf( "%02x ", bytes[ i ] );
......@@ -127,10 +126,10 @@ void cp_dump( const QByteArray &bytes )
void CoreProtocol::outgoingTransfer( Transfer* outgoing )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
if ( outgoing->type() == Transfer::YMSGTransfer )
{
kDebug(YAHOO_RAW_DEBUG) << " got YMSGTransfer";
qCDebug(YAHOO_PROTOCOL_LOG) << " got YMSGTransfer";
YMSGTransfer *yt = (YMSGTransfer *) outgoing;
QByteArray bytesOut = yt->serialize();
......@@ -138,7 +137,7 @@ void CoreProtocol::outgoingTransfer( Transfer* outgoing )
//dout.setEncoding( QTextStream::Latin1 );
//dout.setByteOrder( QDataStream::LittleEndian );
//dout << bytesOut;
//kDebug(YAHOO_RAW_DEBUG) << " " << bytesOut;
//qCDebug(YAHOO_PROTOCOL_LOG) << " " << bytesOut;
emit outgoingData( bytesOut );
// now convert
//fieldsToWire( fields );
......@@ -146,11 +145,9 @@ void CoreProtocol::outgoingTransfer( Transfer* outgoing )
delete outgoing;
}
int CoreProtocol::wireToTransfer( const QByteArray& wire )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
// processing incoming data and reassembling it into transfers
// may be an event or a response
......@@ -170,9 +167,9 @@ int CoreProtocol::wireToTransfer( const QByteArray& wire )
{
if ( (wire[0] == 'Y') && (wire[1] == 'M') && (wire[2] == 'S') && (wire[3] == 'G'))
{
// kDebug(YAHOO_RAW_DEBUG) << " - looks like a valid YMSG packet";
// qCDebug(YAHOO_PROTOCOL_LOG) << " - looks like a valid YMSG packet";
YMSGTransfer *t = static_cast<YMSGTransfer *>(m_YMSGProtocol->parse( wire, bytesParsed ));
// kDebug(YAHOO_RAW_DEBUG) << " - YMSG Protocol parsed " << bytesParsed << " bytes";
// qCDebug(YAHOO_PROTOCOL_LOG) << " - YMSG Protocol parsed " << bytesParsed << " bytes";
if ( t )
{
if( wire.size() < t->packetLength() )
......@@ -182,7 +179,7 @@ int CoreProtocol::wireToTransfer( const QByteArray& wire )
return 0;
}
m_inTransfer = t;
// kDebug(YAHOO_RAW_DEBUG) << " - got a valid packet ";
// qCDebug(YAHOO_PROTOCOL_LOG) << " - got a valid packet ";
m_state = Available;
emit incomingData();
......@@ -192,18 +189,18 @@ int CoreProtocol::wireToTransfer( const QByteArray& wire )
}
else
{
kDebug(YAHOO_RAW_DEBUG) << " - not a valid YMSG packet. Trying to recover.";
qCDebug(YAHOO_PROTOCOL_LOG) << " - not a valid YMSG packet. Trying to recover.";
QTextStream s( wire, QIODevice::ReadOnly );
QString remaining = s.readAll();
int pos = remaining.indexOf( QLatin1String("YMSG"), bytesParsed );
if( pos >= 0 )
{
kDebug(YAHOO_RAW_DEBUG) << "Recover successful.";
qCDebug(YAHOO_PROTOCOL_LOG) << "Recover successful.";
bytesParsed += pos;
}
else
{
kDebug(YAHOO_RAW_DEBUG) << "Recover failed. Dump it!";
qCDebug(YAHOO_PROTOCOL_LOG) << "Recover failed. Dump it!";
bytesParsed = wire.size();
}
}
......@@ -226,7 +223,7 @@ bool CoreProtocol::okToProceed( QDataStream &din)
if ( din.atEnd() )
{
m_state = NeedMore;
kDebug(YAHOO_RAW_DEBUG) << " saved message prematurely";
qCDebug(YAHOO_PROTOCOL_LOG) << " saved message prematurely";
return false;
}
else
......
......@@ -22,14 +22,14 @@
#include <QFile>
#include <QPixmap>
#include <kdebug.h>
#include "yahoo_protocol_debug.h"
#include <kcodecs.h>
using namespace KYahoo;
FileTransferNotifierTask::FileTransferNotifierTask(Task* parent) : Task(parent)
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
}
FileTransferNotifierTask::~FileTransferNotifierTask()
......@@ -50,7 +50,6 @@ bool FileTransferNotifierTask::take( Transfer* transfer )
parseFileTransfer7( t );
else if( t->service() == Yahoo::ServicePeerToPeer )
acceptFileTransfer( t );
return true;
}
......@@ -62,7 +61,6 @@ bool FileTransferNotifierTask::forMe( const Transfer *transfer ) const
if (!t)
return false;
if( t->service() == Yahoo::ServiceP2PFileXfer ||
t->service() == Yahoo::ServicePeerToPeer ||
t->service() == Yahoo::ServiceFileTransfer ||
......@@ -76,7 +74,7 @@ bool FileTransferNotifierTask::forMe( const Transfer *transfer ) const
void FileTransferNotifierTask::parseFileTransfer( YMSGTransfer *t )
{
kDebug(YAHOO_RAW_DEBUG) ;
qCDebug(YAHOO_PROTOCOL_LOG) ;
QString from; /* key = 4 */
QString to; /* key = 5 */
......@@ -94,8 +92,6 @@ void FileTransferNotifierTask::parseFileTransfer( YMSGTransfer *t )
filename = t->firstParam( 27 );
size = t->firstParam( 28 ).toULong();