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

Port to qCDebug

parent 563bab2b
......@@ -17,7 +17,7 @@
#include "connectionmanager.h"
#include <kdebug.h>
#include "libkopete_debug.h"
#include <klocale.h>
#include <kmessagebox.h>
......@@ -64,28 +64,28 @@ void ConnectionManager::initialise()
void ConnectionManager::updateStatus()
{
NetworkStatus::EnumStatus daemonStatus = (NetworkStatus::EnumStatus)d->m_stub->status(QString());
kDebug();
qCDebug(LIBKOPETE_LOG);
switch (daemonStatus) {
case NetworkStatus::Offline:
case NetworkStatus::OfflineFailed:
case NetworkStatus::OfflineDisconnected:
case NetworkStatus::ShuttingDown:
if (d->m_state == Online) {
kDebug() << "STATE IS PENDING";
qCDebug(LIBKOPETE_LOG) << "STATE IS PENDING";
d->m_state = Pending;
} else {
kDebug() << "STATE IS OFFLINE";
qCDebug(LIBKOPETE_LOG) << "STATE IS OFFLINE";
d->m_state = Offline;
}
break;
case NetworkStatus::Establishing:
case NetworkStatus::Online:
kDebug() << "STATE IS ONLINE";
qCDebug(LIBKOPETE_LOG) << "STATE IS ONLINE";
d->m_state = Online;
break;
case NetworkStatus::NoNetworks:
case NetworkStatus::Unreachable:
kDebug() << "STATE IS INACTIVE";
qCDebug(LIBKOPETE_LOG) << "STATE IS INACTIVE";
d->m_state = Inactive;
break;
}
......@@ -114,7 +114,7 @@ NetworkStatus::EnumStatus ConnectionManager::status(const QString &host)
NetworkStatus::EnumRequestResult ConnectionManager::requestConnection(QWidget *mainWidget, const QString &host, bool userInitiated)
{
kDebug();
qCDebug(LIBKOPETE_LOG);
NetworkStatus::EnumRequestResult result;
// if offline and the user has previously indicated they didn't want any new connections, suppress it
if (d->m_state == Offline && !userInitiated && d->m_userInitiatedOnly) {
......@@ -144,7 +144,7 @@ void ConnectionManager::relinquishConnection(const QString &host)
void ConnectionManager::slotStatusChanged(QString host, int status)
{
kDebug();
qCDebug(LIBKOPETE_LOG);
updateStatus();
// reset user initiated only flag if we are now online
if (d->m_state == Online) {
......
......@@ -61,7 +61,7 @@ public:
*
* if( !storage->isValid() )
* {
* qDebug() << "Contact list storage failed. Reason: " << storage->errorMessage();
* qCDebug(LIBKOPETE_LOG) << "Contact list storage failed. Reason: " << storage->errorMessage();
* }
* @endcode
*
......
......@@ -117,7 +117,7 @@ bool AccountManager::isAnyAccountConnected() const
void AccountManager::setOnlineStatus(uint category, const Kopete::StatusMessage &statusMessage, uint flags, bool forced)
{
qDebug() << "category: " << category << "status title: " << statusMessage.title() << "status message: " << statusMessage.message();
qCDebug(LIBKOPETE_LOG) << "category: " << category << "status title: " << statusMessage.title() << "status message: " << statusMessage.message();
OnlineStatusManager::Categories categories
= (OnlineStatusManager::Categories)category;
const bool onlyChangeConnectedAccounts = (!forced && isAnyAccountConnected());
......
......@@ -162,7 +162,7 @@ Kopete::AvatarManager::AvatarEntry AvatarManager::add(Kopete::AvatarManager::Ava
data = f.readAll();
f.close();
} else {
qDebug() << "Warning: No valid image source!";
qCDebug(LIBKOPETE_LOG) << "Warning: No valid image source!";
}
// Scale avatar
......
......@@ -26,7 +26,7 @@
#include <QRegExp>
#include <QPointer>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <KLocalizedString>
......@@ -273,7 +273,7 @@ void Kopete::ChatSession::clearChains()
Kopete::MessageHandlerChain::Ptr Kopete::ChatSession::chainForDirection(Kopete::Message::MessageDirection dir)
{
if (dir < 0 || dir >= CHAIN_COUNT) {
kFatal(14000) << "invalid message direction " << dir;
qCCritical(LIBKOPETE_LOG) << "invalid message direction " << dir;
}
if (!d->chains[dir]) {
TempFactory theTempFactory;
......@@ -405,7 +405,7 @@ QString Kopete::ChatSession::initLastUrl(const Kopete::Contact *c)
}
file.close();
} else {
kDebug(14310) << "cant open lasturls file for " << c->contactId();
qCDebug(LIBKOPETE_LOG) << "cant open lasturls file for " << c->contactId();
}
}
if (!lastUrl.isEmpty()) {
......@@ -414,7 +414,7 @@ QString Kopete::ChatSession::initLastUrl(const Kopete::Contact *c)
return QLatin1String("");
}
} else {
kDebug(14310) << "cant find lasturls file for " << c->contactId();
qCDebug(LIBKOPETE_LOG) << "cant find lasturls file for " << c->contactId();
return QLatin1String("");
}
}
......
......@@ -23,7 +23,7 @@
#include "kopeteuiglobal.h"
#include <kauthorized.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <qinputdialog.h>
#include <KLocalizedString>
#include <QIcon>
......
......@@ -29,7 +29,7 @@
// KDE includes
//#include <kcontacts/stdaddressbook.h>
#include <kapplication.h>
#include <kdebug.h>
#include "libkopete_debug.h"
// Kopete includes
......
......@@ -20,7 +20,7 @@
#include "kopetecontactlistelement.h"
#include <kconfig.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include "kopeteplugin.h"
......
......@@ -26,7 +26,7 @@
#include "kopetemetacontact.h"
#include "kopetepicture.h"
#include <kdebug.h>
#include "libkopete_debug.h"
#include <kiconloader.h>
#include <QPixmap>
......
......@@ -20,7 +20,7 @@
#include <QtCore/QLatin1String>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <KLocalizedString>
#include <kio/netaccess.h>
#include <kmimetype.h>
......@@ -43,7 +43,7 @@ Properties *Properties::mSelf = nullptr;
Properties *Properties::self()
{
if (!mSelf) {
//kDebug(14000) ;
//qCDebug(LIBKOPETE_LOG) ;
mSelf = new Properties();
// create the templates
mSelf->fullName();
......@@ -67,13 +67,13 @@ Properties *Properties::self()
Properties::Properties()
{
kDebug(14000);
qCDebug(LIBKOPETE_LOG);
d = new PropertiesPrivate();
}
Properties::~Properties()
{
kDebug(14000);
qCDebug(LIBKOPETE_LOG);
mSelf = nullptr;
delete d;
}
......@@ -81,7 +81,7 @@ Properties::~Properties()
const PropertyTmpl &Properties::tmpl(const QString &key) const
{
if (d->mTemplates.contains(key)) {
/*kDebug(14000) <<
/*qCDebug(LIBKOPETE_LOG) <<
"Found template for key = '" << key << "'" << endl;*/
return d->mTemplates[key];
} else {
......@@ -92,7 +92,7 @@ const PropertyTmpl &Properties::tmpl(const QString &key) const
bool Properties::registerTemplate(const QString &key, const PropertyTmpl &tmpl)
{
if (d->mTemplates.contains(key)) {
kDebug(14000)
qCDebug(LIBKOPETE_LOG)
<<"Called for EXISTING key = '" << key << "'" << endl;
return false;
} else {
......@@ -103,7 +103,7 @@ bool Properties::registerTemplate(const QString &key, const PropertyTmpl &tmpl)
void Properties::unregisterTemplate(const QString &key)
{
kDebug(14000) << "called for key: '" << key << "'";
qCDebug(LIBKOPETE_LOG) << "called for key: '" << key << "'";
d->mTemplates.remove(key);
}
......@@ -216,11 +216,11 @@ const PropertyTmpl &Properties::photo() const
const PropertyTmpl &Properties::createProp(const QString &key, const QString &label, const QString &icon, bool persistent) const
{
/*kDebug(14000) <<
/*qCDebug(LIBKOPETE_LOG) <<
"key = " << key << ", label = " << label << endl;*/
if (!d->mTemplates.contains(key)) {
/* kDebug(14000) <<
/* qCDebug(LIBKOPETE_LOG) <<
"CREATING NEW PropertyTmpl WITH key = " << key <<
", label = " << label << ", persisten = " << persistent << endl;*/
d->mTemplates.insert(key, PropertyTmpl(key, label, icon, persistent ? PropertyTmpl::PersistentProperty : PropertyTmpl::NoProperty));
......
......@@ -227,7 +227,7 @@ void IdentityManager::load()
<<"Failed to create identity for '" << identityId << "'" << endl;
continue;
}
qDebug() << "Created identity " << identityId;
qCDebug(LIBKOPETE_LOG) << "Created identity " << identityId;
}
// get the default identity
......
......@@ -23,7 +23,7 @@
#include <QCursor>
#include <QDateTime>
#include <kdebug.h>
#include "libkopete_debug.h"
class Kopete::IdleTimer::Private
{
......@@ -54,10 +54,10 @@ Kopete::IdleTimer::IdleTimer()
Kopete::IdlePlatform *p = new Kopete::IdlePlatform();
if (p->init()) {
qDebug() << "Using platform idle timer";
qCDebug(LIBKOPETE_LOG) << "Using platform idle timer";
d->platform = p;
} else {
kWarning() << "Using dummy idle timer";
qCWarning(LIBKOPETE_LOG) << "Using dummy idle timer";
delete p;
d->lastMousePos = QCursor::pos();
......
......@@ -17,7 +17,7 @@
#include "kopeteinfoeventmanager.h"
#include <kdebug.h>
#include "libkopete_debug.h"
namespace Kopete {
class InfoEvent::Private
......
......@@ -31,7 +31,7 @@
#include <QTextDocument>
#include <QColor>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <kstringhandler.h>
#include "kopetemetacontact.h"
......@@ -407,7 +407,7 @@ QString Message::escapedBody() const
QString Message::parsedBody() const
{
//kDebug(14000) << "messageformat: " << d->format;
//qCDebug(LIBKOPETE_LOG) << "messageformat: " << d->format;
if (!d->parsedBodyDirty) {
return d->parsedBody;
}
......@@ -776,7 +776,7 @@ QString Message::decodeString(const QByteArray &message, const QTextCodec *provi
if( testCodec && testCodec->heuristicContentMatch( message, charsToCheck ) >= charsToCheck )
{
//All chars decodable.
kDebug(14000) << "Using locale's codec";
qCDebug(LIBKOPETE_LOG) << "Using locale's codec";
return testCodec->toUnicode( message );
}
......@@ -785,11 +785,11 @@ QString Message::decodeString(const QByteArray &message, const QTextCodec *provi
if( testCodec && testCodec->heuristicContentMatch( message, charsToCheck ) >= charsToCheck )
{
//All chars decodable.
kDebug(14000) << "Using latin1";
qCDebug(LIBKOPETE_LOG) << "Using latin1";
return testCodec->toUnicode( message );
}
kDebug(14000) << "Using latin1 and cleaning string";
qCDebug(LIBKOPETE_LOG) << "Using latin1 and cleaning string";
//No codec decoded. Just decode latin1, and clean out any junk.
QString result = QLatin1String( message );
const uint length = message.length();
......
......@@ -21,7 +21,7 @@
#include "kopetemessageevent.h"
#include <kdebug.h>
#include "libkopete_debug.h"
#include "kopetemetacontact.h"
#include "kopetecontactlist.h"
......
......@@ -19,7 +19,7 @@
#include "kopetemessageevent.h"
#include "kopetechatsession.h"
#include <kdebug.h>
#include "libkopete_debug.h"
#include <QMap>
#include <QTimer>
......
......@@ -24,7 +24,7 @@
#include <kcontacts/addressee.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <KLocalizedString>
#include <kmessagebox.h>
......
......@@ -21,7 +21,7 @@
#include <qwidget.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <KLocalizedString>
#include <kio/netaccess.h>
#include <kmimetype.h>
......
......@@ -27,7 +27,7 @@
#include "kopetecontact.h"
#include <kiconloader.h>
#include <kiconeffect.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <KLocalizedString>
#include <QPixmap>
#include <QIconEngineV2>
......
......@@ -24,7 +24,7 @@
#include <KGlobal>
#include <kconfig.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <KLocalizedString>
#include <kmessagebox.h>
#include <kiconloader.h>
......
......@@ -20,7 +20,7 @@
#include <QDir>
#include <kcodecs.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <qbuffer.h>
#include <QStandardPaths>
......
......@@ -16,7 +16,7 @@
#include "kopeteproperties.h"
#include <kdebug.h>
#include "libkopete_debug.h"
#include <qdom.h>
#include <qvariant.h>
......
......@@ -20,7 +20,7 @@
*/
#include "kopeteproperty.h"
#include <kdebug.h>
#include "libkopete_debug.h"
#include "kopeteglobal.h"
namespace Kopete {
......@@ -48,7 +48,7 @@ PropertyTmpl::PropertyTmpl(const QString &key, const QString &label, const QStri
{
PropertyTmpl other = Kopete::Global::Properties::self()->tmpl(key);
if (other.isNull()) {
// kDebug(14000) << "Creating new template for key = '" << key << "'";
// qCDebug(LIBKOPETE_LOG) << "Creating new template for key = '" << key << "'";
d = new Private;
d->refCount = 1;
......@@ -58,7 +58,7 @@ PropertyTmpl::PropertyTmpl(const QString &key, const QString &label, const QStri
d->options = options;
Kopete::Global::Properties::self()->registerTemplate(key, (*this));
} else {
// kDebug(14000) << "Using existing template for key = '" << key << "'";
// qCDebug(LIBKOPETE_LOG) << "Using existing template for key = '" << key << "'";
d = other.d;
d->refCount++;
}
......@@ -74,11 +74,11 @@ PropertyTmpl &PropertyTmpl::operator=(
const PropertyTmpl &other)
{
if (this == &other) {
// kDebug(14000) << "trying to assign this to itself!";
// qCDebug(LIBKOPETE_LOG) << "trying to assign this to itself!";
return *this;
}
if (d == other.d) {
// kDebug(14000) << "trying to assign d to itself!";
// qCDebug(LIBKOPETE_LOG) << "trying to assign d to itself!";
return *this;
}
d->refCount--;
......@@ -202,7 +202,7 @@ Property::~Property()
Property &Property::operator=(const Property &other)
{
if (this == &other) {
// kDebug(14000) << "trying to assign this to itself!";
// qCDebug(LIBKOPETE_LOG) << "trying to assign this to itself!";
return *this;
}
......
......@@ -125,7 +125,7 @@ const Kopete::Property &PropertyContainer::property(
void PropertyContainer::setProperty(const Kopete::PropertyTmpl &tmpl, const QVariant &value)
{
if (tmpl.isNull() || tmpl.key().isEmpty()) {
kDebug(14000)
qCDebug(LIBKOPETE_LOG)
<<"No valid template for property passed!" << endl;
return;
}
......
......@@ -19,7 +19,7 @@
#include "kopeteprotocol.h"
#include <kdebug.h>
#include "libkopete_debug.h"
#include <KLocalizedString>
#include <kjob.h>
......
......@@ -21,7 +21,7 @@
#include <netinet/tcp.h>
#endif
#include <kdebug.h>
#include "libkopete_debug.h"
#include <QAbstractSocket>
#include <QTimer>
......@@ -33,7 +33,7 @@ QSet<QAbstractSocket *> SocketTimeoutWatcher::watchedSocketSet;
SocketTimeoutWatcher *SocketTimeoutWatcher::watch(QAbstractSocket *socket, quint32 msecTimeout)
{
if (watchedSocketSet.contains(socket)) {
qDebug() << "Socket is already being watched " << socket;
qCDebug(LIBKOPETE_LOG) << "Socket is already being watched " << socket;
return 0;
}
......@@ -91,7 +91,7 @@ void SocketTimeoutWatcher::ackTimeoutCheck()
if (info.tcpi_last_ack_recv < info.tcpi_last_data_sent || info.tcpi_last_data_sent <= 0) {
mAckCheckTimer->stop();
} else if (info.tcpi_last_ack_recv > info.tcpi_last_data_sent && info.tcpi_last_data_sent > mTimeoutThreshold) {
kWarning() << "Connection timeout for " << mSocket->peerAddress();
qCWarning(LIBKOPETE_LOG) << "Connection timeout for " << mSocket->peerAddress();
mAckCheckTimer->stop();
emit error(QAbstractSocket::RemoteHostClosedError);
emit errorInt(QAbstractSocket::RemoteHostClosedError);
......@@ -104,7 +104,7 @@ void SocketTimeoutWatcher::ackTimeoutCheck()
if (mActive) {
mAckCheckTimer->stop();
mActive = false;
kWarning() << "Timeout watcher not active for " << mSocket->peerAddress();
qCWarning(LIBKOPETE_LOG) << "Timeout watcher not active for " << mSocket->peerAddress();
}
} else {
mAckCheckTimer->stop();
......
......@@ -178,7 +178,7 @@ void Kopete::Transfer::slotNextFile(const QString &sourceFile, const QString &de
QUrl src;
QUrl dest;
//qDebug() << "source: " << sourceFile << " destination: " << destinationFile;
//qCDebug(LIBKOPETE_LOG) << "source: " << sourceFile << " destination: " << destinationFile;
if (d->info.direction() == Kopete::FileTransferInfo::Incoming) {
QUrl url(sourceFile);
src = displayURL(d->info.contact(), url.fileName());
......
......@@ -23,7 +23,7 @@
#include <kmessagebox.h>
#include <kmessagebox_queued.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <kiconloader.h>
#include <KLocalizedString>
......
#include "networkstatuscommon.h"
#include <kdebug.h>
#include "libkopete_debug.h"
QDataStream & operator<<(QDataStream &s, const NetworkStatus::Properties p)
{
kDebug() << "status is: " << (int)p.status;
qCDebug(LIBKOPETE_LOG) << "status is: " << (int)p.status;
s << (int)p.status;
s << (int)p.onDemandPolicy;
s << p.service;
......@@ -16,7 +16,7 @@ QDataStream &operator>>(QDataStream &s, NetworkStatus::Properties &p)
{
int status, onDemandPolicy, internet;
s >> status;
kDebug() << "status is: " << status;
qCDebug(LIBKOPETE_LOG) << "status is: " << status;
p.status = (NetworkStatus::EnumStatus)status;
s >> onDemandPolicy;
p.onDemandPolicy = (NetworkStatus::EnumOnDemandPolicy)onDemandPolicy;
......@@ -28,6 +28,6 @@ QDataStream &operator>>(QDataStream &s, NetworkStatus::Properties &p)
p.internet = false;
}
s >> p.netmasks;
kDebug() << "enum converted status is: " << p.status;
qCDebug(LIBKOPETE_LOG) << "enum converted status is: " << p.status;
return s;
}
......@@ -20,7 +20,7 @@
#include <kmessagebox.h>
#include <kmessagebox_queued.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include "knotification.h"
#include "kopeteuiglobal.h"
......
......@@ -20,7 +20,7 @@
#include <QtAlgorithms>
#include <kconfig.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <KLocalizedString>
#include <kplugininfo.h>
#include <knotification.h>
......@@ -87,7 +87,7 @@ static QString squashMessage(const Kopete::Message &msg, const int len = 30)
fullUrl.length(), shorterUrl);
}
}
kDebug(14000) << msgText;
qCDebug(LIBKOPETE_LOG) << msgText;
return msgText;
}
......@@ -151,7 +151,7 @@ KopeteViewManager::KopeteViewManager()
KopeteViewManager::~KopeteViewManager()
{
// kDebug(14000) ;
// qCDebug(LIBKOPETE_LOG) ;
//delete all open chatwindow.
SessionMap::Iterator it;
......@@ -179,7 +179,7 @@ void KopeteViewManager::slotPrefsChanged()
KopeteView *KopeteViewManager::view(Kopete::ChatSession *session, const QString &requestedPlugin)
{
// kDebug(14000) ;
// qCDebug(LIBKOPETE_LOG) ;
if (d->sessionMap.contains(session) && d->sessionMap[ session ]) {
return d->sessionMap[ session ];
......@@ -192,7 +192,7 @@ KopeteView *KopeteViewManager::view(Kopete::ChatSession *session, const QString
viewPlugin = (Kopete::ViewPlugin *)pluginManager->loadPlugin(pluginName);
if (!viewPlugin) {
kWarning(14000) << "Requested view plugin, " << pluginName
qCWarning(LIBKOPETE_LOG) << "Requested view plugin, " << pluginName
<< ", was not found. Falling back to chat window plugin" << endl;
}
}
......@@ -212,7 +212,7 @@ KopeteView *KopeteViewManager::view(Kopete::ChatSession *session, const QString
return newView;
} else {
kError(14000) << "Could not create a view, no plugins available!" << endl;
qCCritical(LIBKOPETE_LOG) << "Could not create a view, no plugins available!" << endl;
return nullptr;
}
}
......@@ -440,7 +440,7 @@ void KopeteViewManager::slotEventDeleted(Kopete::MessageEvent *event)
// d->eventList.remove( event );
d->eventList.removeAll(event);
// kDebug(14000) ;
// qCDebug(LIBKOPETE_LOG) ;
Kopete::ChatSession *kmm = event->message().manager();
if (!kmm) {
// this can be NULL for example if KopeteViewManager::slotViewActivated()
......
......@@ -20,7 +20,7 @@
#include <QtCore/QPointer>
// KDE includes
#include <kdebug.h>
#include "libkopete_debug.h"
// Kopete includes
#include <kopetecontact.h>
......
......@@ -19,7 +19,7 @@
// Qt includes
// KDE includes
#include <kdebug.h>
#include "libkopete_debug.h"
// Kopete includes
#include <kopeteaccount.h>
......
......@@ -18,7 +18,7 @@
#include "kopetetask.h"
#include <kdebug.h>
#include "libkopete_debug.h"
namespace Kopete {
class Task::Private
......
......@@ -30,7 +30,7 @@
#include <kcomponentdata.h>
#include <kprocess.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include "kopeteaccount_mock.h"
#include "kopeteprotocol_mock.h"
......@@ -264,11 +264,11 @@ void KopeteMessage_Test::testLinkParser()
// if the test case begins with broken, we expect it to fail, then use XFAIL
// otherwise use QCOMPARE
if (fileName.section('-', 0, 0) == QString::fromLatin1("broken")) {
//kDebug() << "checking known-broken testcase: " << fileName;
//qCDebug(LIBKOPETE_LOG) << "checking known-broken testcase: " << fileName;
QEXPECT_FAIL("", "Checking know-broken testcase", Continue);
QCOMPARE(result, expectedData);
} else {
//kDebug() << "checking known-working testcase: " << fileName;
//qCDebug(LIBKOPETE_LOG) << "checking known-working testcase: " << fileName;
QCOMPARE(result, expectedData);
}
} else {
......
......@@ -23,7 +23,7 @@
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <kdebug.h>
#include "libkopete_debug.h"
#include <kglobal.h>
#include <klocale.h>
......
......@@ -21,7 +21,7 @@
#include <QTimer>
#include <kcmdlineargs.h>
#include <kdebug.h>