From: Ivailo Monev Date: Tue, 27 Jan 2015 19:41:25 +0000 (+0000) Subject: kuassel: replace custom logger with KDE debbuging infrastructure X-Git-Tag: 4.22.0~1116 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=90934716e100743ff5895ab7a8ce38d00b9575d4;p=kde%2Fkde-extraapps.git kuassel: replace custom logger with KDE debbuging infrastructure --- diff --git a/kuassel/CMakeLists.txt b/kuassel/CMakeLists.txt index cb7cf1ea..8e95909b 100644 --- a/kuassel/CMakeLists.txt +++ b/kuassel/CMakeLists.txt @@ -144,10 +144,6 @@ if (HAVE_SSL) endif() add_feature_info("SSL support in Qt" HAVE_SSL "Use secure network connections") -# Check for syslog support -check_include_file(syslog.h HAVE_SYSLOG) -add_feature_info("syslog.h" HAVE_SYSLOG "Provide support for logging to the syslog") - # Various settings ################## diff --git a/kuassel/src/CMakeLists.txt b/kuassel/src/CMakeLists.txt index 6cefe2d5..0e56684f 100644 --- a/kuassel/src/CMakeLists.txt +++ b/kuassel/src/CMakeLists.txt @@ -13,13 +13,6 @@ include_directories(BEFORE qtui) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) # for version.gen -# Needed for showing the cli option if appropriate -if (HAVE_SYSLOG) - add_definitions(-DHAVE_SYSLOG) -endif() - -include_directories(${KDE4_INCLUDES}) - add_executable(kuassel WIN32 common/main.cpp qtui/monoapplication.cpp ${CLIENT_DEPS} ${CORE_DEPS} ${COMMON_DEPS}) # qt4_use_modules(kuassel Core Gui Network ${CLIENT_QT_MODULES} ${CORE_QT_MODULES}) set_target_properties(kuassel PROPERTIES diff --git a/kuassel/src/client/backlogrequester.cpp b/kuassel/src/client/backlogrequester.cpp index 510115a7..d4373c34 100644 --- a/kuassel/src/client/backlogrequester.cpp +++ b/kuassel/src/client/backlogrequester.cpp @@ -69,7 +69,7 @@ BufferIdList BacklogRequester::allBufferIds() const void BacklogRequester::flushBuffer() { if (!_buffersWaiting.isEmpty()) { - qWarning() << Q_FUNC_INFO << "was called before all backlog was received:" + kWarning(300000) << Q_FUNC_INFO << "was called before all backlog was received:" << _buffersWaiting.count() << "buffers are waiting."; } _bufferedMessages.clear(); diff --git a/kuassel/src/client/buffermodel.cpp b/kuassel/src/client/buffermodel.cpp index 8432625c..f4c22480 100644 --- a/kuassel/src/client/buffermodel.cpp +++ b/kuassel/src/client/buffermodel.cpp @@ -114,7 +114,7 @@ void BufferModel::switchToBufferIndex(const QModelIndex &bufferIdx) return; } - qWarning() << "BufferModel::switchToBufferIndex(const QModelIndex &):" << bufferIdx << "does not belong to BufferModel or NetworkModel"; + kWarning(300000) << "BufferModel::switchToBufferIndex(const QModelIndex &):" << bufferIdx << "does not belong to BufferModel or NetworkModel"; } @@ -125,7 +125,7 @@ void BufferModel::switchToOrJoinBuffer(NetworkId networkId, const QString &name, QModelIndex targetIdx = Client::networkModel()->bufferIndex(bufId); switchToBuffer(bufId); if (!targetIdx.data(NetworkModel::ItemActiveRole).toBool()) { - qDebug() << "switchToOrJoinBuffer failed to switch even though bufId:" << bufId << "is valid."; + kDebug(300000) << "switchToOrJoinBuffer failed to switch even though bufId:" << bufId << "is valid."; Client::userInput(BufferInfo::fakeStatusBuffer(networkId), QString(isQuery ? "/QUERY %1" : "/JOIN %1").arg(name)); } } @@ -139,7 +139,7 @@ void BufferModel::switchToOrJoinBuffer(NetworkId networkId, const QString &name, void BufferModel::debug_currentChanged(QModelIndex current, QModelIndex previous) { Q_UNUSED(previous); - qDebug() << "Switched current Buffer: " << current << current.data().toString() << "Buffer:" << current.data(NetworkModel::BufferIdRole).value(); + kDebug(300000) << "Switched current Buffer: " << current << current.data().toString() << "Buffer:" << current.data(NetworkModel::BufferIdRole).value(); } diff --git a/kuassel/src/client/bufferviewoverlay.cpp b/kuassel/src/client/bufferviewoverlay.cpp index 106c7cc1..41e3b3b4 100644 --- a/kuassel/src/client/bufferviewoverlay.cpp +++ b/kuassel/src/client/bufferviewoverlay.cpp @@ -83,7 +83,7 @@ void BufferViewOverlay::addView(int viewId) BufferViewConfig *config = Client::bufferViewManager()->bufferViewConfig(viewId); if (!config) { - qDebug() << "BufferViewOverlay::addView(): no such buffer view:" << viewId; + kDebug(300000) << "BufferViewOverlay::addView(): no such buffer view:" << viewId; return; } @@ -158,7 +158,7 @@ void BufferViewOverlay::removeView(int viewId) void BufferViewOverlay::viewInitialized(BufferViewConfig *config) { if (!config) { - qWarning() << "BufferViewOverlay::viewInitialized() received invalid view!"; + kWarning(300000) << "BufferViewOverlay::viewInitialized() received invalid view!"; return; } disconnect(config, SIGNAL(initDone()), this, SLOT(viewInitialized())); diff --git a/kuassel/src/client/client.cpp b/kuassel/src/client/client.cpp index 8acb423e..0da5e4a1 100644 --- a/kuassel/src/client/client.cpp +++ b/kuassel/src/client/client.cpp @@ -225,7 +225,7 @@ void Client::updateNetwork(const NetworkInfo &info) { Network *netptr = instance()->_networks.value(info.networkId, 0); if (!netptr) { - qWarning() << "Update for unknown network requested:" << info; + kWarning(300000) << "Update for unknown network requested:" << info; return; } netptr->requestSetNetworkInfo(info); @@ -246,7 +246,7 @@ void Client::addNetwork(Network *net) void Client::coreNetworkCreated(NetworkId id) { if (_networks.contains(id)) { - qWarning() << "Creation of already existing network requested!"; + kWarning(300000) << "Creation of already existing network requested!"; return; } Network *net = new Network(id, this); @@ -294,7 +294,7 @@ void Client::updateIdentity(IdentityId id, const QVariantMap &ser) { Identity *idptr = instance()->_identities.value(id, 0); if (!idptr) { - qWarning() << "Update for unknown identity requested:" << id; + kWarning(300000) << "Update for unknown identity requested:" << id; return; } idptr->requestUpdate(ser); @@ -317,7 +317,7 @@ void Client::coreIdentityCreated(const Identity &other) emit identityCreated(other.id()); } else { - qWarning() << i18n("Identity already exists in client!"); + kWarning(300000) << i18n("Identity already exists in client!"); } } diff --git a/kuassel/src/client/clientauthhandler.cpp b/kuassel/src/client/clientauthhandler.cpp index 07e2355c..979def53 100644 --- a/kuassel/src/client/clientauthhandler.cpp +++ b/kuassel/src/client/clientauthhandler.cpp @@ -158,7 +158,7 @@ void ClientAuthHandler::onSocketDisconnected() void ClientAuthHandler::onSocketConnected() { if (_peer) { - qWarning() << Q_FUNC_INFO << "Peer already exists!"; + kWarning(300000) << Q_FUNC_INFO << "Peer already exists!"; return; } @@ -195,7 +195,7 @@ void ClientAuthHandler::onSocketConnected() // If we arrive here, it's the second connection attempt, meaning probing was not successful -> enable legacy support - qDebug() << "Legacy core detected, switching to compatibility mode"; + kDebug(300000) << "Legacy core detected, switching to compatibility mode"; RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(Protocol::LegacyProtocol, 0), this, socket(), Compressor::NoCompression, this); // Only needed for the legacy peer, as all others check the protocol version before instantiation @@ -232,7 +232,7 @@ void ClientAuthHandler::onReadyRead() RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(type, protoFeatures), this, socket(), level, this); if (!peer) { - qWarning() << "No valid protocol supported for this core!"; + kWarning(300000) << "No valid protocol supported for this core!"; emit errorPopup(i18n("Incompatible Quassel Core!
" "None of the protocols this client speaks are supported by the core you are trying to connect to.")); @@ -259,7 +259,7 @@ void ClientAuthHandler::onProtocolVersionMismatch(int actual, int expected) void ClientAuthHandler::setPeer(RemotePeer *peer) { - qDebug().nospace() << "Using " << qPrintable(peer->protocolName()) << "..."; + kDebug(300000).nospace() << "Using " << qPrintable(peer->protocolName()) << "..."; _peer = peer; connect(_peer, SIGNAL(transferProgress(int,int)), SIGNAL(transferProgress(int,int))); @@ -408,7 +408,7 @@ void ClientAuthHandler::checkAndEnableSsl(bool coreSupportsSsl) Q_ASSERT(sslSocket); connect(sslSocket, SIGNAL(encrypted()), SLOT(onSslSocketEncrypted())); connect(sslSocket, SIGNAL(sslErrors(QList)), SLOT(onSslErrors())); - qDebug() << "Starting encryption..."; + kDebug(300000) << "Starting encryption..."; sslSocket->flush(); sslSocket->startClientEncryption(); } diff --git a/kuassel/src/client/clientbacklogmanager.cpp b/kuassel/src/client/clientbacklogmanager.cpp index 426af5e1..02f0429c 100644 --- a/kuassel/src/client/clientbacklogmanager.cpp +++ b/kuassel/src/client/clientbacklogmanager.cpp @@ -27,7 +27,7 @@ #include -#include +#include INIT_SYNCABLE_OBJECT(ClientBacklogManager) ClientBacklogManager::ClientBacklogManager(QObject *parent) @@ -91,7 +91,7 @@ void ClientBacklogManager::requestInitialBacklog() { if (_initBacklogRequested) { Q_ASSERT(_requester); - qWarning() << "ClientBacklogManager::requestInitialBacklog() called twice in the same session! (Backlog has already been requested)"; + kWarning(300000) << "ClientBacklogManager::requestInitialBacklog() called twice in the same session! (Backlog has already been requested)"; return; } @@ -138,7 +138,7 @@ void ClientBacklogManager::checkForBacklog(const QList &bufferIds) if (!_requester) { // during client start up this message is to be expected in some situations. - qDebug() << "ClientBacklogManager::checkForBacklog(): no active backlog requester."; + kDebug(300000) << "ClientBacklogManager::checkForBacklog(): no active backlog requester."; return; } switch (_requester->type()) { diff --git a/kuassel/src/client/clientignorelistmanager.cpp b/kuassel/src/client/clientignorelistmanager.cpp index d13ce71b..bc3e2e22 100644 --- a/kuassel/src/client/clientignorelistmanager.cpp +++ b/kuassel/src/client/clientignorelistmanager.cpp @@ -53,7 +53,7 @@ QMap ClientIgnoreListManager::matchingRulesForHostmask(const QStr && ((network.isEmpty() && channel.isEmpty()) || item.scope == GlobalScope || (item.scope == NetworkScope && scopeMatch(item.scopeRule, network)) || (item.scope == ChannelScope && scopeMatch(item.scopeRule, channel)))) { result[item.ignoreRule] = item.isActive; -// qDebug() << "matchingRulesForHostmask found: " << item.ignoreRule << "is active: " << item.isActive; +// kDebug(300000) << "matchingRulesForHostmask found: " << item.ignoreRule << "is active: " << item.isActive; } } return result; diff --git a/kuassel/src/client/clienttransfer.cpp b/kuassel/src/client/clienttransfer.cpp index 9f70e637..0a1b0a53 100644 --- a/kuassel/src/client/clienttransfer.cpp +++ b/kuassel/src/client/clienttransfer.cpp @@ -70,7 +70,7 @@ void ClientTransfer::dataReceived(PeerPtr, const QByteArray &data) if (!_file) { _file = new QFile(_savePath, this); if (!_file->open(QFile::WriteOnly|QFile::Truncate)) { - qWarning() << Q_FUNC_INFO << "Could not open file:" << _file->errorString(); + kWarning(300000) << Q_FUNC_INFO << "Could not open file:" << _file->errorString(); return; } } @@ -79,7 +79,7 @@ void ClientTransfer::dataReceived(PeerPtr, const QByteArray &data) return; if (_file->write(data) < 0) { - qWarning() << Q_FUNC_INFO << "Could not write to file:" << _file->errorString(); + kWarning(300000) << Q_FUNC_INFO << "Could not write to file:" << _file->errorString(); return; } } diff --git a/kuassel/src/client/clienttransfermanager.cpp b/kuassel/src/client/clienttransfermanager.cpp index 1860e481..68ff6e36 100644 --- a/kuassel/src/client/clienttransfermanager.cpp +++ b/kuassel/src/client/clienttransfermanager.cpp @@ -41,7 +41,7 @@ const ClientTransfer *ClientTransferManager::transfer(const QUuid &uuid) const void ClientTransferManager::onCoreTransferAdded(const QUuid &uuid) { if (uuid.isNull()) { - qWarning() << Q_FUNC_INFO << "Invalid transfer uuid" << uuid.toString(); + kWarning(300000) << Q_FUNC_INFO << "Invalid transfer uuid" << uuid.toString(); return; } @@ -63,7 +63,7 @@ void ClientTransferManager::onTransferAdded(const Transfer *transfer) { const ClientTransfer *t = qobject_cast(transfer); if (!t) { - qWarning() << "Invalid Transfer added to ClientTransferManager!"; + kWarning(300000) << "Invalid Transfer added to ClientTransferManager!"; return; } diff --git a/kuassel/src/client/coreaccountmodel.cpp b/kuassel/src/client/coreaccountmodel.cpp index c3e8b661..5d85d431 100644 --- a/kuassel/src/client/coreaccountmodel.cpp +++ b/kuassel/src/client/coreaccountmodel.cpp @@ -199,7 +199,7 @@ void CoreAccountModel::insertAccount(const CoreAccount &acc) { if (acc.isInternal()) { if (internalAccount().isValid()) { - qWarning() << "Trying to insert a second internal account in CoreAccountModel, ignoring"; + kWarning(300000) << "Trying to insert a second internal account in CoreAccountModel, ignoring"; return; } _internalAccount = acc.accountId(); diff --git a/kuassel/src/client/coreconnection.cpp b/kuassel/src/client/coreconnection.cpp index ee1b48c6..b4378e6e 100644 --- a/kuassel/src/client/coreconnection.cpp +++ b/kuassel/src/client/coreconnection.cpp @@ -175,7 +175,7 @@ void CoreConnection::solidNetworkStatusChanged(Solid::Networking::Status status) switch (status) { case Solid::Networking::Unknown: case Solid::Networking::Connected: - //qDebug() << "Solid: Network status changed to connected or unknown"; + //kDebug(300000) << "Solid: Network status changed to connected or unknown"; if (state() == Disconnected) { if (_wantReconnect && s.autoReconnect()) { reconnectToCore(); @@ -370,13 +370,13 @@ bool CoreConnection::connectToCore(AccountId accId) void CoreConnection::connectToCurrentAccount() { if (_authHandler) { - qWarning() << Q_FUNC_INFO << "Already connected!"; + kWarning(300000) << Q_FUNC_INFO << "Already connected!"; return; } if (currentAccount().isInternal()) { if (Quassel::runMode() != Quassel::Monolithic) { - qWarning() << "Cannot connect to internal core in client-only mode!"; + kWarning(300000) << "Cannot connect to internal core in client-only mode!"; return; } emit startInternalCore(); diff --git a/kuassel/src/client/networkmodel.cpp b/kuassel/src/client/networkmodel.cpp index 31e1dd30..b465618c 100644 --- a/kuassel/src/client/networkmodel.cpp +++ b/kuassel/src/client/networkmodel.cpp @@ -620,7 +620,7 @@ QString ChannelBufferItem::toolTip(int column) const void ChannelBufferItem::attachIrcChannel(IrcChannel *ircChannel) { if (_ircChannel) { - qWarning() << Q_FUNC_INFO << "IrcChannel already set; cleanup failed!?"; + kWarning(300000) << Q_FUNC_INFO << "IrcChannel already set; cleanup failed!?"; disconnect(_ircChannel, 0, this, 0); } @@ -731,7 +731,7 @@ void ChannelBufferItem::addUsersToCategory(const QList &ircUsers) void ChannelBufferItem::part(IrcUser *ircUser) { if (!ircUser) { - qWarning() << bufferName() << "ChannelBufferItem::part(): unknown User" << ircUser; + kWarning(300000) << bufferName() << "ChannelBufferItem::part(): unknown User" << ircUser; return; } @@ -792,7 +792,7 @@ void ChannelBufferItem::userModeChanged(IrcUser *ircUser) } if (!ircUserItem) { - qWarning() << "ChannelBufferItem::userModeChanged(IrcUser *): unable to determine old category of" << ircUser; + kWarning(300000) << "ChannelBufferItem::userModeChanged(IrcUser *): unable to determine old category of" << ircUser; return; } ircUserItem->reParent(categoryItem); @@ -1199,7 +1199,7 @@ MsgId NetworkModel::lastSeenMsgId(const BufferId &bufferId) { BufferItem *bufferItem = findBufferItem(bufferId); if (!bufferItem) { - qDebug() << "NetworkModel::lastSeenMsgId(): buffer is unknown:" << bufferId; + kDebug(300000) << "NetworkModel::lastSeenMsgId(): buffer is unknown:" << bufferId; Client::purgeKnownBufferIds(); return MsgId(); } @@ -1211,7 +1211,7 @@ void NetworkModel::setLastSeenMsgId(const BufferId &bufferId, const MsgId &msgId { BufferItem *bufferItem = findBufferItem(bufferId); if (!bufferItem) { - qDebug() << "NetworkModel::setLastSeenMsgId(): buffer is unknown:" << bufferId; + kDebug(300000) << "NetworkModel::setLastSeenMsgId(): buffer is unknown:" << bufferId; Client::purgeKnownBufferIds(); return; } @@ -1224,7 +1224,7 @@ void NetworkModel::setMarkerLineMsgId(const BufferId &bufferId, const MsgId &msg { BufferItem *bufferItem = findBufferItem(bufferId); if (!bufferItem) { - qDebug() << "NetworkModel::setMarkerLineMsgId(): buffer is unknown:" << bufferId; + kDebug(300000) << "NetworkModel::setMarkerLineMsgId(): buffer is unknown:" << bufferId; Client::purgeKnownBufferIds(); return; } @@ -1300,7 +1300,7 @@ void NetworkModel::setBufferActivity(const BufferId &bufferId, BufferInfo::Activ { BufferItem *bufferItem = findBufferItem(bufferId); if (!bufferItem) { - qDebug() << "NetworkModel::setBufferActivity(): buffer is unknown:" << bufferId; + kDebug(300000) << "NetworkModel::setBufferActivity(): buffer is unknown:" << bufferId; return; } bufferItem->setActivityLevel(level); @@ -1311,7 +1311,7 @@ void NetworkModel::clearBufferActivity(const BufferId &bufferId) { BufferItem *bufferItem = findBufferItem(bufferId); if (!bufferItem) { - qDebug() << "NetworkModel::clearBufferActivity(): buffer is unknown:" << bufferId; + kDebug(300000) << "NetworkModel::clearBufferActivity(): buffer is unknown:" << bufferId; return; } bufferItem->clearActivityLevel(); diff --git a/kuassel/src/client/selectionmodelsynchronizer.cpp b/kuassel/src/client/selectionmodelsynchronizer.cpp index b3d94805..6241c86e 100644 --- a/kuassel/src/client/selectionmodelsynchronizer.cpp +++ b/kuassel/src/client/selectionmodelsynchronizer.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include SelectionModelSynchronizer::SelectionModelSynchronizer(QAbstractItemModel *parent) : QObject(parent), @@ -58,7 +58,7 @@ bool SelectionModelSynchronizer::checkBaseModel(QItemSelectionModel *selectionMo void SelectionModelSynchronizer::synchronizeSelectionModel(QItemSelectionModel *selectionModel) { if (!checkBaseModel(selectionModel)) { - qWarning() << "cannot Synchronize SelectionModel" << selectionModel << "which has a different baseModel()"; + kWarning(300000) << "cannot Synchronize SelectionModel" << selectionModel << "which has a different baseModel()"; return; } diff --git a/kuassel/src/client/treemodel.cpp b/kuassel/src/client/treemodel.cpp index 33601995..3e74995e 100644 --- a/kuassel/src/client/treemodel.cpp +++ b/kuassel/src/client/treemodel.cpp @@ -21,7 +21,7 @@ #include "treemodel.h" #include -#include +#include #include "quassel.h" @@ -153,7 +153,7 @@ bool AbstractTreeItem::reParent(AbstractTreeItem *newParent) // currently we support only re parenting if the child that's about to be // adopted does not have any children itself. if (childCount() != 0) { - qDebug() << "AbstractTreeItem::reParent(): cannot reparent" << this << "with children."; + kDebug(300000) << "AbstractTreeItem::reParent(): cannot reparent" << this << "with children."; return false; } @@ -170,7 +170,7 @@ bool AbstractTreeItem::reParent(AbstractTreeItem *newParent) bool success = newParent->newChild(this); if (!success) - qWarning() << "AbstractTreeItem::reParent(): failed to attach to new parent after removing from old parent! this:" << this << "new parent:" << newParent; + kWarning(300000) << "AbstractTreeItem::reParent(): failed to attach to new parent after removing from old parent! this:" << this << "new parent:" << newParent; if (oldParent) oldParent->checkForDeletion(); @@ -200,30 +200,30 @@ int AbstractTreeItem::childCount(int column) const int AbstractTreeItem::row() const { if (!parent()) { - qWarning() << "AbstractTreeItem::row():" << this << "has no parent AbstractTreeItem as it's parent! parent is" << QObject::parent(); + kWarning(300000) << "AbstractTreeItem::row():" << this << "has no parent AbstractTreeItem as it's parent! parent is" << QObject::parent(); return -1; } int row_ = parent()->_childItems.indexOf(const_cast(this)); if (row_ == -1) - qWarning() << "AbstractTreeItem::row():" << this << "is not in the child list of" << QObject::parent(); + kWarning(300000) << "AbstractTreeItem::row():" << this << "is not in the child list of" << QObject::parent(); return row_; } void AbstractTreeItem::dumpChildList() { - qDebug() << "==== Childlist for Item:" << this << "===="; + kDebug(300000) << "==== Childlist for Item:" << this << "===="; if (childCount() > 0) { AbstractTreeItem *child; QList::const_iterator childIter = _childItems.constBegin(); while (childIter != _childItems.constEnd()) { child = *childIter; - qDebug() << "Row:" << child->row() << child << child->data(0, Qt::DisplayRole); + kDebug(300000) << "Row:" << child->row() << child << child->data(0, Qt::DisplayRole); childIter++; } } - qDebug() << "==== End Of Childlist ===="; + kDebug(300000) << "==== End Of Childlist ===="; } @@ -389,7 +389,7 @@ QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent) con QModelIndex TreeModel::indexByItem(AbstractTreeItem *item) const { if (item == 0) { - qWarning() << "TreeModel::indexByItem(AbstractTreeItem *item) received NULL-Pointer"; + kWarning(300000) << "TreeModel::indexByItem(AbstractTreeItem *item) received NULL-Pointer"; return QModelIndex(); } @@ -404,7 +404,7 @@ QModelIndex TreeModel::parent(const QModelIndex &index) const { if (!index.isValid()) { // ModelTest does this - // qWarning() << "TreeModel::parent(): has been asked for the rootItems Parent!"; + // kWarning(300000) << "TreeModel::parent(): has been asked for the rootItems Parent!"; return QModelIndex(); } @@ -532,7 +532,7 @@ void TreeModel::beginAppendChilds(int firstRow, int lastRow) { AbstractTreeItem *parentItem = qobject_cast(sender()); if (!parentItem) { - qWarning() << "TreeModel::beginAppendChilds(): cannot append Children to unknown parent"; + kWarning(300000) << "TreeModel::beginAppendChilds(): cannot append Children to unknown parent"; return; } @@ -549,7 +549,7 @@ void TreeModel::endAppendChilds() { AbstractTreeItem *parentItem = qobject_cast(sender()); if (!parentItem) { - qWarning() << "TreeModel::endAppendChilds(): cannot append Children to unknown parent"; + kWarning(300000) << "TreeModel::endAppendChilds(): cannot append Children to unknown parent"; return; } Q_ASSERT(_aboutToRemoveOrInsert); @@ -572,7 +572,7 @@ void TreeModel::beginRemoveChilds(int firstRow, int lastRow) { AbstractTreeItem *parentItem = qobject_cast(sender()); if (!parentItem) { - qWarning() << "TreeModel::beginRemoveChilds(): cannot append Children to unknown parent"; + kWarning(300000) << "TreeModel::beginRemoveChilds(): cannot append Children to unknown parent"; return; } @@ -596,7 +596,7 @@ void TreeModel::endRemoveChilds() { AbstractTreeItem *parentItem = qobject_cast(sender()); if (!parentItem) { - qWarning() << "TreeModel::endRemoveChilds(): cannot remove Children from unknown parent"; + kWarning(300000) << "TreeModel::endRemoveChilds(): cannot remove Children from unknown parent"; return; } @@ -622,7 +622,7 @@ void TreeModel::clear() void TreeModel::debug_rowsAboutToBeInserted(const QModelIndex &parent, int start, int end) { - qDebug() << "debug_rowsAboutToBeInserted" << parent << parent.internalPointer() << parent.data().toString() << rowCount(parent) << start << end; + kDebug(300000) << "debug_rowsAboutToBeInserted" << parent << parent.internalPointer() << parent.data().toString() << rowCount(parent) << start << end; } @@ -632,13 +632,13 @@ void TreeModel::debug_rowsAboutToBeRemoved(const QModelIndex &parent, int start, parentItem = static_cast(parent.internalPointer()); if (!parentItem) parentItem = rootItem; - qDebug() << "debug_rowsAboutToBeRemoved" << parent << parentItem << parent.data().toString() << rowCount(parent) << start << end; + kDebug(300000) << "debug_rowsAboutToBeRemoved" << parent << parentItem << parent.data().toString() << rowCount(parent) << start << end; QModelIndex child; for (int i = end; i >= start; i--) { child = parent.child(i, 0); Q_ASSERT(parentItem->child(i)); - qDebug() << ">>>" << i << child << child.data().toString(); + kDebug(300000) << ">>>" << i << child << child.data().toString(); } } @@ -649,32 +649,32 @@ void TreeModel::debug_rowsInserted(const QModelIndex &parent, int start, int end parentItem = static_cast(parent.internalPointer()); if (!parentItem) parentItem = rootItem; - qDebug() << "debug_rowsInserted:" << parent << parentItem << parent.data().toString() << rowCount(parent) << start << end; + kDebug(300000) << "debug_rowsInserted:" << parent << parentItem << parent.data().toString() << rowCount(parent) << start << end; QModelIndex child; for (int i = start; i <= end; i++) { child = parent.child(i, 0); Q_ASSERT(parentItem->child(i)); - qDebug() << "<<<" << i << child << child.data().toString(); + kDebug(300000) << "<<<" << i << child << child.data().toString(); } } void TreeModel::debug_rowsRemoved(const QModelIndex &parent, int start, int end) { - qDebug() << "debug_rowsRemoved" << parent << parent.internalPointer() << parent.data().toString() << rowCount(parent) << start << end; + kDebug(300000) << "debug_rowsRemoved" << parent << parent.internalPointer() << parent.data().toString() << rowCount(parent) << start << end; } void TreeModel::debug_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { - qDebug() << "debug_dataChanged" << topLeft << bottomRight; + kDebug(300000) << "debug_dataChanged" << topLeft << bottomRight; QStringList displayData; for (int row = topLeft.row(); row <= bottomRight.row(); row++) { displayData = QStringList(); for (int column = topLeft.column(); column <= bottomRight.column(); column++) { displayData << data(topLeft.sibling(row, column), Qt::DisplayRole).toString(); } - qDebug() << " row:" << row << displayData; + kDebug(300000) << " row:" << row << displayData; } } diff --git a/kuassel/src/common/CMakeLists.txt b/kuassel/src/common/CMakeLists.txt index 88114fe1..3954e634 100644 --- a/kuassel/src/common/CMakeLists.txt +++ b/kuassel/src/common/CMakeLists.txt @@ -21,7 +21,6 @@ set(SOURCES ircevent.cpp irclisthelper.cpp ircuser.cpp - logger.cpp message.cpp messageevent.cpp network.cpp @@ -53,10 +52,6 @@ endif() include_directories(${ZLIB_INCLUDE_DIRS}) -if (HAVE_SYSLOG) - add_definitions(-DHAVE_SYSLOG) -endif() - if (EXECINFO_FOUND) add_definitions(-DHAVE_EXECINFO) include_directories(${EXECINFO_INCLUDES}) diff --git a/kuassel/src/common/aliasmanager.cpp b/kuassel/src/common/aliasmanager.cpp index 94985bba..39ac3bf6 100644 --- a/kuassel/src/common/aliasmanager.cpp +++ b/kuassel/src/common/aliasmanager.cpp @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include +#include #include #include "aliasmanager.h" @@ -69,7 +69,7 @@ void AliasManager::initSetAliases(const QVariantMap &aliases) QStringList expansions = aliases["expansions"].toStringList(); if (names.count() != expansions.count()) { - qWarning() << "AliasesManager::initSetAliases: received" << names.count() << "alias names but only" << expansions.count() << "expansions!"; + kWarning(300000) << "AliasesManager::initSetAliases: received" << names.count() << "alias names but only" << expansions.count() << "expansions!"; return; } diff --git a/kuassel/src/common/authhandler.cpp b/kuassel/src/common/authhandler.cpp index 7c2905dd..8c4a71c5 100644 --- a/kuassel/src/common/authhandler.cpp +++ b/kuassel/src/common/authhandler.cpp @@ -20,6 +20,8 @@ #include +#include + #include "authhandler.h" AuthHandler::AuthHandler(QObject *parent) @@ -81,7 +83,7 @@ void AuthHandler::onSocketDisconnected() void AuthHandler::invalidMessage() { - qWarning() << Q_FUNC_INFO << "No handler for message!"; + kWarning(300000) << Q_FUNC_INFO << "No handler for message!"; } diff --git a/kuassel/src/common/basichandler.cpp b/kuassel/src/common/basichandler.cpp index 42841c42..516a19b0 100644 --- a/kuassel/src/common/basichandler.cpp +++ b/kuassel/src/common/basichandler.cpp @@ -22,7 +22,7 @@ #include -#include "logger.h" +#include BasicHandler::BasicHandler(QObject *parent) : QObject(parent), @@ -89,7 +89,7 @@ void BasicHandler::handle(const QString &member, QGenericArgument val0, if (!handlerHash().contains(handler)) { if (_defaultHandler == -1) { - qWarning() << QString("No such Handler: %1::%2%3").arg(metaObject()->className(), _methodPrefix, handler); + kWarning(300000) << QString("No such Handler: %1::%2%3").arg(metaObject()->className(), _methodPrefix, handler); return; } else { diff --git a/kuassel/src/common/bufferinfo.cpp b/kuassel/src/common/bufferinfo.cpp index 5ff7f1fc..8913684d 100644 --- a/kuassel/src/common/bufferinfo.cpp +++ b/kuassel/src/common/bufferinfo.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include "bufferinfo.h" diff --git a/kuassel/src/common/cliparser.cpp b/kuassel/src/common/cliparser.cpp index 5168ea22..61e1fc1d 100644 --- a/kuassel/src/common/cliparser.cpp +++ b/kuassel/src/common/cliparser.cpp @@ -21,7 +21,7 @@ #include "cliparser.h" #include -#include +#include #include #include @@ -36,9 +36,9 @@ void CliParser::addArgument(const QString &longName_, const CliParserArg &arg) { QString longName = longName_; longName.remove(QRegExp("\\s*<.*>\\s*")); // KCmdLineArgs takes args of the form "arg " - if (argsMap.contains(longName)) qWarning() << "Warning: Multiple definition of argument" << longName; + if (argsMap.contains(longName)) kWarning(300000) << "Warning: Multiple definition of argument" << longName; if (arg.shortName != 0 && !lnameOfShortArg(arg.shortName).isNull()) - qWarning().nospace() << "Warning: Redefining shortName '" << arg.shortName << "' for " << longName << " previously defined for " << lnameOfShortArg(arg.shortName); + kWarning(300000).nospace() << "Warning: Redefining shortName '" << arg.shortName << "' for " << longName << " previously defined for " << lnameOfShortArg(arg.shortName); argsMap.insert(longName, arg); } @@ -55,7 +55,7 @@ bool CliParser::addLongArg(const CliParserArg::CliArgType type, const QString &n return true; } } - qWarning() << "Warning: Unrecognized argument:" << name; + kWarning(300000) << "Warning: Unrecognized argument:" << name; return false; } @@ -75,12 +75,12 @@ bool CliParser::addShortArg(const CliParserArg::CliArgType type, const char shor } // arg is an option but detected as a switch -> argument is missing else { - qWarning().nospace() << "Warning: '" << shortName << "' is an option which needs an argument"; + kWarning(300000).nospace() << "Warning: '" << shortName << "' is an option which needs an argument"; return false; } } } - qWarning().nospace() << "Warning: Unrecognized argument: '" << shortName << "'"; + kWarning(300000).nospace() << "Warning: Unrecognized argument: '" << shortName << "'"; return false; } @@ -136,7 +136,7 @@ bool CliParser::init(const QStringList &args) // option // short options are not freely mixable with other shortargs if (currentArg->mid(1).toLatin1().size() > 1) { - qWarning() << "Warning: Shortoptions may not be combined with other shortoptions or switches"; + kWarning(300000) << "Warning: Shortoptions may not be combined with other shortoptions or switches"; return false; } QString value; @@ -213,7 +213,7 @@ QString CliParser::value(const QString &longName) return argsMap.value(longName).def; } else { - qWarning() << "Warning: Requested value of not defined argument" << longName << "or argument is a switch"; + kWarning(300000) << "Warning: Requested value of not defined argument" << longName << "or argument is a switch"; return QString(); } } @@ -226,7 +226,7 @@ bool CliParser::isSet(const QString &longName) else return argsMap.value(longName).boolValue; } else { - qWarning() << "Warning: Requested isSet of not defined argument" << longName; + kWarning(300000) << "Warning: Requested isSet of not defined argument" << longName; return false; } } diff --git a/kuassel/src/common/compressor.cpp b/kuassel/src/common/compressor.cpp index c1e3d67d..68acf68d 100644 --- a/kuassel/src/common/compressor.cpp +++ b/kuassel/src/common/compressor.cpp @@ -23,6 +23,8 @@ #include #include +#include + #include const int maxBufferSize = 64 * 1024 * 1024; // protect us from zip bombs @@ -85,21 +87,21 @@ bool Compressor::initStreams() _inflater = new z_stream; memset(_inflater, 0, sizeof(z_stream)); if (Z_OK != inflateInit(_inflater)) { - qWarning() << "Could not initialize the inflate stream!"; + kWarning(300000) << "Could not initialize the inflate stream!"; return false; } _deflater = new z_stream; memset(_deflater, 0, sizeof(z_stream)); if (Z_OK != deflateInit(_deflater, zlevel)) { - qWarning() << "Could not intialize the deflate stream!"; + kWarning(300000) << "Could not intialize the deflate stream!"; return false; } _inputBuffer.reserve(ioBufferSize); // pre-allocate space _outputBuffer.resize(ioBufferSize); // not a typo; we never change the size of this buffer anyway (we *do* for _inputBuffer!) - qDebug() << "Enabling compression..."; + kDebug(300000) << "Enabling compression..."; return true; } @@ -198,21 +200,21 @@ void Compressor::readData() case Z_DATA_ERROR: case Z_MEM_ERROR: case Z_STREAM_ERROR: - qWarning() << "Error while decompressing stream:" << status; + kWarning(300000) << "Error while decompressing stream:" << status; emit error(StreamError); return; case Z_BUF_ERROR: // means that we need more input to continue, so this is not an actual error return; case Z_STREAM_END: - qWarning() << "Reached end of zlib stream!"; // this should really never happen + kWarning(300000) << "Reached end of zlib stream!"; // this should really never happen return; default: // just try to get more out of the stream break; } } - //qDebug() << "inflate in:" << _inflater->total_in << "out:" << _inflater->total_out << "ratio:" << (double)_inflater->total_in/_inflater->total_out; + //kDebug(300000) << "inflate in:" << _inflater->total_in << "out:" << _inflater->total_out << "ratio:" << (double)_inflater->total_in/_inflater->total_out; } @@ -233,7 +235,7 @@ void Compressor::writeData() _deflater->avail_out = ioBufferSize; status = deflate(_deflater, Z_PARTIAL_FLUSH); if (status != Z_OK && status != Z_BUF_ERROR) { - qWarning() << "Error while compressing stream:" << status; + kWarning(300000) << "Error while compressing stream:" << status; emit error(StreamError); return; } @@ -242,20 +244,20 @@ void Compressor::writeData() continue; // nothing to write here if (!_socket->write(_outputBuffer.constData(), ioBufferSize - _deflater->avail_out)) { - qWarning() << "Error while writing to socket:" << _socket->errorString(); + kWarning(300000) << "Error while writing to socket:" << _socket->errorString(); emit error(DeviceError); return; } } while (_deflater->avail_out == 0); // the output buffer being full is the only reason we should have to loop here! if (_deflater->avail_in > 0) { - qWarning() << "Oops, something weird happened: data still remaining in write buffer!"; + kWarning(300000) << "Oops, something weird happened: data still remaining in write buffer!"; emit error(StreamError); } _writeBuffer.resize(0); - //qDebug() << "deflate in:" << _deflater->total_in << "out:" << _deflater->total_out << "ratio:" << (double)_deflater->total_out/_deflater->total_in; + //kDebug(300000) << "deflate in:" << _deflater->total_in << "out:" << _deflater->total_out << "ratio:" << (double)_deflater->total_out/_deflater->total_in; } diff --git a/kuassel/src/common/event.cpp b/kuassel/src/common/event.cpp index 1abea9f9..c74e3bfd 100644 --- a/kuassel/src/common/event.cpp +++ b/kuassel/src/common/event.cpp @@ -35,7 +35,7 @@ Event::Event(EventManager::EventType type, QVariantMap &map) , _valid(true) { if (!map.contains("flags") || !map.contains("timestamp")) { - qWarning() << "Received invalid serialized event:" << map; + kWarning(300000) << "Received invalid serialized event:" << map; setValid(false); return; } @@ -66,7 +66,7 @@ Event *Event::fromVariantMap(QVariantMap &map, Network *network) int inttype = map.take("type").toInt(); // sanity check if we have a valid enum value if (EventManager::enumName(inttype).isEmpty()) { - qWarning() << "Received a serialized event with unknown type" << inttype; + kWarning(300000) << "Received a serialized event with unknown type" << inttype; return 0; } @@ -101,12 +101,12 @@ Event *Event::fromVariantMap(QVariantMap &map, Network *network) } if (!e) { - qWarning() << "Can't create event of type" << type; + kWarning(300000) << "Can't create event of type" << type; return 0; } if (!map.isEmpty()) { - qWarning() << "Event creation from map did not consume all data:" << map; + kWarning(300000) << "Event creation from map did not consume all data:" << map; } return e; diff --git a/kuassel/src/common/event.h b/kuassel/src/common/event.h index fbca50e2..f2a00292 100644 --- a/kuassel/src/common/event.h +++ b/kuassel/src/common/event.h @@ -22,7 +22,7 @@ #define EVENT_H #include -#include +#include #include "eventmanager.h" diff --git a/kuassel/src/common/eventmanager.cpp b/kuassel/src/common/eventmanager.cpp index 203ad8a2..28608057 100644 --- a/kuassel/src/common/eventmanager.cpp +++ b/kuassel/src/common/eventmanager.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include "event.h" #include "ircevent.h" @@ -128,7 +128,7 @@ int EventManager::findEventType(const QString &methodSignature_, const QString & QString numericSig = methodSignature.left(methodSignature.length() - 3) + "Numeric"; eventType = eventEnum().keyToValue(numericSig.toLatin1()); if (eventType < 0) { - qWarning() << Q_FUNC_INFO << "Could not find EventType" << numericSig << "for handling" << methodSignature; + kWarning(300000) << Q_FUNC_INFO << "Could not find EventType" << numericSig << "for handling" << methodSignature; return -1; } eventType += num; @@ -138,7 +138,7 @@ int EventManager::findEventType(const QString &methodSignature_, const QString & if (eventType < 0) eventType = eventEnum().keyToValue(methodSignature.toLatin1()); if (eventType < 0) { - qWarning() << Q_FUNC_INFO << "Could not find EventType" << methodSignature; + kWarning(300000) << Q_FUNC_INFO << "Could not find EventType" << methodSignature; return -1; } return eventType; @@ -158,13 +158,13 @@ void EventManager::registerObject(QObject *object, Priority priority, const QStr if (eventType > 0) { Handler handler(object, i, priority); registeredHandlers()[eventType].append(handler); - //qDebug() << "Registered event handler for" << methodSignature << "in" << object; + //kDebug(300000) << "Registered event handler for" << methodSignature << "in" << object; } eventType = findEventType(methodSignature, filterPrefix); if (eventType > 0) { Handler handler(object, i, priority); registeredFilters()[eventType].append(handler); - //qDebug() << "Registered event filterer for" << methodSignature << "in" << object; + //kDebug(300000) << "Registered event filterer for" << methodSignature << "in" << object; } } } @@ -192,18 +192,18 @@ void EventManager::registerEventHandler(QList events, QObject *object { int methodIndex = object->metaObject()->indexOfMethod(slot); if (methodIndex < 0) { - qWarning() << Q_FUNC_INFO << QString("Slot %1 not found in object %2").arg(slot).arg(object->objectName()); + kWarning(300000) << Q_FUNC_INFO << QString("Slot %1 not found in object %2").arg(slot).arg(object->objectName()); return; } Handler handler(object, methodIndex, priority); foreach(EventType event, events) { if (isFilter) { registeredFilters()[event].append(handler); - qDebug() << "Registered event filter for" << event << "in" << object; + kDebug(300000) << "Registered event filter for" << event << "in" << object; } else { registeredHandlers()[event].append(handler); - qDebug() << "Registered event handler for" << event << "in" << object; + kDebug(300000) << "Registered event handler for" << event << "in" << object; } } } @@ -249,7 +249,7 @@ void EventManager::processEvent(Event *event) void EventManager::dispatchEvent(Event *event) { - //qDebug() << "Dispatching" << event; + //kDebug(300000) << "Dispatching" << event; // we try handlers from specialized to generic by masking the enum @@ -265,7 +265,7 @@ void EventManager::dispatchEvent(Event *event) if ((type & ~IrcEventNumericMask) == IrcEventNumeric) { ::IrcEventNumeric *numEvent = static_cast< ::IrcEventNumeric *>(event); if (!numEvent) - qWarning() << "Invalid event type for IrcEventNumeric!"; + kWarning(300000) << "Invalid event type for IrcEventNumeric!"; else { int num = numEvent->number(); if (num > 0) { diff --git a/kuassel/src/common/identity.cpp b/kuassel/src/common/identity.cpp index 105cb0e1..d59afe5e 100644 --- a/kuassel/src/common/identity.cpp +++ b/kuassel/src/common/identity.cpp @@ -300,7 +300,7 @@ bool Identity::operator==(const Identity &other) const QMetaProperty metaProp = staticMetaObject.property(idx); Q_ASSERT(metaProp.isValid()); QVariant v1 = this->property(metaProp.name()); - QVariant v2 = other.property(metaProp.name()); // qDebug() << v1 << v2; + QVariant v2 = other.property(metaProp.name()); // kDebug(300000) << v1 << v2; // QVariant cannot compare custom types, so we need to check for this special case if (QString(v1.typeName()) == "IdentityId") { if (v1.value() != v2.value()) return false; diff --git a/kuassel/src/common/ignorelistmanager.cpp b/kuassel/src/common/ignorelistmanager.cpp index 845af07c..d4208c98 100644 --- a/kuassel/src/common/ignorelistmanager.cpp +++ b/kuassel/src/common/ignorelistmanager.cpp @@ -21,7 +21,7 @@ #include "ignorelistmanager.h" #include -#include +#include #include INIT_SYNCABLE_OBJECT(IgnoreListManager) @@ -91,7 +91,7 @@ void IgnoreListManager::initSetIgnoreList(const QVariantMap &ignoreList) int count = ignoreRule.count(); if (count != scopeRule.count() || count != isRegEx.count() || count != scope.count() || count != strictness.count() || count != ignoreType.count() || count != isActive.count()) { - qWarning() << "Corrupted IgnoreList settings! (Count missmatch)"; + kWarning(300000) << "Corrupted IgnoreList settings! (Count missmatch)"; return; } @@ -144,14 +144,14 @@ IgnoreListManager::StrictnessType IgnoreListManager::_match(const QString &msgCo else str = msgSender; -// qDebug() << "IgnoreListManager::match: "; -// qDebug() << "string: " << str; -// qDebug() << "pattern: " << ruleRx.pattern(); -// qDebug() << "scopeRule: " << item.scopeRule; -// qDebug() << "now testing"; +// kDebug(300000) << "IgnoreListManager::match: "; +// kDebug(300000) << "string: " << str; +// kDebug(300000) << "pattern: " << ruleRx.pattern(); +// kDebug(300000) << "scopeRule: " << item.scopeRule; +// kDebug(300000) << "now testing"; if ((!item.isRegEx && item.regEx.exactMatch(str)) || (item.isRegEx && item.regEx.indexIn(str) != -1)) { -// qDebug() << "MATCHED!"; +// kDebug(300000) << "MATCHED!"; return item.strictness; } } diff --git a/kuassel/src/common/internalpeer.cpp b/kuassel/src/common/internalpeer.cpp index 19a95b34..a05191a6 100644 --- a/kuassel/src/common/internalpeer.cpp +++ b/kuassel/src/common/internalpeer.cpp @@ -22,6 +22,7 @@ #include #include +#include #include "internalpeer.h" @@ -83,7 +84,7 @@ void InternalPeer::close(const QString &reason) { // FIXME Q_UNUSED(reason) - qWarning() << "closing not implemented!"; + kWarning(300000) << "closing not implemented!"; } @@ -115,14 +116,14 @@ void InternalPeer::setSignalProxy(::SignalProxy *proxy) return; } - qWarning() << Q_FUNC_INFO << "Changing the SignalProxy is not supported!"; + kWarning(300000) << Q_FUNC_INFO << "Changing the SignalProxy is not supported!"; } void InternalPeer::setPeer(InternalPeer *peer) { if (_peer) { - qWarning() << Q_FUNC_INFO << "Peer already set, ignoring!"; + kWarning(300000) << Q_FUNC_INFO << "Peer already set, ignoring!"; return; } _peer = peer; @@ -169,7 +170,7 @@ template void InternalPeer::dispatch(EventType eventType, const T &msg) { if (!_peer) { - qWarning() << Q_FUNC_INFO << "Cannot dispatch a message without a peer!"; + kWarning(300000) << Q_FUNC_INFO << "Cannot dispatch a message without a peer!"; return; } @@ -205,7 +206,7 @@ void InternalPeer::customEvent(QEvent *event) } default: - qWarning() << Q_FUNC_INFO << "Received unknown custom event:" << event->type(); + kWarning(300000) << Q_FUNC_INFO << "Received unknown custom event:" << event->type(); return; } diff --git a/kuassel/src/common/ircchannel.cpp b/kuassel/src/common/ircchannel.cpp index 145a1986..4eb5bfef 100644 --- a/kuassel/src/common/ircchannel.cpp +++ b/kuassel/src/common/ircchannel.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include INIT_SYNCABLE_OBJECT(IrcChannel) IrcChannel::IrcChannel(const QString &channelname, Network *network) @@ -56,12 +56,12 @@ IrcChannel::~IrcChannel() bool IrcChannel::isKnownUser(IrcUser *ircuser) const { if (ircuser == 0) { - qWarning() << "Channel" << name() << "received IrcUser Nullpointer!"; + kWarning(300000) << "Channel" << name() << "received IrcUser Nullpointer!"; return false; } if (!_userModes.contains(ircuser)) { - qWarning() << "Channel" << name() << "received data for unknown User" << ircuser->nick(); + kWarning(300000) << "Channel" << name() << "received data for unknown User" << ircuser->nick(); return false; } @@ -73,7 +73,7 @@ bool IrcChannel::isValidChannelUserMode(const QString &mode) const { bool isvalid = true; if (mode.size() > 1) { - qWarning() << "Channel" << name() << "received Channel User Mode which is longer then 1 Char:" << mode; + kWarning(300000) << "Channel" << name() << "received Channel User Mode which is longer then 1 Char:" << mode; isvalid = false; } return isvalid; @@ -166,7 +166,7 @@ void IrcChannel::joinIrcUsers(const QList &users, const QStringList & return; if (users.count() != modes.count()) { - qWarning() << "IrcChannel::addUsers(): number of nicks does not match number of modes!"; + kWarning(300000) << "IrcChannel::addUsers(): number of nicks does not match number of modes!"; return; } diff --git a/kuassel/src/common/ircuser.cpp b/kuassel/src/common/ircuser.cpp index d7276fdc..ccdd03c5 100644 --- a/kuassel/src/common/ircuser.cpp +++ b/kuassel/src/common/ircuser.cpp @@ -26,7 +26,7 @@ #include "ircchannel.h" #include -#include +#include INIT_SYNCABLE_OBJECT(IrcUser) IrcUser::IrcUser(const QString &hostmask, Network *network) : SyncableObject(network), @@ -309,7 +309,7 @@ void IrcUser::partChannel(const QString &channelname) { IrcChannel *channel = network()->ircChannel(channelname); if (channel == 0) { - qWarning() << "IrcUser::partChannel(): received part for unknown Channel" << channelname; + kWarning(300000) << "IrcUser::partChannel(): received part for unknown Channel" << channelname; } else { partChannel(channel); diff --git a/kuassel/src/common/logbacktrace_unix.cpp b/kuassel/src/common/logbacktrace_unix.cpp index cc9cbf67..49f45248 100644 --- a/kuassel/src/common/logbacktrace_unix.cpp +++ b/kuassel/src/common/logbacktrace_unix.cpp @@ -27,7 +27,7 @@ # include # include # include -# include +# include #endif void Quassel::logBacktrace(const QString &filename) @@ -90,7 +90,7 @@ void Quassel::logBacktrace(const QString &filename) .arg(funcName); dumpStream << debugLine << "\n"; - qDebug() << qPrintable(debugLine); + kDebug(300000) << qPrintable(debugLine); } dumpFile.close(); #endif /* BUILD_CRASHHANDLER */ diff --git a/kuassel/src/common/logger.cpp b/kuassel/src/common/logger.cpp deleted file mode 100644 index 27a3f6d7..00000000 --- a/kuassel/src/common/logger.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2014 by the Quassel Project * - * devel@quassel-irc.org * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) version 3. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include -#include -#include - -#ifdef HAVE_SYSLOG -# include -#endif - -#include "logger.h" -#include "quassel.h" - -Logger::~Logger() -{ - log(); -} - - -void Logger::log() -{ - if (_logLevel < Quassel::logLevel()) - return; - - switch (_logLevel) { - case Quassel::DebugLevel: - _buffer.prepend("Debug: "); - break; - case Quassel::InfoLevel: - _buffer.prepend("Info: "); - break; - case Quassel::WarningLevel: - _buffer.prepend("Warning: "); - break; - case Quassel::ErrorLevel: - _buffer.prepend("Error: "); - break; - default: - break; - } - -#ifdef HAVE_SYSLOG - if (Quassel::logToSyslog()) { - int prio; - switch (_logLevel) { - case Quassel::DebugLevel: - prio = LOG_DEBUG; - break; - case Quassel::InfoLevel: - prio = LOG_INFO; - break; - case Quassel::WarningLevel: - prio = LOG_WARNING; - break; - case Quassel::ErrorLevel: - prio = LOG_ERR; - break; - default: - prio = LOG_INFO; - break; - } - syslog(prio|LOG_USER, "%s", qPrintable(_buffer)); - } -#endif - - // if we neither use syslog nor have a logfile we log to stdout - - if (Quassel::logFile() || !Quassel::logToSyslog()) { - _buffer.prepend(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss ")); - - QTextStream out(stdout); - if (Quassel::logFile() && Quassel::logFile()->isOpen()) { - _buffer.remove(QChar('\n')); - out.setDevice(Quassel::logFile()); - } - - out << _buffer << endl; - } -} - - -#if QT_VERSION < 0x050000 -void Logger::logMessage(QtMsgType type, const char *msg) -{ - switch (type) { - case QtDebugMsg: - Logger(Quassel::DebugLevel) << msg; - break; - case QtWarningMsg: - Logger(Quassel::WarningLevel) << msg; - break; - case QtCriticalMsg: - Logger(Quassel::ErrorLevel) << msg; - break; - case QtFatalMsg: - Logger(Quassel::ErrorLevel) << msg; - Quassel::logFatalMessage(msg); - return; - } -} -#else -void Logger::logMessage(QtMsgType type, const QMessageLogContext &context, const QString &msg) -{ - Q_UNUSED(context) - - switch (type) { - case QtDebugMsg: - Logger(Quassel::DebugLevel) << msg.toLocal8Bit().constData(); - break; - case QtWarningMsg: - Logger(Quassel::WarningLevel) << msg.toLocal8Bit().constData(); - break; - case QtCriticalMsg: - Logger(Quassel::ErrorLevel) << msg.toLocal8Bit().constData(); - break; - case QtFatalMsg: - Logger(Quassel::ErrorLevel) << msg.toLocal8Bit().constData(); - Quassel::logFatalMessage(msg.toLocal8Bit().constData()); - return; - } -} -#endif diff --git a/kuassel/src/common/logger.h b/kuassel/src/common/logger.h deleted file mode 100644 index 2caa5d39..00000000 --- a/kuassel/src/common/logger.h +++ /dev/null @@ -1,76 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2014 by the Quassel Project * - * devel@quassel-irc.org * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) version 3. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef LOGGER_H -#define LOGGER_H - -#include -#include - -#include "quassel.h" -#include "types.h" - -class Logger -{ -public: - inline Logger(Quassel::LogLevel level) : _stream(&_buffer, QIODevice::WriteOnly), _logLevel(level) {} - ~Logger(); - -#if QT_VERSION < 0x050000 - static void logMessage(QtMsgType type, const char *msg); -#else - static void logMessage(QtMsgType, const QMessageLogContext&, const QString&); -#endif - - template - inline Logger &operator<<(const T &value) { _stream << value << " "; return *this; } - inline Logger &operator<<(const QStringList &t) { _stream << t.join(" ") << " "; return *this; } - inline Logger &operator<<(bool t) { _stream << (t ? "true" : "false") << " "; return *this; } - -private: - void log(); - QTextStream _stream; - QString _buffer; - Quassel::LogLevel _logLevel; -}; - - -class quInfo : public Logger -{ -public: - inline quInfo() : Logger(Quassel::InfoLevel) {} -}; - - -class quWarning : public Logger -{ -public: - inline quWarning() : Logger(Quassel::WarningLevel) {} -}; - - -class quError : public Logger -{ -public: - inline quError() : Logger(Quassel::ErrorLevel) {} -}; - - -#endif diff --git a/kuassel/src/common/main.cpp b/kuassel/src/common/main.cpp index 9abc0020..bf2f3953 100644 --- a/kuassel/src/common/main.cpp +++ b/kuassel/src/common/main.cpp @@ -182,7 +182,6 @@ int main(int argc, char **argv) // NOTE: We can't use tr() at this point, since app is not yet created // put shared client&core arguments here - cliParser->addSwitch("debug", 'd', "Enable debug output"); cliParser->addSwitch("help", 'h', "Display this help and exit"); cliParser->addSwitch("version", 'v', "Display version information"); cliParser->addOption("configdir ", 'c', "Specify the directory holding configuration files, the SQlite database and the SSL certificate"); @@ -197,11 +196,6 @@ int main(int argc, char **argv) cliParser->addOption("listen
[,", 0, "The address(es) quasselcore will listen on", "::,0.0.0.0"); cliParser->addOption("port ", 'p', "The port quasselcore will listen at", QString("4242")); cliParser->addSwitch("norestore", 'n', "Don't restore last core's state"); - cliParser->addOption("loglevel ", 'L', "Loglevel Debug|Info|Warning|Error", "Info"); -#ifdef HAVE_SYSLOG - cliParser->addSwitch("syslog", 0, "Log to syslog"); -#endif - cliParser->addOption("logfile ", 'l', "Log to a file"); cliParser->addOption("select-backend ", 0, "Switch storage backend (migrating data if possible)"); cliParser->addSwitch("add-user", 0, "Starts an interactive session to add a new core user"); cliParser->addOption("change-userpass ", 0, "Starts an interactive session to change the password of the user identified by username"); diff --git a/kuassel/src/common/network.cpp b/kuassel/src/common/network.cpp index 40881de1..ec32eb90 100644 --- a/kuassel/src/common/network.cpp +++ b/kuassel/src/common/network.cpp @@ -195,7 +195,7 @@ Network::ChannelModeType Network::channelModeType(const QString &mode) modeType = (ChannelModeType)(modeType << 1); } if (modeType > D_CHANMODE) { - qWarning() << "Network" << networkId() << "supplied invalid CHANMODES:" << chanmodes; + kWarning(300000) << "Network" << networkId() << "supplied invalid CHANMODES:" << chanmodes; modeType = NOT_A_CHANMODE; } return modeType; @@ -225,7 +225,7 @@ IrcUser *Network::newIrcUser(const QString &hostmask, const QVariantMap &initDat if (proxy()) proxy()->synchronize(ircuser); else - qWarning() << "unable to synchronize new IrcUser" << hostmask << "forgot to call Network::setProxy(SignalProxy *)?"; + kWarning(300000) << "unable to synchronize new IrcUser" << hostmask << "forgot to call Network::setProxy(SignalProxy *)?"; connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickChanged(QString))); @@ -302,7 +302,7 @@ IrcChannel *Network::newIrcChannel(const QString &channelname, const QVariantMap if (proxy()) proxy()->synchronize(channel); else - qWarning() << "unable to synchronize new IrcChannel" << channelname << "forgot to call Network::setProxy(SignalProxy *)?"; + kWarning(300000) << "unable to synchronize new IrcChannel" << channelname << "forgot to call Network::setProxy(SignalProxy *)?"; _ircChannels[channelname.toLower()] = channel; @@ -517,7 +517,7 @@ void Network::setConnected(bool connected) void Network::setConnectionState(int state) { _connectionState = (ConnectionState)state; - //qDebug() << "netstate" << networkId() << networkName() << state; + //kDebug(300000) << "netstate" << networkId() << networkName() << state; SYNC(ARG(state)) emit connectionStateSet(_connectionState); } @@ -751,7 +751,7 @@ void Network::initSetIrcUsersAndChannels(const QVariantMap &usersAndChannels) { Q_ASSERT(proxy()); if (isInitialized()) { - qWarning() << "Network" << networkId() << "received init data for users and channels although there already are known users or channels!"; + kWarning(300000) << "Network" << networkId() << "received init data for users and channels although there already are known users or channels!"; return; } @@ -764,7 +764,7 @@ void Network::initSetIrcUsersAndChannels(const QVariantMap &usersAndChannels) int count = users["nick"].toList().count(); foreach(const QString &key, users.keys()) { if (users[key].toList().count() != count) { - qWarning() << "Received invalid usersAndChannels init data, sizes of attribute lists don't match!"; + kWarning(300000) << "Received invalid usersAndChannels init data, sizes of attribute lists don't match!"; return; } } @@ -784,7 +784,7 @@ void Network::initSetIrcUsersAndChannels(const QVariantMap &usersAndChannels) count = channels["name"].toList().count(); foreach(const QString &key, channels.keys()) { if (channels[key].toList().count() != count) { - qWarning() << "Received invalid usersAndChannels init data, sizes of attribute lists don't match!"; + kWarning(300000) << "Received invalid usersAndChannels init data, sizes of attribute lists don't match!"; return; } } diff --git a/kuassel/src/common/peer.h b/kuassel/src/common/peer.h index 2bdcc563..c959ed25 100644 --- a/kuassel/src/common/peer.h +++ b/kuassel/src/common/peer.h @@ -24,6 +24,8 @@ #include #include +#include + #include "authhandler.h" #include "protocol.h" #include "signalproxy.h" @@ -94,7 +96,7 @@ void Peer::handle(const T &protoMessage) switch(protoMessage.handler()) { case Protocol::SignalProxy: if (!signalProxy()) { - qWarning() << Q_FUNC_INFO << "Cannot handle message without a SignalProxy!"; + kWarning(300000) << Q_FUNC_INFO << "Cannot handle message without a SignalProxy!"; return; } signalProxy()->handle(this, protoMessage); @@ -102,14 +104,14 @@ void Peer::handle(const T &protoMessage) case Protocol::AuthHandler: if (!authHandler()) { - qWarning() << Q_FUNC_INFO << "Cannot handle auth messages without an active AuthHandler!"; + kWarning(300000) << Q_FUNC_INFO << "Cannot handle auth messages without an active AuthHandler!"; return; } authHandler()->handle(protoMessage); break; default: - qWarning() << Q_FUNC_INFO << "Unknown handler for protocol message!"; + kWarning(300000) << Q_FUNC_INFO << "Unknown handler for protocol message!"; return; } } diff --git a/kuassel/src/common/presetnetworks.cpp b/kuassel/src/common/presetnetworks.cpp index ac89f4ac..dfbb7ac8 100644 --- a/kuassel/src/common/presetnetworks.cpp +++ b/kuassel/src/common/presetnetworks.cpp @@ -76,14 +76,14 @@ NetworkInfo PresetNetworks::networkInfo(const QString &networkName) bool ssl = false; QStringList splitserver = server.split(':', QString::SkipEmptyParts); if (splitserver.count() != 2) { - qWarning() << "Invalid server entry in networks.conf:" << server; + kWarning(300000) << "Invalid server entry in networks.conf:" << server; continue; } if (splitserver[1].at(0) == '+') ssl = true; uint port = splitserver[1].toUInt(); if (!port) { - qWarning() << "Invalid port entry in networks.conf:" << server; + kWarning(300000) << "Invalid port entry in networks.conf:" << server; continue; } info.serverList << Network::Server(splitserver[0].trimmed(), port, QString(), ssl); diff --git a/kuassel/src/common/protocols/datastream/datastreampeer.cpp b/kuassel/src/common/protocols/datastream/datastreampeer.cpp index 737e8075..524c354a 100644 --- a/kuassel/src/common/protocols/datastream/datastreampeer.cpp +++ b/kuassel/src/common/protocols/datastream/datastreampeer.cpp @@ -285,7 +285,7 @@ void DataStreamPeer::handlePackedFunc(const QVariantList &packedFunc) QVariantList params(packedFunc); if (params.isEmpty()) { - qWarning() << Q_FUNC_INFO << "Received incompatible data:" << packedFunc; + kWarning(300000) << Q_FUNC_INFO << "Received incompatible data:" << packedFunc; return; } @@ -294,7 +294,7 @@ void DataStreamPeer::handlePackedFunc(const QVariantList &packedFunc) switch (requestType) { case Sync: { if (params.count() < 3) { - qWarning() << Q_FUNC_INFO << "Received invalid sync call:" << params; + kWarning(300000) << Q_FUNC_INFO << "Received invalid sync call:" << params; return; } QByteArray className = params.takeFirst().toByteArray(); @@ -305,7 +305,7 @@ void DataStreamPeer::handlePackedFunc(const QVariantList &packedFunc) } case RpcCall: { if (params.empty()) { - qWarning() << Q_FUNC_INFO << "Received empty RPC call!"; + kWarning(300000) << Q_FUNC_INFO << "Received empty RPC call!"; return; } QByteArray slotName = params.takeFirst().toByteArray(); @@ -314,7 +314,7 @@ void DataStreamPeer::handlePackedFunc(const QVariantList &packedFunc) } case InitRequest: { if (params.count() != 2) { - qWarning() << Q_FUNC_INFO << "Received invalid InitRequest:" << params; + kWarning(300000) << Q_FUNC_INFO << "Received invalid InitRequest:" << params; return; } QByteArray className = params[0].toByteArray(); @@ -324,7 +324,7 @@ void DataStreamPeer::handlePackedFunc(const QVariantList &packedFunc) } case InitData: { if (params.count() < 2) { - qWarning() << Q_FUNC_INFO << "Received invalid InitData:" << params; + kWarning(300000) << Q_FUNC_INFO << "Received invalid InitData:" << params; return; } QByteArray className = params.takeFirst().toByteArray(); @@ -337,7 +337,7 @@ void DataStreamPeer::handlePackedFunc(const QVariantList &packedFunc) } case HeartBeat: { if (params.count() != 1) { - qWarning() << Q_FUNC_INFO << "Received invalid HeartBeat:" << params; + kWarning(300000) << Q_FUNC_INFO << "Received invalid HeartBeat:" << params; return; } // Note: QDateTime instead of QTime as in the legacy protocol! @@ -346,7 +346,7 @@ void DataStreamPeer::handlePackedFunc(const QVariantList &packedFunc) } case HeartBeatReply: { if (params.count() != 1) { - qWarning() << Q_FUNC_INFO << "Received invalid HeartBeat:" << params; + kWarning(300000) << Q_FUNC_INFO << "Received invalid HeartBeat:" << params; return; } // Note: QDateTime instead of QTime as in the legacy protocol! diff --git a/kuassel/src/common/protocols/legacy/legacypeer.cpp b/kuassel/src/common/protocols/legacy/legacypeer.cpp index b02b02e4..0ce33527 100644 --- a/kuassel/src/common/protocols/legacy/legacypeer.cpp +++ b/kuassel/src/common/protocols/legacy/legacypeer.cpp @@ -50,7 +50,7 @@ void LegacyPeer::setSignalProxy(::SignalProxy *proxy) // enable compression now if requested - the initial handshake is uncompressed in the legacy protocol! _useCompression = socket()->property("UseCompression").toBool(); if (_useCompression) - qDebug() << "Using compression for peer:" << qPrintable(socket()->peerAddress().toString()); + kDebug(300000) << "Using compression for peer:" << qPrintable(socket()->peerAddress().toString()); } } @@ -348,7 +348,7 @@ void LegacyPeer::handlePackedFunc(const QVariant &packedFunc) QVariantList params(packedFunc.toList()); if (params.isEmpty()) { - qWarning() << Q_FUNC_INFO << "Received incompatible data:" << packedFunc; + kWarning(300000) << Q_FUNC_INFO << "Received incompatible data:" << packedFunc; return; } @@ -357,7 +357,7 @@ void LegacyPeer::handlePackedFunc(const QVariant &packedFunc) switch (requestType) { case Sync: { if (params.count() < 3) { - qWarning() << Q_FUNC_INFO << "Received invalid sync call:" << params; + kWarning(300000) << Q_FUNC_INFO << "Received invalid sync call:" << params; return; } QByteArray className = params.takeFirst().toByteArray(); @@ -368,7 +368,7 @@ void LegacyPeer::handlePackedFunc(const QVariant &packedFunc) } case RpcCall: { if (params.empty()) { - qWarning() << Q_FUNC_INFO << "Received empty RPC call!"; + kWarning(300000) << Q_FUNC_INFO << "Received empty RPC call!"; return; } QByteArray slotName = params.takeFirst().toByteArray(); @@ -377,7 +377,7 @@ void LegacyPeer::handlePackedFunc(const QVariant &packedFunc) } case InitRequest: { if (params.count() != 2) { - qWarning() << Q_FUNC_INFO << "Received invalid InitRequest:" << params; + kWarning(300000) << Q_FUNC_INFO << "Received invalid InitRequest:" << params; return; } QByteArray className = params[0].toByteArray(); @@ -387,7 +387,7 @@ void LegacyPeer::handlePackedFunc(const QVariant &packedFunc) } case InitData: { if (params.count() != 3) { - qWarning() << Q_FUNC_INFO << "Received invalid InitData:" << params; + kWarning(300000) << Q_FUNC_INFO << "Received invalid InitData:" << params; return; } QByteArray className = params[0].toByteArray(); @@ -402,7 +402,7 @@ void LegacyPeer::handlePackedFunc(const QVariant &packedFunc) } case HeartBeat: { if (params.count() != 1) { - qWarning() << Q_FUNC_INFO << "Received invalid HeartBeat:" << params; + kWarning(300000) << Q_FUNC_INFO << "Received invalid HeartBeat:" << params; return; } // The legacy protocol would only send a QTime, no QDateTime @@ -414,7 +414,7 @@ void LegacyPeer::handlePackedFunc(const QVariant &packedFunc) } case HeartBeatReply: { if (params.count() != 1) { - qWarning() << Q_FUNC_INFO << "Received invalid HeartBeat:" << params; + kWarning(300000) << Q_FUNC_INFO << "Received invalid HeartBeat:" << params; return; } // The legacy protocol would only send a QTime, no QDateTime diff --git a/kuassel/src/common/quassel.cpp b/kuassel/src/common/quassel.cpp index 6a2f4bef..967c93ba 100644 --- a/kuassel/src/common/quassel.cpp +++ b/kuassel/src/common/quassel.cpp @@ -38,7 +38,6 @@ #include "bufferinfo.h" #include "identity.h" -#include "logger.h" #include "message.h" #include "network.h" #include "protocol.h" @@ -53,13 +52,9 @@ Quassel::RunMode Quassel::_runMode; QString Quassel::_configDirPath; QStringList Quassel::_dataDirPaths; bool Quassel::_initialized = false; -bool Quassel::DEBUG = false; QString Quassel::_coreDumpFileName; Quassel *Quassel::_instance = 0; bool Quassel::_handleCrashes = true; -Quassel::LogLevel Quassel::_logLevel = InfoLevel; -QFile *Quassel::_logFile = 0; -bool Quassel::_logToSyslog = false; Quassel::Quassel() { @@ -74,10 +69,6 @@ Quassel::Quassel() Quassel::~Quassel() { - if (logFile()) { - logFile()->close(); - logFile()->deleteLater(); - } delete _cliParser; } @@ -122,33 +113,6 @@ bool Quassel::init() return false; } - DEBUG = isOptionSet("debug"); - - // set up logging - if (Quassel::runMode() != Quassel::ClientOnly) { - if (isOptionSet("loglevel")) { - QString level = optionValue("loglevel"); - - if (level == "Debug") _logLevel = DebugLevel; - else if (level == "Info") _logLevel = InfoLevel; - else if (level == "Warning") _logLevel = WarningLevel; - else if (level == "Error") _logLevel = ErrorLevel; - } - - QString logfilename = optionValue("logfile"); - if (!logfilename.isEmpty()) { - _logFile = new QFile(logfilename); - if (!_logFile->open(QIODevice::Append | QIODevice::Text)) { - qWarning() << "Could not open log file" << logfilename << ":" << _logFile->errorString(); - _logFile->deleteLater(); - _logFile = 0; - } - } -#ifdef HAVE_SYSLOG - _logToSyslog = isOptionSet("syslog"); -#endif - } - return true; } @@ -266,7 +230,7 @@ const QString &Quassel::coreDumpFileName() dumpFile.open(QIODevice::Append); QTextStream dumpStream(&dumpFile); dumpStream << "Kuassel IRC: " << _buildInfo.baseVersion << '\n'; - qDebug() << "Kuassel IRC: " << _buildInfo.baseVersion; + kDebug(300000) << "Kuassel IRC: " << _buildInfo.baseVersion; dumpStream.flush(); dumpFile.close(); } diff --git a/kuassel/src/common/quassel.h b/kuassel/src/common/quassel.h index 46554c8c..5e85662f 100644 --- a/kuassel/src/common/quassel.h +++ b/kuassel/src/common/quassel.h @@ -107,19 +107,6 @@ public: static const QString &coreDumpFileName(); - static bool DEBUG; - - enum LogLevel { - DebugLevel, - InfoLevel, - WarningLevel, - ErrorLevel - }; - - static inline LogLevel logLevel(); - static inline QFile *logFile(); - static inline bool logToSyslog(); - static void logFatalMessage(const char *msg); protected: @@ -147,10 +134,6 @@ private: static QString _coreDumpFileName; static QString _configDirPath; static QStringList _dataDirPaths; - - static LogLevel _logLevel; - static QFile *_logFile; - static bool _logToSyslog; }; @@ -167,8 +150,4 @@ AbstractCliParser *Quassel::cliParser() { return _cliParser; } QString Quassel::optionValue(const QString &key) { return cliParser()->value(key); } bool Quassel::isOptionSet(const QString &key) { return cliParser()->isSet(key); } -Quassel::LogLevel Quassel::logLevel() { return _logLevel; } -QFile *Quassel::logFile() { return _logFile; } -bool Quassel::logToSyslog() { return _logToSyslog; } - #endif diff --git a/kuassel/src/common/remotepeer.cpp b/kuassel/src/common/remotepeer.cpp index 30246efe..0f99fb74 100644 --- a/kuassel/src/common/remotepeer.cpp +++ b/kuassel/src/common/remotepeer.cpp @@ -114,7 +114,7 @@ void RemotePeer::setSignalProxy(::SignalProxy *proxy) } else { if (signalProxy()) { - qWarning() << Q_FUNC_INFO << "Setting another SignalProxy not supported, ignoring!"; + kWarning(300000) << Q_FUNC_INFO << "Setting another SignalProxy not supported, ignoring!"; return; } _signalProxy = proxy; @@ -182,7 +182,7 @@ bool RemotePeer::isOpen() const void RemotePeer::close(const QString &reason) { if (!reason.isEmpty()) { - qWarning() << "Disconnecting:" << reason; + kWarning(300000) << "Disconnecting:" << reason; } if (socket() && socket()->state() != QTcpSocket::UnconnectedState) { @@ -265,7 +265,7 @@ void RemotePeer::handle(const HeartBeatReply &heartBeatReply) void RemotePeer::sendHeartBeat() { if (signalProxy()->maxHeartBeatCount() > 0 && _heartBeatCount >= signalProxy()->maxHeartBeatCount()) { - qWarning() << "Disconnecting peer:" << description() + kWarning(300000) << "Disconnecting peer:" << description() << "(didn't receive a heartbeat for over" << _heartBeatCount *_heartBeatTimer->interval() / 1000 << "seconds)"; socket()->close(); _heartBeatTimer->stop(); diff --git a/kuassel/src/common/settings.cpp b/kuassel/src/common/settings.cpp index 056e01ae..db2480d4 100644 --- a/kuassel/src/common/settings.cpp +++ b/kuassel/src/common/settings.cpp @@ -46,7 +46,7 @@ QHash Settings::settingsChangeNotifier; // if(appPath.startsWith(Qtopia::packagePath())) { // QString sandboxPath = appPath.left(Qtopia::packagePath().length() + 32); // QSettings(sandboxPath + "/etc/QuasselIRC.conf", QSettings::IniFormat); -// qDebug() << sandboxPath + "/etc/QuasselIRC.conf"; +// kDebug(300000) << sandboxPath + "/etc/QuasselIRC.conf"; // } else { // QSettings(QCoreApplication::organizationName(), applicationName); // } diff --git a/kuassel/src/common/signalproxy.cpp b/kuassel/src/common/signalproxy.cpp index 17f7589e..86a6c574 100644 --- a/kuassel/src/common/signalproxy.cpp +++ b/kuassel/src/common/signalproxy.cpp @@ -148,11 +148,11 @@ int SignalProxy::SignalRelay::qt_metacall(QMetaObject::Call _c, int _id, void ** for (int i = 0; i < argTypes.size(); i++) { if (argTypes[i] == 0) { #if QT_VERSION >= 0x050000 - qWarning() << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(_id).methodSignature().constData()); + kWarning(300000) << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(_id).methodSignature().constData()); #else - qWarning() << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(_id).signature()); + kWarning(300000) << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(_id).signature()); #endif - qWarning() << " - make sure all your data types are known by the Qt MetaSystem"; + kWarning(300000) << " - make sure all your data types are known by the Qt MetaSystem"; return _id; } params << QVariant(argTypes[i], _a[i+1]); @@ -210,7 +210,7 @@ SignalProxy::~SignalProxy() void SignalProxy::setProxyMode(ProxyMode mode) { if (_peers.count()) { - qWarning() << Q_FUNC_INFO << "Cannot change proxy mode while connected"; + kWarning(300000) << Q_FUNC_INFO << "Cannot change proxy mode while connected"; return; } @@ -316,17 +316,17 @@ void SignalProxy::removeAllPeers() void SignalProxy::removePeer(Peer *peer) { if (!peer) { - qWarning() << Q_FUNC_INFO << "Trying to remove a null peer!"; + kWarning(300000) << Q_FUNC_INFO << "Trying to remove a null peer!"; return; } if (_peers.isEmpty()) { - qWarning() << "SignalProxy::removePeer(): No peers in use!"; + kWarning(300000) << "SignalProxy::removePeer(): No peers in use!"; return; } if (!_peers.contains(peer)) { - qWarning() << "SignalProxy: unknown Peer" << peer; + kWarning(300000) << "SignalProxy: unknown Peer" << peer; return; } @@ -407,7 +407,7 @@ bool SignalProxy::attachSignal(QObject *sender, const char *signal, const QByteA QByteArray sig(meta->normalizedSignature(signal).mid(1)); int methodId = meta->indexOfMethod(sig.constData()); if (methodId == -1 || meta->method(methodId).methodType() != QMetaMethod::Signal) { - qWarning() << "SignalProxy::attachSignal(): No such signal" << signal; + kWarning(300000) << "SignalProxy::attachSignal(): No such signal" << signal; return false; } @@ -425,7 +425,7 @@ bool SignalProxy::attachSlot(const QByteArray &sigName, QObject *recv, const cha const QMetaObject *meta = recv->metaObject(); int methodId = meta->indexOfMethod(meta->normalizedSignature(slot).mid(1)); if (methodId == -1 || meta->method(methodId).methodType() == QMetaMethod::Method) { - qWarning() << "SignalProxy::attachSlot(): No such slot" << slot; + kWarning(300000) << "SignalProxy::attachSlot(): No such slot" << slot; return false; } @@ -530,7 +530,7 @@ void SignalProxy::dispatch(Peer *peer, const T &protoMessage) void SignalProxy::handle(Peer *peer, const SyncMessage &syncMessage) { if (!_syncSlave.contains(syncMessage.className) || !_syncSlave[syncMessage.className].contains(syncMessage.objectName)) { - qWarning() << QString("no registered receiver for sync call: %1::%2 (objectName=\"%3\"). Params are:").arg(syncMessage.className, syncMessage.slotName, syncMessage.objectName) + kWarning(300000) << QString("no registered receiver for sync call: %1::%2 (objectName=\"%3\"). Params are:").arg(syncMessage.className, syncMessage.slotName, syncMessage.objectName) << syncMessage.params; return; } @@ -538,7 +538,7 @@ void SignalProxy::handle(Peer *peer, const SyncMessage &syncMessage) SyncableObject *receiver = _syncSlave[syncMessage.className][syncMessage.objectName]; ExtendedMetaObject *eMeta = extendedMetaObject(receiver); if (!eMeta->slotMap().contains(syncMessage.slotName)) { - qWarning() << QString("no matching slot for sync call: %1::%2 (objectName=\"%3\"). Params are:").arg(syncMessage.className, syncMessage.slotName, syncMessage.objectName) + kWarning(300000) << QString("no matching slot for sync call: %1::%2 (objectName=\"%3\"). Params are:").arg(syncMessage.className, syncMessage.slotName, syncMessage.objectName) << syncMessage.params; return; } @@ -577,13 +577,13 @@ void SignalProxy::handle(Peer *peer, const SyncMessage &syncMessage) void SignalProxy::handle(Peer *peer, const InitRequest &initRequest) { if (!_syncSlave.contains(initRequest.className)) { - qWarning() << "SignalProxy::handleInitRequest() received initRequest for unregistered Class:" + kWarning(300000) << "SignalProxy::handleInitRequest() received initRequest for unregistered Class:" << initRequest.className; return; } if (!_syncSlave[initRequest.className].contains(initRequest.objectName)) { - qWarning() << "SignalProxy::handleInitRequest() received initRequest for unregistered Object:" + kWarning(300000) << "SignalProxy::handleInitRequest() received initRequest for unregistered Object:" << initRequest.className << initRequest.objectName; return; } @@ -598,13 +598,13 @@ void SignalProxy::handle(Peer *peer, const InitData &initData) Q_UNUSED(peer) if (!_syncSlave.contains(initData.className)) { - qWarning() << "SignalProxy::handleInitData() received initData for unregistered Class:" + kWarning(300000) << "SignalProxy::handleInitData() received initData for unregistered Class:" << initData.className; return; } if (!_syncSlave[initData.className].contains(initData.objectName)) { - qWarning() << "SignalProxy::handleInitData() received initData for unregistered Object:" + kWarning(300000) << "SignalProxy::handleInitData() received initData for unregistered Object:" << initData.className << initData.objectName; return; } @@ -640,7 +640,7 @@ bool SignalProxy::invokeSlot(QObject *receiver, int methodId, const QVariantList : args.count(); if (eMeta->minArgCount(methodId) > params.count()) { - qWarning() << "SignalProxy::invokeSlot(): not enough params to invoke" << eMeta->methodName(methodId); + kWarning(300000) << "SignalProxy::invokeSlot(): not enough params to invoke" << eMeta->methodName(methodId); return false; } @@ -652,15 +652,15 @@ bool SignalProxy::invokeSlot(QObject *receiver, int methodId, const QVariantList for (int i = 0; i < numArgs; i++) { if (!params[i].isValid()) { #if QT_VERSION >= 0x050000 - qWarning() << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).methodSignature().constData()); + kWarning(300000) << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).methodSignature().constData()); #else - qWarning() << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).signature()); + kWarning(300000) << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).signature()); #endif - qWarning() << " - make sure all your data types are known by the Qt MetaSystem"; + kWarning(300000) << " - make sure all your data types are known by the Qt MetaSystem"; return false; } if (args[i] != QMetaType::type(params[i].typeName())) { - qWarning() << "SignalProxy::invokeSlot(): incompatible param types to invoke" << eMeta->methodName(methodId); + kWarning(300000) << "SignalProxy::invokeSlot(): incompatible param types to invoke" << eMeta->methodName(methodId); return false; } // if first arg is a PeerPtr, replace it by the address of the peer originally receiving the RpcCall @@ -682,7 +682,7 @@ bool SignalProxy::invokeSlot(QObject *receiver, int methodId, const QVariantList return receiver->qt_metacall(QMetaObject::InvokeMetaMethod, methodId, _a) < 0; } else { - qWarning() << "Queued Connections are not implemented yet"; + kWarning(300000) << "Queued Connections are not implemented yet"; // note to self: qmetaobject.cpp:990 ff return false; } @@ -733,7 +733,7 @@ void SignalProxy::customEvent(QEvent *event) } default: - qWarning() << Q_FUNC_INFO << "Received unknown custom event:" << event->type(); + kWarning(300000) << Q_FUNC_INFO << "Received unknown custom event:" << event->type(); return; } } @@ -741,7 +741,7 @@ void SignalProxy::customEvent(QEvent *event) void SignalProxy::sync_call__(const SyncableObject *obj, SignalProxy::ProxyMode modeType, const char *funcname, va_list ap) { - // qDebug() << obj << modeType << "(" << _proxyMode << ")" << funcname; + // kDebug(300000) << obj << modeType << "(" << _proxyMode << ")" << funcname; if (modeType != _proxyMode) return; @@ -753,8 +753,8 @@ void SignalProxy::sync_call__(const SyncableObject *obj, SignalProxy::ProxyMode for (int i = 0; i < argTypes.size(); i++) { if (argTypes[i] == 0) { - qWarning() << Q_FUNC_INFO << "received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(eMeta->metaObject()->className()).arg(funcname); - qWarning() << " - make sure all your data types are known by the Qt MetaSystem"; + kWarning(300000) << Q_FUNC_INFO << "received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(eMeta->metaObject()->className()).arg(funcname); + kWarning(300000) << " - make sure all your data types are known by the Qt MetaSystem"; return; } params << QVariant(argTypes[i], va_arg(ap, void *)); @@ -771,10 +771,10 @@ void SignalProxy::sync_call__(const SyncableObject *obj, SignalProxy::ProxyMode void SignalProxy::disconnectDevice(QIODevice *dev, const QString &reason) { if (!reason.isEmpty()) - qWarning() << qPrintable(reason); + kWarning(300000) << qPrintable(reason); QAbstractSocket *sock = qobject_cast(dev); if (sock) - qWarning() << qPrintable(i18n("Disconnecting")) << qPrintable(sock->peerAddress().toString()); + kWarning(300000) << qPrintable(i18n("Disconnecting")) << qPrintable(sock->peerAddress().toString()); dev->close(); } @@ -791,11 +791,11 @@ void SignalProxy::dumpProxyStats() foreach(ObjectId oid, _syncSlave.values()) slaveCount += oid.count(); - qDebug() << this; - qDebug() << " Proxy Mode:" << mode; - qDebug() << " attached Slots:" << _attachedSlots.count(); - qDebug() << " number of synced Slaves:" << slaveCount; - qDebug() << "number of Classes cached:" << _extendedMetaObjects.count(); + kDebug(300000) << this; + kDebug(300000) << " Proxy Mode:" << mode; + kDebug(300000) << " attached Slots:" << _attachedSlots.count(); + kDebug(300000) << " number of synced Slaves:" << slaveCount; + kDebug(300000) << "number of Classes cached:" << _extendedMetaObjects.count(); } @@ -856,11 +856,11 @@ SignalProxy::ExtendedMetaObject::ExtendedMetaObject(const QMetaObject *meta, boo } } if (checkConflicts) { - qWarning() << "class" << meta->className() << "contains overloaded methods which is currently not supported!"; + kWarning(300000) << "class" << meta->className() << "contains overloaded methods which is currently not supported!"; #if QT_VERSION >= 0x050000 - qWarning() << " - " << _meta->method(i).methodSignature() << "conflicts with" << _meta->method(_methodIds[method]).methodSignature(); + kWarning(300000) << " - " << _meta->method(i).methodSignature() << "conflicts with" << _meta->method(_methodIds[method]).methodSignature(); #else - qWarning() << " - " << _meta->method(i).signature() << "conflicts with" << _meta->method(_methodIds[method]).signature(); + kWarning(300000) << " - " << _meta->method(i).signature() << "conflicts with" << _meta->method(_methodIds[method]).signature(); #endif } continue; diff --git a/kuassel/src/common/syncableobject.cpp b/kuassel/src/common/syncableobject.cpp index 0a142037..294a4086 100644 --- a/kuassel/src/common/syncableobject.cpp +++ b/kuassel/src/common/syncableobject.cpp @@ -20,7 +20,7 @@ #include -#include +#include #include "syncableobject.h" @@ -115,9 +115,9 @@ QVariantMap SyncableObject::toVariantMap() QVariant::Type variantType = QVariant::nameToType(method.typeName()); if (variantType == QVariant::Invalid && !QByteArray(method.typeName()).isEmpty()) { #if QT_VERSION >= 0x050000 - qWarning() << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.methodSignature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName()); + kWarning(300000) << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.methodSignature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName()); #else - qWarning() << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.signature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName()); + kWarning(300000) << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.signature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName()); #endif continue; } @@ -151,7 +151,7 @@ void SyncableObject::fromVariantMap(const QVariantMap &properties) setInitValue(propName, iterator.value()); else setProperty(propName.toLatin1(), iterator.value()); - // qDebug() << "<<< SYNC:" << name << iterator.value(); + // kDebug(300000) << "<<< SYNC:" << name << iterator.value(); iterator++; } } @@ -208,7 +208,7 @@ void SyncableObject::requestUpdate(const QVariantMap &properties) void SyncableObject::sync_call__(SignalProxy::ProxyMode modeType, const char *funcname, ...) const { - //qDebug() << Q_FUNC_INFO << modeType << funcname; + //kDebug(300000) << Q_FUNC_INFO << modeType << funcname; foreach(SignalProxy *proxy, _signalProxies) { va_list ap; va_start(ap, funcname); diff --git a/kuassel/src/common/transfer.cpp b/kuassel/src/common/transfer.cpp index 60375137..399f426c 100644 --- a/kuassel/src/common/transfer.cpp +++ b/kuassel/src/common/transfer.cpp @@ -175,7 +175,7 @@ void Transfer::setNick(const QString &nick) void Transfer::setError(const QString &errorString) { - qWarning() << Q_FUNC_INFO << errorString; + kWarning(300000) << Q_FUNC_INFO << errorString; emit error(errorString); setState(Failed); cleanUp(); diff --git a/kuassel/src/common/transfermanager.cpp b/kuassel/src/common/transfermanager.cpp index 257f4b28..fbd872e5 100644 --- a/kuassel/src/common/transfermanager.cpp +++ b/kuassel/src/common/transfermanager.cpp @@ -47,7 +47,7 @@ void TransferManager::addTransfer(Transfer *transfer) { QUuid uuid = transfer->uuid(); if (_transfers.contains(uuid)) { - qWarning() << "Cannot add the same file transfer twice!"; + kWarning(300000) << "Cannot add the same file transfer twice!"; transfer->deleteLater(); return; } diff --git a/kuassel/src/common/types.h b/kuassel/src/common/types.h index a63e2967..4b0bb815 100644 --- a/kuassel/src/common/types.h +++ b/kuassel/src/common/types.h @@ -21,7 +21,7 @@ #ifndef TYPES_H_ #define TYPES_H_ -#include +#include #include #include #include diff --git a/kuassel/src/common/util.cpp b/kuassel/src/common/util.cpp index 4797e72b..28c0a423 100644 --- a/kuassel/src/common/util.cpp +++ b/kuassel/src/common/util.cpp @@ -21,7 +21,7 @@ #include "util.h" #include -#include +#include #include #include @@ -118,7 +118,7 @@ QString decodeString(const QByteArray &input, QTextCodec *codec) } if (isUtf8 && cnt == 0) { QString s = QString::fromUtf8(input); - //qDebug() << "Detected utf8:" << s; + //kDebug(300000) << "Detected utf8:" << s; return s; } //QTextCodec *codec = QTextCodec::codecForName(encoding.toLatin1()); diff --git a/kuassel/src/core/abstractsqlstorage.cpp b/kuassel/src/core/abstractsqlstorage.cpp index 2a2aaeee..363c01ed 100644 --- a/kuassel/src/core/abstractsqlstorage.cpp +++ b/kuassel/src/core/abstractsqlstorage.cpp @@ -21,8 +21,6 @@ #include "abstractsqlstorage.h" #include "quassel.h" -#include "logger.h" - #include #include #include @@ -91,12 +89,12 @@ void AbstractSqlStorage::addConnectionToPool() } if (!db.open()) { - quWarning() << "Unable to open database" << displayName() << "for thread" << QThread::currentThread(); - quWarning() << "-" << db.lastError().text(); + kWarning(300000) << "Unable to open database" << displayName() << "for thread" << QThread::currentThread(); + kWarning(300000) << "-" << db.lastError().text(); } else { if (!initDbSession(db)) { - quWarning() << "Unable to initialize database" << displayName() << "for thread" << QThread::currentThread(); + kWarning(300000) << "Unable to initialize database" << displayName() << "for thread" << QThread::currentThread(); db.close(); } } @@ -124,14 +122,14 @@ Storage::State AbstractSqlStorage::init(const QVariantMap &settings) } if (installedSchemaVersion() < schemaVersion()) { - qWarning() << qPrintable(i18n("Installed Schema (version %1) is not up to date. Upgrading to version %2...").arg(installedSchemaVersion()).arg(schemaVersion())); + kWarning(300000) << qPrintable(i18n("Installed Schema (version %1) is not up to date. Upgrading to version %2...").arg(installedSchemaVersion()).arg(schemaVersion())); if (!upgradeDb()) { - qWarning() << qPrintable(i18n("Upgrade failed...")); + kWarning(300000) << qPrintable(i18n("Upgrade failed...")); return NotAvailable; } } - quInfo() << qPrintable(displayName()) << "Storage Backend is ready. Quassel Schema Version:" << installedSchemaVersion(); + kDebug(30000) << qPrintable(displayName()) << "Storage Backend is ready. Quassel Schema Version:" << installedSchemaVersion(); return IsReady; } @@ -404,14 +402,14 @@ QVariantList AbstractSqlMigrator::boundValues() void AbstractSqlMigrator::dumpStatus() { - qWarning() << " executed Query:"; - qWarning() << qPrintable(executedQuery()); - qWarning() << " bound Values:"; + kWarning(300000) << " executed Query:"; + kWarning(300000) << qPrintable(executedQuery()); + kWarning(300000) << " bound Values:"; QList list = boundValues(); for (int i = 0; i < list.size(); ++i) - qWarning() << i << ": " << list.at(i).toString().toLatin1().data(); - qWarning() << " Error Number:" << lastError().number(); - qWarning() << " Error Message:" << lastError().text(); + kWarning(300000) << i << ": " << list.at(i).toString().toLatin1().data(); + kWarning(300000) << " Error Number:" << lastError().number(); + kWarning(300000) << " Error Message:" << lastError().text(); } @@ -428,11 +426,11 @@ AbstractSqlMigrationReader::AbstractSqlMigrationReader() bool AbstractSqlMigrationReader::migrateTo(AbstractSqlMigrationWriter *writer) { if (!transaction()) { - qWarning() << "AbstractSqlMigrationReader::migrateTo(): unable to start reader's transaction!"; + kWarning(300000) << "AbstractSqlMigrationReader::migrateTo(): unable to start reader's transaction!"; return false; } if (!writer->transaction()) { - qWarning() << "AbstractSqlMigrationReader::migrateTo(): unable to start writer's transaction!"; + kWarning(300000) << "AbstractSqlMigrationReader::migrateTo(): unable to start writer's transaction!"; rollback(); // close the reader transaction; return false; } @@ -484,17 +482,17 @@ bool AbstractSqlMigrationReader::migrateTo(AbstractSqlMigrationWriter *writer) void AbstractSqlMigrationReader::abortMigration(const QString &errorMsg) { - qWarning() << "Migration Failed!"; + kWarning(300000) << "Migration Failed!"; if (!errorMsg.isNull()) { - qWarning() << qPrintable(errorMsg); + kWarning(300000) << qPrintable(errorMsg); } if (lastError().isValid()) { - qWarning() << "ReaderError:"; + kWarning(300000) << "ReaderError:"; dumpStatus(); } if (_writer->lastError().isValid()) { - qWarning() << "WriterError:"; + kWarning(300000) << "WriterError:"; _writer->dumpStatus(); } @@ -534,7 +532,7 @@ bool AbstractSqlMigrationReader::transferMo(MigrationObject moType, T &mo) return false; } - qDebug() << qPrintable(QString("Transferring %1...").arg(AbstractSqlMigrator::migrationObject(moType))); + kDebug(300000) << qPrintable(QString("Transferring %1...").arg(AbstractSqlMigrator::migrationObject(moType))); int i = 0; QFile file; file.open(stdout, QIODevice::WriteOnly); @@ -555,6 +553,6 @@ bool AbstractSqlMigrationReader::transferMo(MigrationObject moType, T &mo) file.flush(); } - qDebug() << "Done."; + kDebug(300000) << "Done."; return true; } diff --git a/kuassel/src/core/cipher.cpp b/kuassel/src/core/cipher.cpp index a8232a3c..9943f865 100644 --- a/kuassel/src/core/cipher.cpp +++ b/kuassel/src/core/cipher.cpp @@ -13,7 +13,6 @@ */ #include "cipher.h" -#include "logger.h" Cipher::Cipher() { diff --git a/kuassel/src/core/core.cpp b/kuassel/src/core/core.cpp index 95a39e28..76646e50 100644 --- a/kuassel/src/core/core.cpp +++ b/kuassel/src/core/core.cpp @@ -27,7 +27,6 @@ #include "coreauthhandler.h" #include "coresession.h" #include "coresettings.h" -#include "logger.h" #include "internalpeer.h" #include "network.h" #include "postgresqlstorage.h" @@ -120,13 +119,13 @@ void Core::init() if (!_configured) { if (!_storageBackends.count()) { - qWarning() << qPrintable(i18n("Could not initialize any storage backend! Exiting...")); - qWarning() << qPrintable(i18n("Currently, Quassel supports SQLite3 and PostgreSQL. You need to build your\n" + kWarning(300000) << qPrintable(i18n("Could not initialize any storage backend! Exiting...")); + kWarning(300000) << qPrintable(i18n("Currently, Quassel supports SQLite3 and PostgreSQL. You need to build your\n" "Qt library with the sqlite or postgres plugin enabled in order for quasselcore\n" "to work.")); exit(1); // TODO make this less brutal (especially for mono client -> popup) } - qWarning() << "Core is currently not configured! Please connect with a Quassel Client for basic setup."; + kWarning(300000) << "Core is currently not configured! Please connect with a Quassel Client for basic setup."; } if (Quassel::isOptionSet("add-user")) { @@ -176,25 +175,25 @@ void Core::saveState() void Core::restoreState() { if (!instance()->_configured) { - // qWarning() << qPrintable(i18n("Cannot restore a state for an unconfigured core!")); + // kWarning(300000) << qPrintable(i18n("Cannot restore a state for an unconfigured core!")); return; } if (instance()->sessions.count()) { - qWarning() << qPrintable(i18n("Calling restoreState() even though active sessions exist!")); + kWarning(300000) << qPrintable(i18n("Calling restoreState() even though active sessions exist!")); return; } CoreSettings s; /* We don't check, since we are at the first version since switching to Git uint statever = s.coreState().toMap()["CoreStateVersion"].toUInt(); if(statever < 1) { - qWarning() << qPrintable(i18n("Core state too old, ignoring...")); + kWarning(300000) << qPrintable(i18n("Core state too old, ignoring...")); return; } */ QVariantList activeSessions = s.coreState().toMap()["ActiveSessions"].toList(); if (activeSessions.count() > 0) { - quInfo() << "Restoring previous core state..."; + kDebug(30000) << "Restoring previous core state..."; foreach(QVariant v, activeSessions) { UserId user = v.value(); instance()->createSession(user, true); @@ -225,7 +224,7 @@ QString Core::setupCore(const QString &adminUser, const QString &adminPassword, saveBackendSettings(backend, setupData); - quInfo() << qPrintable(i18n("Creating admin user...")); + kDebug(30000) << qPrintable(i18n("Creating admin user...")); _storage->addUser(adminUser, adminPassword); startListening(); // TODO check when we need this return QString(); @@ -383,7 +382,7 @@ bool Core::startListening() switch (addr.protocol()) { case QAbstractSocket::IPv6Protocol: if (_v6server.listen(addr, port)) { - quInfo() << qPrintable( + kDebug(30000) << qPrintable( i18n("Listening for GUI clients on IPv6 %1 port %2") .arg(addr.toString()) .arg(_v6server.serverPort()) @@ -391,7 +390,7 @@ bool Core::startListening() success = true; } else - quWarning() << qPrintable( + kWarning(30000) << qPrintable( i18n("Could not open IPv6 interface %1:%2: %3") .arg(addr.toString()) .arg(port) @@ -399,7 +398,7 @@ bool Core::startListening() break; case QAbstractSocket::IPv4Protocol: if (_server.listen(addr, port)) { - quInfo() << qPrintable( + kDebug(30000) << qPrintable( i18n("Listening for GUI clients on IPv4 %1 port %2") .arg(addr.toString()) .arg(_server.serverPort()) @@ -409,7 +408,7 @@ bool Core::startListening() else { // if v6 succeeded on Any, the port will be already in use - don't display the error then if (!success || _server.serverError() != QAbstractSocket::AddressInUseError) - quWarning() << qPrintable( + kWarning(30000) << qPrintable( i18n("Could not open IPv4 interface %1:%2: %3") .arg(addr.toString()) .arg(port) @@ -427,7 +426,7 @@ bool Core::startListening() } } if (!success) - quError() << qPrintable(i18n("Could not open any network interfaces to listen on!")); + kError(30000) << qPrintable(i18n("Could not open any network interfaces to listen on!")); return success; } @@ -446,9 +445,9 @@ void Core::stopListening(const QString &reason) } if (wasListening) { if (reason.isEmpty()) - quInfo() << "No longer listening for GUI clients."; + kDebug(30000) << "No longer listening for GUI clients."; else - quInfo() << qPrintable(reason); + kDebug(30000) << qPrintable(reason); } } @@ -467,7 +466,7 @@ void Core::incomingConnection() connect(handler, SIGNAL(socketError(QAbstractSocket::SocketError,QString)), SLOT(socketError(QAbstractSocket::SocketError,QString))); connect(handler, SIGNAL(handshakeComplete(RemotePeer*,UserId)), SLOT(setupClientSession(RemotePeer*,UserId))); - quInfo() << qPrintable(i18n("Client connected from")) << qPrintable(socket->peerAddress().toString()); + kDebug(30000) << qPrintable(i18n("Client connected from")) << qPrintable(socket->peerAddress().toString()); if (!_configured) { stopListening(i18n("Closing server for basic setup.")); @@ -482,7 +481,7 @@ void Core::clientDisconnected() CoreAuthHandler *handler = qobject_cast(sender()); Q_ASSERT(handler); - quInfo() << qPrintable(i18n("Non-authed client disconnected:")) << qPrintable(handler->socket()->peerAddress().toString()); + kDebug(30000) << qPrintable(i18n("Non-authed client disconnected:")) << qPrintable(handler->socket()->peerAddress().toString()); _connectingClients.remove(handler); handler->deleteLater(); @@ -514,7 +513,7 @@ void Core::setupClientSession(RemotePeer *peer, UserId uid) else { session = createSession(uid); if (!session) { - qWarning() << qPrintable(i18n("Could not initialize session for client:")) << qPrintable(peer->description()); + kWarning(300000) << qPrintable(i18n("Could not initialize session for client:")) << qPrintable(peer->description()); peer->close(); peer->deleteLater(); return; @@ -541,7 +540,7 @@ void Core::addClientHelper(RemotePeer *peer, UserId uid) { // Find or create session for validated user if (!sessions.contains(uid)) { - qWarning() << qPrintable(i18n("Could not find a session for client:")) << qPrintable(peer->description()); + kWarning(300000) << qPrintable(i18n("Could not find a session for client:")) << qPrintable(peer->description()); peer->close(); peer->deleteLater(); return; @@ -564,7 +563,7 @@ void Core::setupInternalClientSession(InternalPeer *clientPeer) uid = _storage->internalUser(); } else { - qWarning() << "Core::setupInternalClientSession(): You're trying to run monolithic Quassel with an unusable Backend! Go fix it!"; + kWarning(300000) << "Core::setupInternalClientSession(): You're trying to run monolithic Quassel with an unusable Backend! Go fix it!"; return; } @@ -586,7 +585,7 @@ void Core::setupInternalClientSession(InternalPeer *clientPeer) SessionThread *Core::createSession(UserId uid, bool restore) { if (sessions.contains(uid)) { - qWarning() << "Calling createSession() when a session for the user already exists!"; + kWarning(300000) << "Calling createSession() when a session for the user already exists!"; return 0; } SessionThread *sess = new SessionThread(uid, restore, this); @@ -598,7 +597,7 @@ SessionThread *Core::createSession(UserId uid, bool restore) void Core::socketError(QAbstractSocket::SocketError err, const QString &errorString) { - qWarning() << QString("Socket error %1: %2").arg(err).arg(errorString); + kWarning(300000) << QString("Socket error %1: %2").arg(err).arg(errorString); } @@ -623,8 +622,8 @@ bool Core::selectBackend(const QString &backend) // reregister all storage backends registerStorageBackends(); if (!_storageBackends.contains(backend)) { - qWarning() << qPrintable(QString("Core::selectBackend(): unsupported backend: %1").arg(backend)); - qWarning() << " supported backends are:" << qPrintable(QStringList(_storageBackends.keys()).join(", ")); + kWarning(300000) << qPrintable(QString("Core::selectBackend(): unsupported backend: %1").arg(backend)); + kWarning(300000) << " supported backends are:" << qPrintable(QStringList(_storageBackends.keys()).join(", ")); return false; } @@ -635,25 +634,25 @@ bool Core::selectBackend(const QString &backend) switch (storageState) { case Storage::IsReady: saveBackendSettings(backend, settings); - qWarning() << "Switched backend to:" << qPrintable(backend); - qWarning() << "Backend already initialized. Skipping Migration"; + kWarning(300000) << "Switched backend to:" << qPrintable(backend); + kWarning(300000) << "Backend already initialized. Skipping Migration"; return true; case Storage::NotAvailable: qCritical() << "Backend is not available:" << qPrintable(backend); return false; case Storage::NeedsSetup: if (!storage->setup(settings)) { - qWarning() << qPrintable(QString("Core::selectBackend(): unable to setup backend: %1").arg(backend)); + kWarning(300000) << qPrintable(QString("Core::selectBackend(): unable to setup backend: %1").arg(backend)); return false; } if (storage->init(settings) != Storage::IsReady) { - qWarning() << qPrintable(QString("Core::migrateBackend(): unable to initialize backend: %1").arg(backend)); + kWarning(300000) << qPrintable(QString("Core::migrateBackend(): unable to initialize backend: %1").arg(backend)); return false; } saveBackendSettings(backend, settings); - qWarning() << "Switched backend to:" << qPrintable(backend); + kWarning(300000) << "Switched backend to:" << qPrintable(backend); break; } @@ -661,29 +660,29 @@ bool Core::selectBackend(const QString &backend) AbstractSqlMigrationReader *reader = getMigrationReader(_storage); AbstractSqlMigrationWriter *writer = getMigrationWriter(storage); if (reader && writer) { - qDebug() << qPrintable(QString("Migrating Storage backend %1 to %2...").arg(_storage->displayName(), storage->displayName())); + kDebug(300000) << qPrintable(QString("Migrating Storage backend %1 to %2...").arg(_storage->displayName(), storage->displayName())); delete _storage; _storage = 0; delete storage; storage = 0; if (reader->migrateTo(writer)) { - qDebug() << "Migration finished!"; + kDebug(300000) << "Migration finished!"; saveBackendSettings(backend, settings); return true; } return false; - qWarning() << qPrintable(QString("Core::migrateDb(): unable to migrate storage backend! (No migration writer for %1)").arg(backend)); + kWarning(300000) << qPrintable(QString("Core::migrateDb(): unable to migrate storage backend! (No migration writer for %1)").arg(backend)); } // inform the user why we cannot merge if (!_storage) { - qWarning() << "No currently active backend. Skipping migration."; + kWarning(300000) << "No currently active backend. Skipping migration."; } else if (!reader) { - qWarning() << "Currently active backend does not support migration:" << qPrintable(_storage->displayName()); + kWarning(300000) << "Currently active backend does not support migration:" << qPrintable(_storage->displayName()); } if (writer) { - qWarning() << "New backend does not support migration:" << qPrintable(backend); + kWarning(300000) << "New backend does not support migration:" << qPrintable(backend); } // so we were unable to merge, but let's create a user \o/ @@ -714,11 +713,11 @@ void Core::createUser() enableStdInEcho(); if (password != password2) { - qWarning() << "Passwords don't match!"; + kWarning(300000) << "Passwords don't match!"; return; } if (password.isEmpty()) { - qWarning() << "Password is empty!"; + kWarning(300000) << "Password is empty!"; return; } @@ -726,7 +725,7 @@ void Core::createUser() out << "Added user " << username << " successfully!" << endl; } else { - qWarning() << "Unable to add user:" << qPrintable(username); + kWarning(300000) << "Unable to add user:" << qPrintable(username); } } @@ -755,11 +754,11 @@ void Core::changeUserPass(const QString &username) enableStdInEcho(); if (password != password2) { - qWarning() << "Passwords don't match!"; + kWarning(300000) << "Passwords don't match!"; return; } if (password.isEmpty()) { - qWarning() << "Password is empty!"; + kWarning(300000) << "Password is empty!"; return; } @@ -767,7 +766,7 @@ void Core::changeUserPass(const QString &username) out << "Password changed successfully!" << endl; } else { - qWarning() << "Failed to change password!"; + kWarning(300000) << "Failed to change password!"; } } @@ -779,7 +778,7 @@ AbstractSqlMigrationReader *Core::getMigrationReader(Storage *storage) AbstractSqlStorage *sqlStorage = qobject_cast(storage); if (!sqlStorage) { - qDebug() << "Core::migrateDb(): only SQL based backends can be migrated!"; + kDebug(300000) << "Core::migrateDb(): only SQL based backends can be migrated!"; return 0; } @@ -794,7 +793,7 @@ AbstractSqlMigrationWriter *Core::getMigrationWriter(Storage *storage) AbstractSqlStorage *sqlStorage = qobject_cast(storage); if (!sqlStorage) { - qDebug() << "Core::migrateDb(): only SQL based backends can be migrated!"; + kDebug(300000) << "Core::migrateDb(): only SQL based backends can be migrated!"; return 0; } diff --git a/kuassel/src/core/corealiasmanager.cpp b/kuassel/src/core/corealiasmanager.cpp index 2669a631..33956efd 100644 --- a/kuassel/src/core/corealiasmanager.cpp +++ b/kuassel/src/core/corealiasmanager.cpp @@ -30,7 +30,7 @@ CoreAliasManager::CoreAliasManager(CoreSession *parent) { CoreSession *session = qobject_cast(parent); if (!session) { - qWarning() << "CoreAliasManager: unable to load Aliases. Parent is not a Coresession!"; + kWarning(300000) << "CoreAliasManager: unable to load Aliases. Parent is not a Coresession!"; loadDefaults(); return; } @@ -48,7 +48,7 @@ void CoreAliasManager::save() const { CoreSession *session = qobject_cast(parent()); if (!session) { - qWarning() << "CoreAliasManager: unable to save Aliases. Parent is not a Coresession!"; + kWarning(300000) << "CoreAliasManager: unable to save Aliases. Parent is not a Coresession!"; return; } diff --git a/kuassel/src/core/coreapplication.cpp b/kuassel/src/core/coreapplication.cpp index e7ecdf0f..e6f4e9c1 100644 --- a/kuassel/src/core/coreapplication.cpp +++ b/kuassel/src/core/coreapplication.cpp @@ -21,7 +21,6 @@ #include "coreapplication.h" #include "core.h" -#include "logger.h" CoreApplicationInternal::CoreApplicationInternal() : _coreCreated(false) @@ -40,18 +39,6 @@ CoreApplicationInternal::~CoreApplicationInternal() bool CoreApplicationInternal::init() { - /* FIXME - This is an initial check if logfile is writable since the warning would spam stdout if done - in current Logger implementation. Can be dropped whenever the logfile is only opened once. - */ - QFile logFile; - if (!Quassel::optionValue("logfile").isEmpty()) { - logFile.setFileName(Quassel::optionValue("logfile")); - if (!logFile.open(QIODevice::Append | QIODevice::Text)) - qWarning("Warning: Couldn't open logfile '%s' - will log to stdout instead", qPrintable(logFile.fileName())); - else logFile.close(); - } - Core::instance(); // create and init the core _coreCreated = true; @@ -82,11 +69,6 @@ CoreApplication::~CoreApplication() bool CoreApplication::init() { if (Quassel::init() && _internal->init()) { -#if QT_VERSION < 0x050000 - qInstallMsgHandler(Logger::logMessage); -#else - qInstallMessageHandler(Logger::logMessage); -#endif return true; } return false; diff --git a/kuassel/src/core/coreauthhandler.cpp b/kuassel/src/core/coreauthhandler.cpp index ff39b32d..c00a5427 100644 --- a/kuassel/src/core/coreauthhandler.cpp +++ b/kuassel/src/core/coreauthhandler.cpp @@ -25,7 +25,6 @@ #endif #include "core.h" -#include "logger.h" using namespace Protocol; @@ -61,7 +60,7 @@ void CoreAuthHandler::onReadyRead() if ((magic & 0xffffff00) != Protocol::magic) { // no magic, assume legacy protocol - qDebug() << "Legacy client detected, switching to compatibility mode"; + kDebug(300000) << "Legacy client detected, switching to compatibility mode"; _legacy = true; RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(Protocol::LegacyProtocol, 0), this, socket(), Compressor::NoCompression, this); connect(peer, SIGNAL(protocolVersionMismatch(int,int)), SLOT(onProtocolVersionMismatch(int,int))); @@ -120,7 +119,7 @@ void CoreAuthHandler::onReadyRead() void CoreAuthHandler::setPeer(RemotePeer *peer) { - qDebug().nospace() << "Using " << qPrintable(peer->protocolName()) << "..."; + kDebug(300000).nospace() << "Using " << qPrintable(peer->protocolName()) << "..."; _peer = peer; disconnect(socket(), SIGNAL(readyRead()), this, SLOT(onReadyRead())); @@ -129,7 +128,7 @@ void CoreAuthHandler::setPeer(RemotePeer *peer) // only in compat mode void CoreAuthHandler::onProtocolVersionMismatch(int actual, int expected) { - qWarning() << qPrintable(i18n("Client")) << _peer->description() << qPrintable(i18n("too old, rejecting.")); + kWarning(300000) << qPrintable(i18n("Client")) << _peer->description() << qPrintable(i18n("too old, rejecting.")); QString errorString = i18n("Your Quassel Client is too old!
" "This core needs at least client/core protocol version %1 (got: %2).
" "Please consider upgrading your client.").arg(expected, actual); @@ -141,7 +140,7 @@ void CoreAuthHandler::onProtocolVersionMismatch(int actual, int expected) bool CoreAuthHandler::checkClientRegistered() { if (!_clientRegistered) { - qWarning() << qPrintable(i18n("Client")) << qPrintable(socket()->peerAddress().toString()) << qPrintable(i18n("did not send a registration message before trying to login, rejecting.")); + kWarning(300000) << qPrintable(i18n("Client")) << qPrintable(socket()->peerAddress().toString()) << qPrintable(i18n("did not send a registration message before trying to login, rejecting.")); _peer->dispatch(ClientDenied(i18n("Client not initialized!
You need to send a registration message before trying to login."))); _peer->close(); return false; @@ -212,7 +211,7 @@ void CoreAuthHandler::handle(const Login &msg) } _peer->dispatch(LoginSuccess()); - quInfo() << qPrintable(i18n("Client %1 initialized and authenticated successfully as \"%2\" (UserId: %3).").arg(socket()->peerAddress().toString(), msg.user, QString::number(uid.toInt()))); + kDebug(30000) << qPrintable(i18n("Client %1 initialized and authenticated successfully as \"%2\" (UserId: %3).").arg(socket()->peerAddress().toString(), msg.user, QString::number(uid.toInt()))); disconnect(socket(), 0, this, 0); disconnect(_peer, 0, this, 0); @@ -231,7 +230,7 @@ void CoreAuthHandler::startSsl() QSslSocket *sslSocket = qobject_cast(socket()); Q_ASSERT(sslSocket); - qDebug() << qPrintable(i18n("Starting encryption for Client:")) << _peer->description(); + kDebug(300000) << qPrintable(i18n("Starting encryption for Client:")) << _peer->description(); connect(sslSocket, SIGNAL(sslErrors(const QList &)), SLOT(onSslErrors())); sslSocket->flush(); // ensure that the write cache is flushed before we switch to ssl (bug 682) sslSocket->startServerEncryption(); diff --git a/kuassel/src/core/corebacklogmanager.cpp b/kuassel/src/core/corebacklogmanager.cpp index bfa3f797..84b33411 100644 --- a/kuassel/src/core/corebacklogmanager.cpp +++ b/kuassel/src/core/corebacklogmanager.cpp @@ -22,7 +22,7 @@ #include "core.h" #include "coresession.h" -#include +#include INIT_SYNCABLE_OBJECT(CoreBacklogManager) CoreBacklogManager::CoreBacklogManager(CoreSession *coreSession) diff --git a/kuassel/src/core/corebasichandler.cpp b/kuassel/src/core/corebasichandler.cpp index d2bb0d5a..e2c26ad4 100644 --- a/kuassel/src/core/corebasichandler.cpp +++ b/kuassel/src/core/corebasichandler.cpp @@ -21,7 +21,6 @@ #include "corebasichandler.h" #include "util.h" -#include "logger.h" CoreBasicHandler::CoreBasicHandler(CoreNetwork *parent) : BasicHandler(parent), diff --git a/kuassel/src/core/corebuffersyncer.cpp b/kuassel/src/core/corebuffersyncer.cpp index 5e61de2a..690231a6 100644 --- a/kuassel/src/core/corebuffersyncer.cpp +++ b/kuassel/src/core/corebuffersyncer.cpp @@ -80,24 +80,24 @@ void CoreBufferSyncer::removeBuffer(BufferId bufferId) { BufferInfo bufferInfo = Core::getBufferInfo(_coreSession->user(), bufferId); if (!bufferInfo.isValid()) { - qWarning() << "CoreBufferSyncer::removeBuffer(): invalid BufferId:" << bufferId << "for User:" << _coreSession->user(); + kWarning(300000) << "CoreBufferSyncer::removeBuffer(): invalid BufferId:" << bufferId << "for User:" << _coreSession->user(); return; } if (bufferInfo.type() == BufferInfo::StatusBuffer) { - qWarning() << "CoreBufferSyncer::removeBuffer(): Status Buffers cannot be removed!"; + kWarning(300000) << "CoreBufferSyncer::removeBuffer(): Status Buffers cannot be removed!"; return; } if (bufferInfo.type() == BufferInfo::ChannelBuffer) { CoreNetwork *net = _coreSession->network(bufferInfo.networkId()); if (!net) { - qWarning() << "CoreBufferSyncer::removeBuffer(): Received BufferInfo with unknown networkId!"; + kWarning(300000) << "CoreBufferSyncer::removeBuffer(): Received BufferInfo with unknown networkId!"; return; } IrcChannel *chan = net->ircChannel(bufferInfo.bufferName()); if (chan) { - qWarning() << "CoreBufferSyncer::removeBuffer(): Unable to remove Buffer for joined Channel:" << bufferInfo.bufferName(); + kWarning(300000) << "CoreBufferSyncer::removeBuffer(): Unable to remove Buffer for joined Channel:" << bufferInfo.bufferName(); return; } } @@ -110,12 +110,12 @@ void CoreBufferSyncer::renameBuffer(BufferId bufferId, QString newName) { BufferInfo bufferInfo = Core::getBufferInfo(_coreSession->user(), bufferId); if (!bufferInfo.isValid()) { - qWarning() << "CoreBufferSyncer::renameBuffer(): invalid BufferId:" << bufferId << "for User:" << _coreSession->user(); + kWarning(300000) << "CoreBufferSyncer::renameBuffer(): invalid BufferId:" << bufferId << "for User:" << _coreSession->user(); return; } if (bufferInfo.type() != BufferInfo::QueryBuffer) { - qWarning() << "CoreBufferSyncer::renameBuffer(): only QueryBuffers can be renamed" << bufferId; + kWarning(300000) << "CoreBufferSyncer::renameBuffer(): only QueryBuffers can be renamed" << bufferId; return; } @@ -129,12 +129,12 @@ void CoreBufferSyncer::mergeBuffersPermanently(BufferId bufferId1, BufferId buff BufferInfo bufferInfo1 = Core::getBufferInfo(_coreSession->user(), bufferId1); BufferInfo bufferInfo2 = Core::getBufferInfo(_coreSession->user(), bufferId2); if (!bufferInfo1.isValid() || !bufferInfo2.isValid()) { - qWarning() << "CoreBufferSyncer::mergeBufferPermanently(): invalid BufferIds:" << bufferId1 << bufferId2 << "for User:" << _coreSession->user(); + kWarning(300000) << "CoreBufferSyncer::mergeBufferPermanently(): invalid BufferIds:" << bufferId1 << bufferId2 << "for User:" << _coreSession->user(); return; } if (bufferInfo1.type() != BufferInfo::QueryBuffer || bufferInfo2.type() != BufferInfo::QueryBuffer) { - qWarning() << "CoreBufferSyncer::mergeBufferPermanently(): only QueryBuffers can be merged!" << bufferId1 << bufferId2; + kWarning(300000) << "CoreBufferSyncer::mergeBufferPermanently(): only QueryBuffers can be merged!" << bufferId1 << bufferId2; return; } diff --git a/kuassel/src/core/coreignorelistmanager.cpp b/kuassel/src/core/coreignorelistmanager.cpp index 3b630f35..fcd3cddf 100644 --- a/kuassel/src/core/coreignorelistmanager.cpp +++ b/kuassel/src/core/coreignorelistmanager.cpp @@ -29,7 +29,7 @@ CoreIgnoreListManager::CoreIgnoreListManager(CoreSession *parent) { CoreSession *session = qobject_cast(parent); if (!session) { - qWarning() << "CoreIgnoreListManager: unable to load IgnoreList. Parent is not a Coresession!"; + kWarning(300000) << "CoreIgnoreListManager: unable to load IgnoreList. Parent is not a Coresession!"; //loadDefaults(); return; } @@ -55,7 +55,7 @@ void CoreIgnoreListManager::save() const { CoreSession *session = qobject_cast(parent()); if (!session) { - qWarning() << "CoreIgnoreListManager: unable to save IgnoreList. Parent is not a Coresession!"; + kWarning(300000) << "CoreIgnoreListManager: unable to save IgnoreList. Parent is not a Coresession!"; return; } diff --git a/kuassel/src/core/corenetwork.cpp b/kuassel/src/core/corenetwork.cpp index 0c755731..ffd1d34d 100644 --- a/kuassel/src/core/corenetwork.cpp +++ b/kuassel/src/core/corenetwork.cpp @@ -147,12 +147,12 @@ void CoreNetwork::connectToIrc(bool reconnecting) _autoReconnectCount = autoReconnectRetries(); } if (serverList().isEmpty()) { - qWarning() << "Server list empty, ignoring connect request!"; + kWarning(300000) << "Server list empty, ignoring connect request!"; return; } CoreIdentity *identity = identityPtr(); if (!identity) { - qWarning() << "Invalid identity configures, ignoring connect request!"; + kWarning(300000) << "Invalid identity configures, ignoring connect request!"; return; } @@ -432,7 +432,7 @@ void CoreNetwork::socketError(QAbstractSocket::SocketError error) return; _previousConnectionAttemptFailed = true; - qWarning() << qPrintable(i18n("Could not connect to %1 (%2)").arg(networkName(), socket.errorString())); + kWarning(300000) << qPrintable(i18n("Could not connect to %1 (%2)").arg(networkName(), socket.errorString())); emit connectionError(socket.errorString()); displayMsg(Message::Error, BufferInfo::StatusBuffer, "", i18n("Connection failure: %1").arg(socket.errorString())); emitConnectionError(socket.errorString()); @@ -479,7 +479,7 @@ void CoreNetwork::socketInitialized() QString nick; if (identity->nicks().isEmpty()) { nick = "kuassel"; - qWarning() << "CoreNetwork::socketInitialized(): no nicks supplied for identity Id" << identity->id(); + kWarning(300000) << "CoreNetwork::socketInitialized(): no nicks supplied for identity Id" << identity->id(); } else { nick = identity->nicks()[0]; @@ -788,7 +788,7 @@ void CoreNetwork::setAutoReconnectRetries(quint16 retries) void CoreNetwork::doAutoReconnect() { if (connectionState() != Network::Disconnected && connectionState() != Network::Reconnecting) { - qWarning() << "CoreNetwork::doAutoReconnect(): Cannot reconnect while not being disconnected!"; + kWarning(300000) << "CoreNetwork::doAutoReconnect(): Cannot reconnect while not being disconnected!"; return; } if (_autoReconnectCount > 0 || _autoReconnectCount == -1) @@ -801,7 +801,7 @@ void CoreNetwork::sendPing() { uint now = QDateTime::currentDateTime().toTime_t(); if (_pingCount != 0) { - qDebug() << "UserId:" << userId() << "Network:" << networkName() << "missed" << _pingCount << "pings." + kDebug(300000) << "UserId:" << userId() << "Network:" << networkName() << "missed" << _pingCount << "pings." << "BA:" << socket.bytesAvailable() << "BTW:" << socket.bytesToWrite(); } if ((int)_pingCount >= networkConfig()->maxPingCount() && now - _lastPingTime <= (uint)(_pingTimer.interval() / 1000) + 1) { @@ -951,7 +951,7 @@ Network::Server CoreNetwork::usedServer() const void CoreNetwork::requestConnect() const { if (connectionState() != Disconnected) { - qWarning() << "Requesting connect while already being connected!"; + kWarning(300000) << "Requesting connect while already being connected!"; return; } QMetaObject::invokeMethod(const_cast(this), "connectToIrc", Qt::QueuedConnection); @@ -961,7 +961,7 @@ void CoreNetwork::requestConnect() const void CoreNetwork::requestDisconnect() const { if (connectionState() == Disconnected) { - qWarning() << "Requesting disconnect while not being connected!"; + kWarning(300000) << "Requesting disconnect while not being connected!"; return; } userInputHandler()->handleQuit(BufferInfo(), QString()); diff --git a/kuassel/src/core/corenetworkconfig.cpp b/kuassel/src/core/corenetworkconfig.cpp index 4520528c..cfbe6f82 100644 --- a/kuassel/src/core/corenetworkconfig.cpp +++ b/kuassel/src/core/corenetworkconfig.cpp @@ -29,7 +29,7 @@ CoreNetworkConfig::CoreNetworkConfig(const QString &objectName, CoreSession *ses setAllowClientUpdates(true); if (!session) { - qWarning() << Q_FUNC_INFO << "No CoreSession set, cannot load network configuration!"; + kWarning(300000) << Q_FUNC_INFO << "No CoreSession set, cannot load network configuration!"; return; } @@ -41,7 +41,7 @@ void CoreNetworkConfig::save() { CoreSession *session = qobject_cast(parent()); if (!session) { - qWarning() << Q_FUNC_INFO << "No CoreSession set, cannot save network configuration!"; + kWarning(300000) << Q_FUNC_INFO << "No CoreSession set, cannot save network configuration!"; return; } diff --git a/kuassel/src/core/coresession.cpp b/kuassel/src/core/coresession.cpp index d5baf094..f8796e3f 100644 --- a/kuassel/src/core/coresession.cpp +++ b/kuassel/src/core/coresession.cpp @@ -42,7 +42,6 @@ #include "ircchannel.h" #include "ircparser.h" #include "ircuser.h" -#include "logger.h" #include "messageevent.h" #include "remotepeer.h" #include "storage.h" @@ -227,7 +226,7 @@ void CoreSession::removeClient(Peer *peer) { RemotePeer *p = qobject_cast(peer); if (p) - quInfo() << qPrintable(i18n("Client")) << p->description() << qPrintable(i18n("disconnected (UserId: %1).").arg(user().toInt())); + kDebug(30000) << qPrintable(i18n("Client")) << p->description() << qPrintable(i18n("disconnected (UserId: %1).").arg(user().toInt())); } @@ -245,7 +244,7 @@ void CoreSession::msgFromClient(BufferInfo bufinfo, QString msg) net->userInput(bufinfo, msg); } else { - qWarning() << "Trying to send to unconnected network:" << msg; + kWarning(300000) << "Trying to send to unconnected network:" << msg; } } @@ -424,7 +423,7 @@ void CoreSession::createIdentity(const Identity &identity, const QVariantMap &ad if (additional.contains("CertPem")) coreIdentity.setSslCert(additional["CertPem"].toByteArray()); #endif - qDebug() << Q_FUNC_INFO; + kDebug(300000) << Q_FUNC_INFO; IdentityId id = Core::createIdentity(user(), coreIdentity); if (!id.isValid()) return; @@ -475,7 +474,7 @@ void CoreSession::createNetwork(const NetworkInfo &info_, const QStringList &per Core::createNetwork(user(), info); if (!info.networkId.isValid()) { - qWarning() << qPrintable(i18n("CoreSession::createNetwork(): Got invalid networkId from Core when trying to create network %1!").arg(info.networkName)); + kWarning(300000) << qPrintable(i18n("CoreSession::createNetwork(): Got invalid networkId from Core when trying to create network %1!").arg(info.networkName)); return; } @@ -485,7 +484,7 @@ void CoreSession::createNetwork(const NetworkInfo &info_, const QStringList &per QRegExp rx("\\s*(\\S+)(?:\\s*(\\S+))?\\s*"); foreach(QString channel, persistentChans) { if (!rx.exactMatch(channel)) { - qWarning() << QString("Invalid persistent channel declaration: %1").arg(channel); + kWarning(300000) << QString("Invalid persistent channel declaration: %1").arg(channel); continue; } Core::bufferInfo(user(), info.networkId, BufferInfo::ChannelBuffer, rx.cap(1), true); @@ -507,7 +506,7 @@ void CoreSession::createNetwork(const NetworkInfo &info_, const QStringList &per emit networkCreated(id); } else { - qWarning() << qPrintable(i18n("CoreSession::createNetwork(): Trying to create a network that already exists, updating instead!")); + kWarning(300000) << qPrintable(i18n("CoreSession::createNetwork(): Trying to create a network that already exists, updating instead!")); _networks[info.networkId]->requestSetNetworkInfo(info); } } diff --git a/kuassel/src/core/coresessioneventprocessor.cpp b/kuassel/src/core/coresessioneventprocessor.cpp index 22207be4..7e9a2d70 100644 --- a/kuassel/src/core/coresessioneventprocessor.cpp +++ b/kuassel/src/core/coresessioneventprocessor.cpp @@ -28,7 +28,6 @@ #include "ctcpevent.h" #include "ircevent.h" #include "ircuser.h" -#include "logger.h" #include "messageevent.h" #include "netsplit.h" #include "quassel.h" @@ -50,11 +49,11 @@ bool CoreSessionEventProcessor::checkParamCount(IrcEvent *e, int minParams) { if (e->params().count() < minParams) { if (e->type() == EventManager::IrcEventNumeric) { - qWarning() << "Command " << static_cast(e)->number() << " requires " << minParams << "params, got: " << e->params(); + kWarning(300000) << "Command " << static_cast(e)->number() << " requires " << minParams << "params, got: " << e->params(); } else { QString name = coreSession()->eventManager()->enumName(e->type()); - qWarning() << qPrintable(name) << "requires" << minParams << "params, got:" << e->params(); + kWarning(300000) << qPrintable(name) << "requires" << minParams << "params, got:" << e->params(); } e->stop(); return false; @@ -113,7 +112,7 @@ void CoreSessionEventProcessor::processIrcEventAuthenticate(IrcEvent *e) return; if (e->params().at(0) != "+") { - qWarning() << "Invalid AUTHENTICATE" << e; + kWarning(300000) << "Invalid AUTHENTICATE" << e; return; } @@ -248,7 +247,7 @@ void CoreSessionEventProcessor::processIrcEventMode(IrcEvent *e) if (paramOffset < e->params().count()) { IrcUser *ircUser = e->network()->ircUser(e->params()[paramOffset]); if (!ircUser) { - qWarning() << Q_FUNC_INFO << "Unknown IrcUser:" << e->params()[paramOffset]; + kWarning(300000) << Q_FUNC_INFO << "Unknown IrcUser:" << e->params()[paramOffset]; } else { if (add) { @@ -269,7 +268,7 @@ void CoreSessionEventProcessor::processIrcEventMode(IrcEvent *e) } } else { - qWarning() << "Received MODE with too few parameters:" << e->params(); + kWarning(300000) << "Received MODE with too few parameters:" << e->params(); } ++paramOffset; } @@ -282,7 +281,7 @@ void CoreSessionEventProcessor::processIrcEventMode(IrcEvent *e) value = e->params()[paramOffset]; } else { - qWarning() << "Received MODE with too few parameters:" << e->params(); + kWarning(300000) << "Received MODE with too few parameters:" << e->params(); } ++paramOffset; } @@ -332,7 +331,7 @@ void CoreSessionEventProcessor::lateProcessIrcEventNick(IrcEvent *e) if (checkParamCount(e, 1)) { IrcUser *ircuser = e->network()->updateNickFromMask(e->prefix()); if (!ircuser) { - qWarning() << Q_FUNC_INFO << "Unknown IrcUser!"; + kWarning(300000) << Q_FUNC_INFO << "Unknown IrcUser!"; return; } QString newnick = e->params().at(0); @@ -352,7 +351,7 @@ void CoreSessionEventProcessor::lateProcessIrcEventPart(IrcEvent *e) if (checkParamCount(e, 1)) { IrcUser *ircuser = e->network()->updateNickFromMask(e->prefix()); if (!ircuser) { - qWarning() << Q_FUNC_INFO<< "Unknown IrcUser!"; + kWarning(300000) << Q_FUNC_INFO<< "Unknown IrcUser!"; return; } QString channel = e->params().at(0); @@ -786,7 +785,7 @@ void CoreSessionEventProcessor::processIrcEvent353(IrcEvent *e) IrcChannel *channel = e->network()->ircChannel(channelname); if (!channel) { - qWarning() << Q_FUNC_INFO << "Received unknown target channel:" << channelname; + kWarning(300000) << Q_FUNC_INFO << "Received unknown target channel:" << channelname; return; } @@ -923,7 +922,7 @@ void CoreSessionEventProcessor::handleEarlyNetsplitJoin(Network *net, const QStr { IrcChannel *ircChannel = net->ircChannel(channel); if (!ircChannel) { - qDebug() << "handleEarlyNetsplitJoin(): channel " << channel << " invalid"; + kDebug(300000) << "handleEarlyNetsplitJoin(): channel " << channel << " invalid"; return; } QList events; @@ -1019,7 +1018,7 @@ void CoreSessionEventProcessor::handleCtcpDcc(CtcpEvent *e) { // DCC support is unfinished, experimental and potentially dangerous, so make it opt-in if (!Quassel::isOptionSet("enable-experimental-dcc")) { - quInfo() << "DCC disabled, start core with --enable-experimental-dcc if you really want to try it out"; + kDebug(30000) << "DCC disabled, start core with --enable-experimental-dcc if you really want to try it out"; return; } @@ -1030,7 +1029,7 @@ void CoreSessionEventProcessor::handleCtcpDcc(CtcpEvent *e) QString cmd = params[0].toUpper(); if (cmd == "SEND") { if (params.count() < 4) { - qWarning() << "Invalid DCC SEND request:" << e; // TODO emit proper error to client + kWarning(300000) << "Invalid DCC SEND request:" << e; // TODO emit proper error to client return; } QString filename = params[1]; @@ -1040,7 +1039,7 @@ void CoreSessionEventProcessor::handleCtcpDcc(CtcpEvent *e) QString numIp = params[2]; // this is either IPv4 as a 32 bit value, or IPv6 (which always contains a colon) if (numIp.contains(':')) { // IPv6 if (!address.setAddress(numIp)) { - qWarning() << "Invalid IPv6:" << numIp; + kWarning(300000) << "Invalid IPv6:" << numIp; return; } } @@ -1053,7 +1052,7 @@ void CoreSessionEventProcessor::handleCtcpDcc(CtcpEvent *e) return; } if (port < 1024) { - qWarning() << "Privileged port requested:" << port; // FIXME ask user if this is ok + kWarning(300000) << "Privileged port requested:" << port; // FIXME ask user if this is ok } diff --git a/kuassel/src/core/coretransfer.cpp b/kuassel/src/core/coretransfer.cpp index 3b1245ce..15458317 100644 --- a/kuassel/src/core/coretransfer.cpp +++ b/kuassel/src/core/coretransfer.cpp @@ -153,15 +153,15 @@ void CoreTransfer::onDataReceived() // Send ack to sender. The DCC protocol only specifies 32 bit values, but modern clients (i.e. those who can send files // larger than 4 GB) will ignore this anyway... - quint32 ack = qToBigEndian((quint32)_pos);// qDebug() << Q_FUNC_INFO << _pos; + quint32 ack = qToBigEndian((quint32)_pos);// kDebug(300000) << Q_FUNC_INFO << _pos; _socket->write((char *)&ack, 4); if (_pos > fileSize()) { - qWarning() << "DCC Receive: Got more data than expected!"; + kWarning(300000) << "DCC Receive: Got more data than expected!"; setError(i18n("DCC Receive: Got more data than expected!")); } else if (_pos == fileSize()) { - qDebug() << "DCC Receive: Transfer finished"; + kDebug(300000) << "DCC Receive: Transfer finished"; if (relayData(QByteArray(), false)) // empty buffer setState(Completed); } diff --git a/kuassel/src/core/coretransfermanager.cpp b/kuassel/src/core/coretransfermanager.cpp index c8f79dda..00c425b7 100644 --- a/kuassel/src/core/coretransfermanager.cpp +++ b/kuassel/src/core/coretransfermanager.cpp @@ -47,7 +47,7 @@ void CoreTransferManager::onTransferAdded(const Transfer *transfer) // for core-side use, publishing a non-const pointer is ok CoreTransfer *t = const_cast(qobject_cast(transfer)); if (!t) { - qWarning() << "Invalid Transfer added to CoreTransferManager!"; + kWarning(300000) << "Invalid Transfer added to CoreTransferManager!"; return; } diff --git a/kuassel/src/core/coreuserinputhandler.cpp b/kuassel/src/core/coreuserinputhandler.cpp index 16b185e5..d309e7b4 100644 --- a/kuassel/src/core/coreuserinputhandler.cpp +++ b/kuassel/src/core/coreuserinputhandler.cpp @@ -794,7 +794,7 @@ void CoreUserInputHandler::putPrivmsg(const QByteArray &target, const QByteArray maxSplitPos = splitPos - 1; if (maxSplitPos <= 0) { // this should never happen, but who knows... - qWarning() << i18n("[Error] Could not encrypt your message: %1").arg(message.data()); + kWarning(300000) << i18n("[Error] Could not encrypt your message: %1").arg(message.data()); return; } continue; // we never come back here for !encrypted! diff --git a/kuassel/src/core/eventstringifier.cpp b/kuassel/src/core/eventstringifier.cpp index 7e4ca3d3..8dc05143 100644 --- a/kuassel/src/core/eventstringifier.cpp +++ b/kuassel/src/core/eventstringifier.cpp @@ -58,11 +58,11 @@ bool EventStringifier::checkParamCount(IrcEvent *e, int minParams) { if (e->params().count() < minParams) { if (e->type() == EventManager::IrcEventNumeric) { - qWarning() << "Command " << static_cast(e)->number() << " requires " << minParams << "params, got: " << e->params(); + kWarning(300000) << "Command " << static_cast(e)->number() << " requires " << minParams << "params, got: " << e->params(); } else { QString name = coreSession()->eventManager()->enumName(e->type()); - qWarning() << qPrintable(name) << "requires" << minParams << "params, got:" << e->params(); + kWarning(300000) << qPrintable(name) << "requires" << minParams << "params, got:" << e->params(); } e->stop(); return false; @@ -90,7 +90,7 @@ void EventStringifier::processNetworkSplitQuit(NetworkSplitEvent *e) void EventStringifier::processIrcEventNumeric(IrcEventNumeric *e) { - //qDebug() << e->number(); + //kDebug(300000) << e->number(); switch (e->number()) { // Welcome, status, info messages. Just display these. case 1: @@ -289,7 +289,7 @@ void EventStringifier::processIrcEventNick(IrcEvent *e) IrcUser *ircuser = e->network()->updateNickFromMask(e->prefix()); if (!ircuser) { - qWarning() << Q_FUNC_INFO << "Unknown IrcUser!"; + kWarning(300000) << Q_FUNC_INFO << "Unknown IrcUser!"; return; } @@ -569,7 +569,7 @@ void EventStringifier::processIrcEvent329(IrcEvent *e) QString channel = e->params()[0]; uint unixtime = e->params()[1].toUInt(); if (!unixtime) { - qWarning() << Q_FUNC_INFO << "received invalid timestamp:" << e->params()[1]; + kWarning(300000) << Q_FUNC_INFO << "received invalid timestamp:" << e->params()[1]; return; } QDateTime time = QDateTime::fromTime_t(unixtime).toUTC(); diff --git a/kuassel/src/core/ircparser.cpp b/kuassel/src/core/ircparser.cpp index acc765ad..f82fef54 100644 --- a/kuassel/src/core/ircparser.cpp +++ b/kuassel/src/core/ircparser.cpp @@ -42,7 +42,7 @@ IrcParser::IrcParser(CoreSession *session) : bool IrcParser::checkParamCount(const QString &cmd, const QList ¶ms, int minParams) { if (params.count() < minParams) { - qWarning() << "Expected" << minParams << "params for IRC command" << cmd << ", got:" << params; + kWarning(300000) << "Expected" << minParams << "params for IRC command" << cmd << ", got:" << params; return false; } return true; @@ -78,7 +78,7 @@ void IrcParser::processNetworkIncoming(NetworkDataEvent *e) { CoreNetwork *net = qobject_cast(e->network()); if (!net) { - qWarning() << "Received network event without valid network pointer!"; + kWarning(300000) << "Received network event without valid network pointer!"; return; } @@ -87,7 +87,7 @@ void IrcParser::processNetworkIncoming(NetworkDataEvent *e) QByteArray msg = e->data(); if (msg.isEmpty()) { - qWarning() << "Received empty string from server!"; + kWarning(300000) << "Received empty string from server!"; return; } @@ -120,7 +120,7 @@ void IrcParser::processNetworkIncoming(NetworkDataEvent *e) if (!trailing.isEmpty()) params << trailing; if (params.count() < 1) { - qWarning() << "Received invalid string from server!"; + kWarning(300000) << "Received invalid string from server!"; return; } @@ -131,7 +131,7 @@ void IrcParser::processNetworkIncoming(NetworkDataEvent *e) foo.remove(0, 1); prefix = foo; if (params.count() < 1) { - qWarning() << "Received invalid string from server!"; + kWarning(300000) << "Received invalid string from server!"; return; } foo = net->serverDecode(params.takeFirst()); @@ -147,7 +147,7 @@ void IrcParser::processNetworkIncoming(NetworkDataEvent *e) if (num > 0) { // numeric reply if (params.count() == 0) { - qWarning() << "Message received from server violates RFC and is ignored!" << msg; + kWarning(300000) << "Message received from server violates RFC and is ignored!" << msg; return; } // numeric replies have the target as first param (RFC 2812 - 2.4). this is usually our own nick. Remove this! diff --git a/kuassel/src/core/postgresqlstorage.cpp b/kuassel/src/core/postgresqlstorage.cpp index 9c64eb6d..7568056a 100644 --- a/kuassel/src/core/postgresqlstorage.cpp +++ b/kuassel/src/core/postgresqlstorage.cpp @@ -22,7 +22,6 @@ #include -#include "logger.h" #include "network.h" #include "quassel.h" @@ -54,7 +53,7 @@ AbstractSqlMigrationWriter *PostgreSqlStorage::createMigrationWriter() bool PostgreSqlStorage::isAvailable() const { - qDebug() << QSqlDatabase::drivers(); + kDebug(300000) << QSqlDatabase::drivers(); if (!QSqlDatabase::isDriverAvailable("QPSQL")) return false; return true; } @@ -111,7 +110,7 @@ bool PostgreSqlStorage::initDbSession(QSqlDatabase &db) // as this is the expected behavior. // If it is a newer version, switch to legacy mode. - quWarning() << "Switching Postgres to legacy mode. (set standard conforming strings to off)"; + kWarning(300000) << "Switching Postgres to legacy mode. (set standard conforming strings to off)"; // If the following calls fail, it is a legacy DB anyways, so it doesn't matter // and no need to check the outcome. db.exec("set standard_conforming_strings = off"); @@ -125,14 +124,14 @@ bool PostgreSqlStorage::initDbSession(QSqlDatabase &db) if (query.lastError().isValid()) { // We cannot enable standard conforming strings... // since Quassel does no escaping by itself, this would yield a major vulnerability. - quError() << "Failed to enable standard_conforming_strings for the Postgres db!"; + kError(300000) << "Failed to enable standard_conforming_strings for the Postgres db!"; return false; } } break; default: // The slash got replaced with 0 or more than 2 slashes! o_O - quError() << "Your version of Qt does something _VERY_ strange to slashes in QSqlQueries! You should consult your trusted doctor!"; + kError(300000) << "Your version of Qt does something _VERY_ strange to slashes in QSqlQueries! You should consult your trusted doctor!"; return false; break; } @@ -298,7 +297,7 @@ void PostgreSqlStorage::delUser(UserId user) { QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::delUser(): cannot start transaction!"; + kWarning(300000) << "PostgreSqlStorage::delUser(): cannot start transaction!"; return; } @@ -379,8 +378,8 @@ IdentityId PostgreSqlStorage::createIdentity(UserId user, CoreIdentity &identity QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::createIdentity(): Unable to start Transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::createIdentity(): Unable to start Transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return identityId; } @@ -439,8 +438,8 @@ IdentityId PostgreSqlStorage::createIdentity(UserId user, CoreIdentity &identity } if (!db.commit()) { - qWarning() << "PostgreSqlStorage::createIdentity(): committing data failed!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::createIdentity(): committing data failed!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return IdentityId(); } return identityId; @@ -451,8 +450,8 @@ bool PostgreSqlStorage::updateIdentity(UserId user, const CoreIdentity &identity { QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::updateIdentity(): Unable to start Transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::updateIdentity(): Unable to start Transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return false; } @@ -525,8 +524,8 @@ bool PostgreSqlStorage::updateIdentity(UserId user, const CoreIdentity &identity } if (!db.commit()) { - qWarning() << "PostgreSqlStorage::updateIdentity(): committing data failed!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::updateIdentity(): committing data failed!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return false; } return true; @@ -537,8 +536,8 @@ void PostgreSqlStorage::removeIdentity(UserId user, IdentityId identityId) { QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::removeIdentity(): Unable to start Transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::removeIdentity(): Unable to start Transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return; } @@ -562,8 +561,8 @@ QList PostgreSqlStorage::identities(UserId user) QSqlDatabase db = logDb(); if (!beginReadOnlyTransaction(db)) { - qWarning() << "PostgreSqlStorage::identites(): cannot start read only transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::identites(): cannot start read only transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return identities; } @@ -623,8 +622,8 @@ NetworkId PostgreSqlStorage::createNetwork(UserId user, const NetworkInfo &info) QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::createNetwork(): failed to begin transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::createNetwork(): failed to begin transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return false; } @@ -660,8 +659,8 @@ NetworkId PostgreSqlStorage::createNetwork(UserId user, const NetworkInfo &info) } if (!db.commit()) { - qWarning() << "PostgreSqlStorage::createNetwork(): committing data failed!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::createNetwork(): committing data failed!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return NetworkId(); } return networkId; @@ -713,8 +712,8 @@ bool PostgreSqlStorage::updateNetwork(UserId user, const NetworkInfo &info) { QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::updateNetwork(): failed to begin transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::updateNetwork(): failed to begin transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return false; } @@ -756,8 +755,8 @@ bool PostgreSqlStorage::updateNetwork(UserId user, const NetworkInfo &info) } if (!db.commit()) { - qWarning() << "PostgreSqlStorage::updateNetwork(): committing data failed!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::updateNetwork(): committing data failed!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return false; } return true; @@ -768,8 +767,8 @@ bool PostgreSqlStorage::removeNetwork(UserId user, const NetworkId &networkId) { QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::removeNetwork(): cannot start transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::removeNetwork(): cannot start transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return false; } @@ -794,8 +793,8 @@ QList PostgreSqlStorage::networks(UserId user) QSqlDatabase db = logDb(); if (!beginReadOnlyTransaction(db)) { - qWarning() << "PostgreSqlStorage::networks(): cannot start read only transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::networks(): cannot start read only transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return nets; } @@ -871,8 +870,8 @@ QList PostgreSqlStorage::connectedNetworks(UserId user) QSqlDatabase db = logDb(); if (!beginReadOnlyTransaction(db)) { - qWarning() << "PostgreSqlStorage::connectedNetworks(): cannot start read only transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::connectedNetworks(): cannot start read only transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return connectedNets; } @@ -909,8 +908,8 @@ QHash PostgreSqlStorage::persistentChannels(UserId user, const QSqlDatabase db = logDb(); if (!beginReadOnlyTransaction(db)) { - qWarning() << "PostgreSqlStorage::persistentChannels(): cannot start read only transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::persistentChannels(): cannot start read only transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return persistentChans; } @@ -1014,8 +1013,8 @@ BufferInfo PostgreSqlStorage::bufferInfo(UserId user, const NetworkId &networkId { QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::bufferInfo(): cannot start read only transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::bufferInfo(): cannot start read only transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return BufferInfo(); } @@ -1059,7 +1058,7 @@ BufferInfo PostgreSqlStorage::bufferInfo(UserId user, const NetworkId &networkId safeExec(createQuery); if (!watchQuery(createQuery)) { - qWarning() << "PostgreSqlStorage::bufferInfo(): unable to create buffer"; + kWarning(300000) << "PostgreSqlStorage::bufferInfo(): unable to create buffer"; db.rollback(); return BufferInfo(); } @@ -1098,8 +1097,8 @@ QList PostgreSqlStorage::requestBuffers(UserId user) QSqlDatabase db = logDb(); if (!beginReadOnlyTransaction(db)) { - qWarning() << "PostgreSqlStorage::requestBuffers(): cannot start read only transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::requestBuffers(): cannot start read only transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return bufferlist; } @@ -1123,8 +1122,8 @@ QList PostgreSqlStorage::requestBufferIdsForNetwork(UserId user, Netwo QSqlDatabase db = logDb(); if (!beginReadOnlyTransaction(db)) { - qWarning() << "PostgreSqlStorage::requestBufferIdsForNetwork(): cannot start read only transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::requestBufferIdsForNetwork(): cannot start read only transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return bufferList; } @@ -1147,7 +1146,7 @@ bool PostgreSqlStorage::removeBuffer(const UserId &user, const BufferId &bufferI { QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::removeBuffer(): cannot start transaction!"; + kWarning(300000) << "PostgreSqlStorage::removeBuffer(): cannot start transaction!"; return false; } @@ -1171,7 +1170,7 @@ bool PostgreSqlStorage::removeBuffer(const UserId &user, const BufferId &bufferI return true; default: // there was more then one buffer deleted... - qWarning() << "PostgreSqlStorage::removeBuffer(): Userid" << user << "BufferId" << "caused deletion of" << numRows << "Buffers! Rolling back transaction..."; + kWarning(300000) << "PostgreSqlStorage::removeBuffer(): Userid" << user << "BufferId" << "caused deletion of" << numRows << "Buffers! Rolling back transaction..."; db.rollback(); return false; } @@ -1182,7 +1181,7 @@ bool PostgreSqlStorage::renameBuffer(const UserId &user, const BufferId &bufferI { QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::renameBuffer(): cannot start transaction!"; + kWarning(300000) << "PostgreSqlStorage::renameBuffer(): cannot start transaction!"; return false; } @@ -1208,7 +1207,7 @@ bool PostgreSqlStorage::renameBuffer(const UserId &user, const BufferId &bufferI return true; default: // there was more then one buffer deleted... - qWarning() << "PostgreSqlStorage::renameBuffer(): Userid" << user << "BufferId" << "affected" << numRows << "Buffers! Rolling back transaction..."; + kWarning(300000) << "PostgreSqlStorage::renameBuffer(): Userid" << user << "BufferId" << "affected" << numRows << "Buffers! Rolling back transaction..."; db.rollback(); return false; } @@ -1219,8 +1218,8 @@ bool PostgreSqlStorage::mergeBuffersPermanently(const UserId &user, const Buffer { QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::mergeBuffersPermanently(): cannot start transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::mergeBuffersPermanently(): cannot start transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return false; } @@ -1285,8 +1284,8 @@ QHash PostgreSqlStorage::bufferLastSeenMsgIds(UserId user) QSqlDatabase db = logDb(); if (!beginReadOnlyTransaction(db)) { - qWarning() << "PostgreSqlStorage::bufferLastSeenMsgIds(): cannot start read only transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::bufferLastSeenMsgIds(): cannot start read only transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return lastSeenHash; } @@ -1327,8 +1326,8 @@ QHash PostgreSqlStorage::bufferMarkerLineMsgIds(UserId user) QSqlDatabase db = logDb(); if (!beginReadOnlyTransaction(db)) { - qWarning() << "PostgreSqlStorage::bufferMarkerLineMsgIds(): cannot start read only transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::bufferMarkerLineMsgIds(): cannot start read only transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return markerLineHash; } @@ -1354,8 +1353,8 @@ bool PostgreSqlStorage::logMessage(Message &msg) { QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::logMessage(): cannot start transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::logMessage(): cannot start transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return false; } @@ -1416,8 +1415,8 @@ bool PostgreSqlStorage::logMessages(MessageList &msgs) { QSqlDatabase db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::logMessage(): cannot start transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::logMessage(): cannot start transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return false; } @@ -1501,8 +1500,8 @@ QList PostgreSqlStorage::requestMsgs(UserId user, BufferId bufferId, Ms QSqlDatabase db = logDb(); if (!beginReadOnlyTransaction(db)) { - qWarning() << "PostgreSqlStorage::requestMsgs(): cannot start read only transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::requestMsgs(): cannot start read only transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return messagelist; } @@ -1535,7 +1534,7 @@ QList PostgreSqlStorage::requestMsgs(UserId user, BufferId bufferId, Ms QSqlQuery query = executePreparedQuery(queryName, params, db); if (!watchQuery(query)) { - qDebug() << "select_messages failed"; + kDebug(300000) << "select_messages failed"; db.rollback(); return messagelist; } @@ -1571,8 +1570,8 @@ QList PostgreSqlStorage::requestAllMsgs(UserId user, MsgId first, MsgId QSqlDatabase db = logDb(); if (!beginReadOnlyTransaction(db)) { - qWarning() << "PostgreSqlStorage::requestAllMsgs(): cannot start read only transaction!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::requestAllMsgs(): cannot start read only transaction!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return messagelist; } @@ -1612,25 +1611,25 @@ QList PostgreSqlStorage::requestAllMsgs(UserId user, MsgId first, MsgId // void PostgreSqlStorage::safeExec(QSqlQuery &query) { -// qDebug() << "PostgreSqlStorage::safeExec"; -// qDebug() << " executing:\n" << query.executedQuery(); -// qDebug() << " bound Values:"; +// kDebug(300000) << "PostgreSqlStorage::safeExec"; +// kDebug(300000) << " executing:\n" << query.executedQuery(); +// kDebug(300000) << " bound Values:"; // QList list = query.boundValues().values(); // for (int i = 0; i < list.size(); ++i) // qCritical() << i << ": " << list.at(i).toString().toLatin1().data(); // query.exec(); -// qDebug() << "Success:" << !query.lastError().isValid(); -// qDebug(); +// kDebug(300000) << "Success:" << !query.lastError().isValid(); +// kDebug(300000); // if(!query.lastError().isValid()) // return; -// qDebug() << "==================== ERROR ===================="; +// kDebug(300000) << "==================== ERROR ===================="; // watchQuery(query); -// qDebug() << "==============================================="; -// qDebug(); +// kDebug(300000) << "==============================================="; +// kDebug(300000); // return; // } @@ -1675,8 +1674,8 @@ QSqlQuery PostgreSqlStorage::prepareAndExecuteQuery(const QString &queryname, co if (!db.isOpen()) { db = logDb(); if (!beginTransaction(db)) { - qWarning() << "PostgreSqlStorage::prepareAndExecuteQuery(): cannot start transaction while recovering from connection loss!"; - qWarning() << " -" << qPrintable(db.lastError().text()); + kWarning(300000) << "PostgreSqlStorage::prepareAndExecuteQuery(): cannot start transaction while recovering from connection loss!"; + kWarning(300000) << " -" << qPrintable(db.lastError().text()); return query; } db.exec("SAVEPOINT quassel_prepare_query"); @@ -1691,8 +1690,8 @@ QSqlQuery PostgreSqlStorage::prepareAndExecuteQuery(const QString &queryname, co if (checkQuery.value(0).toInt() == 0) { db.exec(QString("PREPARE quassel_%1 AS %2").arg(queryname).arg(queryString(queryname))); if (db.lastError().isValid()) { - qWarning() << "PostgreSqlStorage::prepareQuery(): unable to prepare query:" << queryname << "AS" << queryString(queryname); - qWarning() << " Error:" << db.lastError().text(); + kWarning(300000) << "PostgreSqlStorage::prepareQuery(): unable to prepare query:" << queryname << "AS" << queryString(queryname); + kWarning(300000) << " Error:" << db.lastError().text(); return QSqlQuery(db); } } diff --git a/kuassel/src/core/sessionthread.cpp b/kuassel/src/core/sessionthread.cpp index 74d260b2..57470f75 100644 --- a/kuassel/src/core/sessionthread.cpp +++ b/kuassel/src/core/sessionthread.cpp @@ -98,7 +98,7 @@ void SessionThread::addClientToSession(QObject *peer) return; } - qWarning() << "SessionThread::addClient() received invalid peer!" << peer; + kWarning(300000) << "SessionThread::addClient() received invalid peer!" << peer; } diff --git a/kuassel/src/core/sqlitestorage.cpp b/kuassel/src/core/sqlitestorage.cpp index b84d101d..2d425224 100644 --- a/kuassel/src/core/sqlitestorage.cpp +++ b/kuassel/src/core/sqlitestorage.cpp @@ -22,7 +22,6 @@ #include -#include "logger.h" #include "network.h" #include "quassel.h" diff --git a/kuassel/src/core/sslserver.cpp b/kuassel/src/core/sslserver.cpp index 203c377e..ec152b38 100644 --- a/kuassel/src/core/sslserver.cpp +++ b/kuassel/src/core/sslserver.cpp @@ -27,7 +27,8 @@ #include #include -#include "logger.h" +#include + #include "quassel.h" #ifdef HAVE_SSL @@ -39,7 +40,7 @@ SslServer::SslServer(QObject *parent) static bool sslWarningShown = false; if (!setCertificate(Quassel::configDirPath() + "quasselCert.pem")) { if (!sslWarningShown) { - quWarning() + kWarning(300000) << "SslServer: Unable to set certificate file\n" << " Quassel Core will still work, but cannot provide SSL for client connections.\n" << " Please see http://quassel-irc.org/faq/cert to learn how to enable SSL support."; @@ -88,12 +89,12 @@ bool SslServer::setCertificate(const QString &path) QFile certFile(path); if (!certFile.exists()) { - quWarning() << "SslServer: Certificate file" << qPrintable(path) << "does not exist"; + kWarning(300000) << "SslServer: Certificate file" << qPrintable(path) << "does not exist"; return false; } if (!certFile.open(QIODevice::ReadOnly)) { - quWarning() + kWarning(300000) << "SslServer: Failed to open certificate file" << qPrintable(path) << "error:" << certFile.error(); return false; @@ -102,7 +103,7 @@ bool SslServer::setCertificate(const QString &path) QList certList = QSslCertificate::fromDevice(&certFile); if (certList.isEmpty()) { - quWarning() << "SslServer: Certificate file doesn't contain a certificate"; + kWarning(300000) << "SslServer: Certificate file doesn't contain a certificate"; return false; } @@ -113,7 +114,7 @@ bool SslServer::setCertificate(const QString &path) _ca = certList; if (!certFile.reset()) { - quWarning() << "SslServer: IO error reading certificate file"; + kWarning(300000) << "SslServer: IO error reading certificate file"; return false; } @@ -121,17 +122,17 @@ bool SslServer::setCertificate(const QString &path) certFile.close(); if (_cert.isNull()) { - quWarning() << "SslServer:" << qPrintable(path) << "contains no certificate data"; + kWarning(300000) << "SslServer:" << qPrintable(path) << "contains no certificate data"; return false; } // We allow the core to offer SSL anyway, so no "return false" here. Client will warn about the cert being invalid. const QDateTime now = QDateTime::currentDateTime(); if (now < _cert.effectiveDate()) - quWarning() << "SslServer: Certificate won't be valid before" << _cert.effectiveDate().toString(); + kWarning(300000) << "SslServer: Certificate won't be valid before" << _cert.effectiveDate().toString(); else if (now > _cert.expiryDate()) - quWarning() << "SslServer: Certificate expired on" << _cert.expiryDate().toString(); + kWarning(300000) << "SslServer: Certificate expired on" << _cert.expiryDate().toString(); else { // Qt4's isValid() checks for time range and blacklist; avoid a double warning, hence the else block #if QT_VERSION < 0x050000 @@ -139,10 +140,10 @@ bool SslServer::setCertificate(const QString &path) #else if (_cert.isBlacklisted()) #endif - quWarning() << "SslServer: Certificate blacklisted"; + kWarning(300000) << "SslServer: Certificate blacklisted"; } if (_key.isNull()) { - quWarning() << "SslServer:" << qPrintable(path) << "contains no key data"; + kWarning(300000) << "SslServer:" << qPrintable(path) << "contains no key data"; return false; } diff --git a/kuassel/src/qtui/chatitem.cpp b/kuassel/src/qtui/chatitem.cpp index 9e3bf172..4bac7a53 100644 --- a/kuassel/src/qtui/chatitem.cpp +++ b/kuassel/src/qtui/chatitem.cpp @@ -115,7 +115,7 @@ QVariant ChatItem::data(int role) const { QModelIndex index = model()->index(row(), column()); if (!index.isValid()) { - qWarning() << "ChatItem::data(): model index is invalid!" << index; + kWarning(300000) << "ChatItem::data(): model index is invalid!" << index; return QVariant(); } return model()->data(index, role); @@ -651,8 +651,8 @@ void ContentsChatItem::doLayout(QTextLayout *layout) const line.setNumColumns(i); } if (num != line.textLength()) { - qWarning() << "WARNING: Layout engine couldn't workaround Qt bug 238249, please report!"; - // qDebug() << num << line.textLength() << t.mid(line.textStart(), line.textLength()) << t.mid(line.textStart() + line.textLength()); + kWarning(300000) << "WARNING: Layout engine couldn't workaround Qt bug 238249, please report!"; + // kDebug(300000) << num << line.textLength() << t.mid(line.textStart(), line.textLength()) << t.mid(line.textStart() + line.textLength()); } line.setPosition(QPointF(0, h)); diff --git a/kuassel/src/qtui/chatmonitorfilter.cpp b/kuassel/src/qtui/chatmonitorfilter.cpp index db0c8892..cf9b1d08 100644 --- a/kuassel/src/qtui/chatmonitorfilter.cpp +++ b/kuassel/src/qtui/chatmonitorfilter.cpp @@ -104,7 +104,7 @@ QVariant ChatMonitorFilter::data(const QModelIndex &index, int role) const BufferId bufid = data(index, ChatLineModel::BufferIdRole).value(); if (!bufid.isValid()) { - qDebug() << "ChatMonitorFilter::data(): chatline belongs to an invalid buffer!"; + kDebug(300000) << "ChatMonitorFilter::data(): chatline belongs to an invalid buffer!"; return QVariant(); } diff --git a/kuassel/src/qtui/chatscene.cpp b/kuassel/src/qtui/chatscene.cpp index d033de78..43ed45a3 100644 --- a/kuassel/src/qtui/chatscene.cpp +++ b/kuassel/src/qtui/chatscene.cpp @@ -316,19 +316,19 @@ void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) // QModelIndex sidx = model()->index(start, 2); // QModelIndex eidx = model()->index(end, 2); -// qDebug() << "rowsInserted:"; +// kDebug(300000) << "rowsInserted:"; // if(start > 0) { // QModelIndex ssidx = model()->index(start - 1, 2); -// qDebug() << "Start--:" << start - 1 << ssidx.data(MessageModel::MsgIdRole).value() +// kDebug(300000) << "Start--:" << start - 1 << ssidx.data(MessageModel::MsgIdRole).value() // << ssidx.data(Qt::DisplayRole).toString(); // } -// qDebug() << "Start:" << start << sidx.data(MessageModel::MsgIdRole).value() +// kDebug(300000) << "Start:" << start << sidx.data(MessageModel::MsgIdRole).value() // << sidx.data(Qt::DisplayRole).toString(); -// qDebug() << "End:" << end << eidx.data(MessageModel::MsgIdRole).value() +// kDebug(300000) << "End:" << end << eidx.data(MessageModel::MsgIdRole).value() // << eidx.data(Qt::DisplayRole).toString(); // if(end + 1 < model()->rowCount()) { // QModelIndex eeidx = model()->index(end + 1, 2); -// qDebug() << "End++:" << end + 1 << eeidx.data(MessageModel::MsgIdRole).value() +// kDebug(300000) << "End++:" << end + 1 << eeidx.data(MessageModel::MsgIdRole).value() // << eeidx.data(Qt::DisplayRole).toString(); // } @@ -412,20 +412,20 @@ void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) Q_ASSERT(start == 0 || _lines.at(start - 1)->pos().y() + _lines.at(start - 1)->height() == _lines.at(start)->pos().y()); // if(start != 0) { // if(_lines.at(start - 1)->pos().y() + _lines.at(start - 1)->height() != _lines.at(start)->pos().y()) { -// qDebug() << "lines:" << _lines.count() << "start:" << start << "end:" << end; -// qDebug() << "line[start - 1]:" << _lines.at(start - 1)->pos().y() << "+" << _lines.at(start - 1)->height() << "=" << _lines.at(start - 1)->pos().y() + _lines.at(start - 1)->height(); -// qDebug() << "line[start]" << _lines.at(start)->pos().y(); -// qDebug() << "needed moving:" << !(atTop || atBottom) << moveTop << moveStart << moveEnd << offset; +// kDebug(300000) << "lines:" << _lines.count() << "start:" << start << "end:" << end; +// kDebug(300000) << "line[start - 1]:" << _lines.at(start - 1)->pos().y() << "+" << _lines.at(start - 1)->height() << "=" << _lines.at(start - 1)->pos().y() + _lines.at(start - 1)->height(); +// kDebug(300000) << "line[start]" << _lines.at(start)->pos().y(); +// kDebug(300000) << "needed moving:" << !(atTop || atBottom) << moveTop << moveStart << moveEnd << offset; // Q_ASSERT(false) // } // } Q_ASSERT(end + 1 == _lines.count() || _lines.at(end)->pos().y() + _lines.at(end)->height() == _lines.at(end + 1)->pos().y()); // if(end + 1 < _lines.count()) { // if(_lines.at(end)->pos().y() + _lines.at(end)->height() != _lines.at(end + 1)->pos().y()) { -// qDebug() << "lines:" << _lines.count() << "start:" << start << "end:" << end; -// qDebug() << "line[end]:" << _lines.at(end)->pos().y() << "+" << _lines.at(end)->height() << "=" << _lines.at(end)->pos().y() + _lines.at(end)->height(); -// qDebug() << "line[end+1]" << _lines.at(end + 1)->pos().y(); -// qDebug() << "needed moving:" << !(atTop || atBottom) << moveTop << moveStart << moveEnd << offset; +// kDebug(300000) << "lines:" << _lines.count() << "start:" << start << "end:" << end; +// kDebug(300000) << "line[end]:" << _lines.at(end)->pos().y() << "+" << _lines.at(end)->height() << "=" << _lines.at(end)->pos().y() + _lines.at(end)->height(); +// kDebug(300000) << "line[end+1]" << _lines.at(end + 1)->pos().y(); +// kDebug(300000) << "needed moving:" << !(atTop || atBottom) << moveTop << moveStart << moveEnd << offset; // Q_ASSERT(false); // } // } @@ -611,7 +611,7 @@ void ChatScene::layout(int start, int end, qreal width) emit layoutChanged(); // clock_t endT = clock(); -// qDebug() << "resized" << _lines.count() << "in" << (float)(endT - startT) / CLOCKS_PER_SEC << "sec"; +// kDebug(300000) << "resized" << _lines.count() << "in" << (float)(endT - startT) / CLOCKS_PER_SEC << "sec"; } @@ -647,7 +647,7 @@ void ChatScene::firstHandlePositionChanged(qreal xpos) setHandleXLimits(); // clock_t endT = clock(); -// qDebug() << "resized" << _lines.count() << "in" << (float)(endT - startT) / CLOCKS_PER_SEC << "sec"; +// kDebug(300000) << "resized" << _lines.count() << "in" << (float)(endT - startT) / CLOCKS_PER_SEC << "sec"; } @@ -685,7 +685,7 @@ void ChatScene::secondHandlePositionChanged(qreal xpos) emit layoutChanged(); // clock_t endT = clock(); -// qDebug() << "resized" << _lines.count() << "in" << (float)(endT - startT) / CLOCKS_PER_SEC << "sec"; +// kDebug(300000) << "resized" << _lines.count() << "in" << (float)(endT - startT) / CLOCKS_PER_SEC << "sec"; } @@ -1004,7 +1004,7 @@ QString ChatScene::selection() const int start = qMin(_selectionStart, _selectionEnd); int end = qMax(_selectionStart, _selectionEnd); if (start < 0 || end >= _lines.count()) { - qDebug() << "Invalid selection range:" << start << end; + kDebug(300000) << "Invalid selection range:" << start << end; return QString(); } QString result; diff --git a/kuassel/src/qtui/coreconfigwizard.cpp b/kuassel/src/qtui/coreconfigwizard.cpp index 2ba8936c..6fda60be 100644 --- a/kuassel/src/qtui/coreconfigwizard.cpp +++ b/kuassel/src/qtui/coreconfigwizard.cpp @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include +#include #include #include #include @@ -252,7 +252,7 @@ QVariantMap StorageSelectionPage::connectionProperties() const properties[key] = def; } } - qDebug() << properties; + kDebug(300000) << properties; // QVariantMap properties = _backends[backend].toMap()["ConnectionProperties"].toMap(); // if(!properties.isEmpty() && _connectionBox) { diff --git a/kuassel/src/qtui/dockmanagernotificationbackend.cpp b/kuassel/src/qtui/dockmanagernotificationbackend.cpp index af7d25d4..991fa662 100644 --- a/kuassel/src/qtui/dockmanagernotificationbackend.cpp +++ b/kuassel/src/qtui/dockmanagernotificationbackend.cpp @@ -46,7 +46,7 @@ DockManagerNotificationBackend::DockManagerNotificationBackend(QObject *parent) if (_dock->isValid()) { _bus.connect("org.freedesktop.DockManager", "/org/freedesktop/DockManager", "org.freedesktop.DockManager", "ItemAdded", this, SLOT(itemAdded(QDBusObjectPath))); } else { - qDebug() << "No DockManager available"; + kDebug(300000) << "No DockManager available"; _enabled = false; return; } @@ -72,7 +72,7 @@ void DockManagerNotificationBackend::itemAdded(QDBusObjectPath p) // stupid implementations (i.e. docky) use uint, but proper casing paths = _dock->call("GetItemsByPID", (unsigned int)QCoreApplication::applicationPid()); if (!paths.isValid()) { - qDebug() << "DBus error:" << paths.error().message(); + kDebug(300000) << "DBus error:" << paths.error().message(); return; } } diff --git a/kuassel/src/qtui/inputwidget.cpp b/kuassel/src/qtui/inputwidget.cpp index a051f375..332361f8 100644 --- a/kuassel/src/qtui/inputwidget.cpp +++ b/kuassel/src/qtui/inputwidget.cpp @@ -445,7 +445,7 @@ void InputWidget::updateNickSelector() const const Identity *identity = Client::identity(net->identity()); if (!identity) { - qWarning() << "InputWidget::updateNickSelector(): can't find Identity for Network" << net->networkId() << "IdentityId:" << net->identity(); + kWarning(300000) << "InputWidget::updateNickSelector(): can't find Identity for Network" << net->networkId() << "IdentityId:" << net->identity(); return; } diff --git a/kuassel/src/qtui/mainwin.cpp b/kuassel/src/qtui/mainwin.cpp index 454195ab..c1538fa9 100644 --- a/kuassel/src/qtui/mainwin.cpp +++ b/kuassel/src/qtui/mainwin.cpp @@ -219,7 +219,7 @@ void MainWin::init() if (Quassel::isOptionSet("url")) { // FIXME: connect to channel upon request from external KDE application - qWarning() << "non-interactive connection not yet implemented:" << Quassel::optionValue("url"); + kWarning(300000) << "non-interactive connection not yet implemented:" << Quassel::optionValue("url"); } } @@ -1346,7 +1346,7 @@ void MainWin::messagesInserted(const QModelIndex &parent, int start, int end) for (int i = start; i <= end; i++) { QModelIndex idx = Client::messageModel()->index(i, ChatLineModel::ContentsColumn); if (!idx.isValid()) { - qDebug() << "MainWin::messagesInserted(): Invalid model index!"; + kDebug(300000) << "MainWin::messagesInserted(): Invalid model index!"; continue; } Message::Flags flags = (Message::Flags)idx.data(ChatLineModel::FlagsRole).toInt(); diff --git a/kuassel/src/qtui/nicklistwidget.cpp b/kuassel/src/qtui/nicklistwidget.cpp index 5f8d7a81..e4b3639e 100644 --- a/kuassel/src/qtui/nicklistwidget.cpp +++ b/kuassel/src/qtui/nicklistwidget.cpp @@ -28,7 +28,7 @@ #include "qtuisettings.h" #include -#include +#include #include #include @@ -140,7 +140,7 @@ void NickListWidget::nickSelectionChanged() NickView *view = qobject_cast(sender()); Q_ASSERT(view); if (view != ui.stackedWidget->currentWidget()) { - qDebug() << "Nick selection of hidden view changed!"; + kDebug(300000) << "Nick selection of hidden view changed!"; return; } emit nickSelectionChanged(view->selectedIndexes()); diff --git a/kuassel/src/qtui/qtui.cpp b/kuassel/src/qtui/qtui.cpp index 4dd8d8fc..f9b61583 100644 --- a/kuassel/src/qtui/qtui.cpp +++ b/kuassel/src/qtui/qtui.cpp @@ -45,7 +45,7 @@ QList QtUi::_notifications; QtUi::QtUi() : GraphicalUi() { if (_instance != 0) { - qWarning() << "QtUi has been instantiated again!"; + kWarning(300000) << "QtUi has been instantiated again!"; return; } _instance = this; diff --git a/kuassel/src/qtui/qtuiapplication.cpp b/kuassel/src/qtui/qtuiapplication.cpp index 755f09c8..7a8f8678 100644 --- a/kuassel/src/qtui/qtuiapplication.cpp +++ b/kuassel/src/qtui/qtuiapplication.cpp @@ -93,7 +93,7 @@ void QtUiApplication::commitData(QSessionManager &manager) void QtUiApplication::saveState(QSessionManager &manager) { - //qDebug() << QString("saving session state to id %1").arg(manager.sessionId()); + //kDebug(300000) << QString("saving session state to id %1").arg(manager.sessionId()); // AccountId activeCore = Client::currentCoreAccount().accountId(); // FIXME store this! SessionSettings s(manager.sessionId()); s.setSessionAge(0); @@ -105,7 +105,7 @@ void QtUiApplication::resumeSessionIfPossible() { // load all sessions if (isSessionRestored()) { - qDebug() << QString("restoring from session %1").arg(sessionId()); + kDebug(300000) << QString("restoring from session %1").arg(sessionId()); SessionSettings s(sessionId()); s.sessionAging(); s.setSessionAge(0); diff --git a/kuassel/src/qtui/qtuistyle.cpp b/kuassel/src/qtui/qtuistyle.cpp index 2ec8a7e2..50df589a 100644 --- a/kuassel/src/qtui/qtuistyle.cpp +++ b/kuassel/src/qtui/qtuistyle.cpp @@ -45,7 +45,7 @@ void QtUiStyle::generateSettingsQss() const { QFile settingsQss(Quassel::configDirPath() + "settings.qss"); if (!settingsQss.open(QFile::WriteOnly|QFile::Truncate)) { - qWarning() << "Could not open" << settingsQss.fileName() << "for writing!"; + kWarning(300000) << "Could not open" << settingsQss.fileName() << "for writing!"; return; } QTextStream out(&settingsQss); diff --git a/kuassel/src/qtui/settingspages/aliasesmodel.cpp b/kuassel/src/qtui/settingspages/aliasesmodel.cpp index 4734dafa..9615e709 100644 --- a/kuassel/src/qtui/settingspages/aliasesmodel.cpp +++ b/kuassel/src/qtui/settingspages/aliasesmodel.cpp @@ -20,7 +20,7 @@ #include "aliasesmodel.h" -#include +#include #include #include "client.h" diff --git a/kuassel/src/qtui/settingspages/bufferviewsettingspage.cpp b/kuassel/src/qtui/settingspages/bufferviewsettingspage.cpp index 0c1c75e9..57038065 100644 --- a/kuassel/src/qtui/settingspages/bufferviewsettingspage.cpp +++ b/kuassel/src/qtui/settingspages/bufferviewsettingspage.cpp @@ -310,7 +310,7 @@ void BufferViewSettingsPage::updateBufferView() int itemPos = listPos(config); if (itemPos == -1) { - qWarning() << "BufferViewSettingsPage::updateBufferView(): view is unknown:" << config->bufferViewId(); + kWarning(300000) << "BufferViewSettingsPage::updateBufferView(): view is unknown:" << config->bufferViewId(); return; } ui.bufferViewList->item(itemPos)->setText(config->bufferViewName()); diff --git a/kuassel/src/qtui/settingspages/highlightsettingspage.cpp b/kuassel/src/qtui/settingspages/highlightsettingspage.cpp index cfcff5ad..ee7dc906 100644 --- a/kuassel/src/qtui/settingspages/highlightsettingspage.cpp +++ b/kuassel/src/qtui/settingspages/highlightsettingspage.cpp @@ -169,7 +169,7 @@ void HighlightSettingsPage::emptyTable() { // ui.highlight and highlightList should have the same size, but just to make sure. if (ui.highlightTable->rowCount() != highlightList.size()) { - qDebug() << "something is wrong: ui.highlight and highlightList don't have the same size!"; + kDebug(300000) << "something is wrong: ui.highlight and highlightList don't have the same size!"; } while (ui.highlightTable->rowCount()) { ui.highlightTable->removeRow(0); diff --git a/kuassel/src/qtui/settingspages/identitiessettingspage.cpp b/kuassel/src/qtui/settingspages/identitiessettingspage.cpp index f25220be..15942ed1 100644 --- a/kuassel/src/qtui/settingspages/identitiessettingspage.cpp +++ b/kuassel/src/qtui/settingspages/identitiessettingspage.cpp @@ -231,11 +231,11 @@ void IdentitiesSettingsPage::clientIdentityUpdated() { const Identity *clientIdentity = qobject_cast(sender()); if (!clientIdentity) { - qWarning() << "Invalid identity to update!"; + kWarning(300000) << "Invalid identity to update!"; return; } if (!identities.contains(clientIdentity->id())) { - qWarning() << "Unknown identity to update:" << clientIdentity->identityName(); + kWarning(300000) << "Unknown identity to update:" << clientIdentity->identityName(); return; } @@ -434,7 +434,7 @@ SaveIdentitiesDlg::SaveIdentitiesDlg(const QList &toCreate, cons foreach(CertIdentity *id, toUpdate) { const Identity *cid = Client::identity(id->id()); if (!cid) { - qWarning() << "Invalid client identity!"; + kWarning(300000) << "Invalid client identity!"; numevents--; continue; } @@ -449,7 +449,7 @@ SaveIdentitiesDlg::SaveIdentitiesDlg(const QList &toCreate, cons } } else { - qWarning() << "Sync dialog called without stuff to change!"; + kWarning(300000) << "Sync dialog called without stuff to change!"; accept(); } } diff --git a/kuassel/src/qtui/settingspages/ignorelistmodel.cpp b/kuassel/src/qtui/settingspages/ignorelistmodel.cpp index 6f69eddc..3588f2d1 100644 --- a/kuassel/src/qtui/settingspages/ignorelistmodel.cpp +++ b/kuassel/src/qtui/settingspages/ignorelistmodel.cpp @@ -20,7 +20,7 @@ #include "ignorelistmodel.h" -#include +#include #include #include diff --git a/kuassel/src/qtui/settingspages/ignorelistsettingspage.cpp b/kuassel/src/qtui/settingspages/ignorelistsettingspage.cpp index d53b1599..1eb011b0 100644 --- a/kuassel/src/qtui/settingspages/ignorelistsettingspage.cpp +++ b/kuassel/src/qtui/settingspages/ignorelistsettingspage.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/kuassel/src/qtui/settingspages/networkssettingspage.cpp b/kuassel/src/qtui/settingspages/networkssettingspage.cpp index 3e30e2b4..8c5f268e 100644 --- a/kuassel/src/qtui/settingspages/networkssettingspage.cpp +++ b/kuassel/src/qtui/settingspages/networkssettingspage.cpp @@ -342,12 +342,12 @@ void NetworksSettingsPage::clientIdentityUpdated() { const Identity *identity = qobject_cast(sender()); if (!identity) { - qWarning() << "NetworksSettingsPage: Invalid identity to update!"; + kWarning(300000) << "NetworksSettingsPage: Invalid identity to update!"; return; } int row = ui.identityList->findData(identity->id().toInt()); if (row < 0) { - qWarning() << "NetworksSettingsPage: Invalid identity to update!"; + kWarning(300000) << "NetworksSettingsPage: Invalid identity to update!"; return; } if (ui.identityList->itemText(row) != identity->identityName()) { @@ -399,7 +399,7 @@ void NetworksSettingsPage::clientNetworkUpdated() { const Network *net = qobject_cast(sender()); if (!net) { - qWarning() << "Update request for unknown network received!"; + kWarning(300000) << "Update request for unknown network received!"; return; } networkInfos[net->networkId()] = net->networkInfo(); @@ -924,7 +924,7 @@ SaveNetworksDlg::SaveNetworksDlg(const QList &toCreate, const QList foreach(NetworkInfo info, toUpdate) { const Network *net = Client::network(info.networkId); if (!net) { - qWarning() << "Invalid client network!"; + kWarning(300000) << "Invalid client network!"; numevents--; continue; } @@ -934,7 +934,7 @@ SaveNetworksDlg::SaveNetworksDlg(const QList &toCreate, const QList } } else { - qWarning() << "Sync dialog called without stuff to change!"; + kWarning(300000) << "Sync dialog called without stuff to change!"; accept(); } } diff --git a/kuassel/src/qtui/statusnotifieritem.cpp b/kuassel/src/qtui/statusnotifieritem.cpp index 1df1f2c6..c6417582 100644 --- a/kuassel/src/qtui/statusnotifieritem.cpp +++ b/kuassel/src/qtui/statusnotifieritem.cpp @@ -142,7 +142,7 @@ void StatusNotifierItem::registerToDaemon() checkForRegisteredHosts(); } else { - //qDebug() << "StatusNotifierWatcher not reachable!"; + //kDebug(300000) << "StatusNotifierWatcher not reachable!"; setMode(Legacy); } } @@ -153,7 +153,7 @@ void StatusNotifierItem::serviceChange(const QString &name, const QString &oldOw Q_UNUSED(name); if (newOwner.isEmpty()) { //unregistered - //qDebug() << "Connection to the StatusNotifierWatcher lost"; + //kDebug(300000) << "Connection to the StatusNotifierWatcher lost"; delete _statusNotifierWatcher; _statusNotifierWatcher = 0; setMode(Legacy); diff --git a/kuassel/src/qtui/statusnotifieritemdbus.cpp b/kuassel/src/qtui/statusnotifieritemdbus.cpp index 70587a57..d548828a 100644 --- a/kuassel/src/qtui/statusnotifieritemdbus.cpp +++ b/kuassel/src/qtui/statusnotifieritemdbus.cpp @@ -164,7 +164,7 @@ StatusNotifierItemDBus::StatusNotifierItemDBus(StatusNotifierItem *parent) m_dbus(QDBusConnection::connectToBus(QDBusConnection::SessionBus, m_service)) { new StatusNotifierItemAdaptor(this); - //qDebug() << "service is" << m_service; + //kDebug(300000) << "service is" << m_service; registerService(); } @@ -185,7 +185,7 @@ QDBusConnection StatusNotifierItemDBus::dbusConnection() const // void StatusNotifierItemDBus::registerService() { - //qDebug() << "registering to" << m_service; + //kDebug(300000) << "registering to" << m_service; m_dbus.registerService(m_service); m_dbus.registerObject("/StatusNotifierItem", this); } @@ -194,7 +194,7 @@ void StatusNotifierItemDBus::registerService() // FIXME: see above void StatusNotifierItemDBus::unregisterService() { - //qDebug() << "unregistering from" << m_service; + //kDebug(300000) << "unregistering from" << m_service; if (m_dbus.isConnected()) { m_dbus.unregisterObject("/StatusNotifierItem"); m_dbus.unregisterService(m_service); diff --git a/kuassel/src/qtui/verticaldock.cpp b/kuassel/src/qtui/verticaldock.cpp index 4f0bbeb2..44460b34 100644 --- a/kuassel/src/qtui/verticaldock.cpp +++ b/kuassel/src/qtui/verticaldock.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include VerticalDockTitle::VerticalDockTitle(QDockWidget *parent) : QWidget(parent) diff --git a/kuassel/src/uisupport/bufferviewfilter.cpp b/kuassel/src/uisupport/bufferviewfilter.cpp index 2459981b..eee949d0 100644 --- a/kuassel/src/uisupport/bufferviewfilter.cpp +++ b/kuassel/src/uisupport/bufferviewfilter.cpp @@ -394,7 +394,7 @@ bool BufferViewFilter::filterAcceptsRow(int source_row, const QModelIndex &sourc QModelIndex child = sourceModel()->index(source_row, 0, source_parent); if (!child.isValid()) { - qWarning() << "filterAcceptsRow has been called with an invalid Child"; + kWarning(300000) << "filterAcceptsRow has been called with an invalid Child"; return false; } diff --git a/kuassel/src/uisupport/bufferviewoverlayfilter.cpp b/kuassel/src/uisupport/bufferviewoverlayfilter.cpp index 86569ae2..29bbb361 100644 --- a/kuassel/src/uisupport/bufferviewoverlayfilter.cpp +++ b/kuassel/src/uisupport/bufferviewoverlayfilter.cpp @@ -71,7 +71,7 @@ bool BufferViewOverlayFilter::filterAcceptsRow(int source_row, const QModelIndex QModelIndex source_bufferIndex = sourceModel()->index(source_row, 0, source_parent); if (!source_bufferIndex.isValid()) { - qWarning() << "filterAcceptsRow has been called with an invalid Child"; + kWarning(300000) << "filterAcceptsRow has been called with an invalid Child"; return false; } @@ -107,6 +107,6 @@ bool BufferViewOverlayFilter::filterAcceptsRow(int source_row, const QModelIndex return false; // the buffer is not known to us - qDebug() << "BufferViewOverlayFilter::filterAcceptsRow()" << bufferId << "is unknown!"; + kDebug(300000) << "BufferViewOverlayFilter::filterAcceptsRow()" << bufferId << "is unknown!"; return false; } diff --git a/kuassel/src/uisupport/clickablelabel.cpp b/kuassel/src/uisupport/clickablelabel.cpp index a1ca1a71..a7f2ec93 100644 --- a/kuassel/src/uisupport/clickablelabel.cpp +++ b/kuassel/src/uisupport/clickablelabel.cpp @@ -20,7 +20,7 @@ #include "clickablelabel.h" -#include +#include #include ClickableLabel::ClickableLabel(QWidget *parent) diff --git a/kuassel/src/uisupport/flatproxymodel.cpp b/kuassel/src/uisupport/flatproxymodel.cpp index 95874035..b4f4ecb4 100644 --- a/kuassel/src/uisupport/flatproxymodel.cpp +++ b/kuassel/src/uisupport/flatproxymodel.cpp @@ -21,7 +21,7 @@ #include "flatproxymodel.h" #include -#include +#include FlatProxyModel::FlatProxyModel(QObject *parent) : QAbstractProxyModel(parent), @@ -62,7 +62,7 @@ QModelIndex FlatProxyModel::mapToSource(const QModelIndex &proxyIndex) const } } - qWarning() << "FlatProxyModel::mapToSource(): couldn't find source index for" << proxyIndex; + kWarning(300000) << "FlatProxyModel::mapToSource(): couldn't find source index for" << proxyIndex; Q_ASSERT(false); return QModelIndex(); // make compilers happy :) } @@ -366,12 +366,12 @@ void FlatProxyModel::removeSubTree(const QModelIndex &source_idx, bool emitRemov QModelIndex FlatProxyModel::index(int row, int column, const QModelIndex &parent) const { if (parent.isValid()) { - qWarning() << "FlatProxyModel::index() called with valid parent:" << parent; + kWarning(300000) << "FlatProxyModel::index() called with valid parent:" << parent; return QModelIndex(); } if (!_rootSourceItem) { - qWarning() << "FlatProxyModel::index() while model has no root Item"; + kWarning(300000) << "FlatProxyModel::index() while model has no root Item"; return QModelIndex(); } @@ -379,7 +379,7 @@ QModelIndex FlatProxyModel::index(int row, int column, const QModelIndex &parent while (item->pos() != row) { item = item->findChild(row); if (!item) { - qWarning() << "FlatProxyModel::index() no such row:" << row; + kWarning(300000) << "FlatProxyModel::index() no such row:" << row; return QModelIndex(); } } @@ -554,7 +554,7 @@ void FlatProxyModel::on_rowsAboutToBeRemoved(const QModelIndex &parent, int star // sanity check - if that check fails our indexes would be messed up for (int row = start; row <= end; row++) { if (sourceItem->child(row)->childCount() > 0) { - qWarning() << "on_rowsAboutToBeRemoved(): sourceModel() removed rows which have children on their own!" << sourceModel()->index(row, 0, parent); + kWarning(300000) << "on_rowsAboutToBeRemoved(): sourceModel() removed rows which have children on their own!" << sourceModel()->index(row, 0, parent); Q_ASSERT(false); } } @@ -574,7 +574,7 @@ void FlatProxyModel::on_rowsInserted(const QModelIndex &parent, int start, int e for (int row = start; row <= end; row++) { QModelIndex child = sourceModel()->index(row, 0, parent); if (sourceModel()->rowCount(child) > 0) { - qWarning() << "on_rowsInserted(): sourceModel() inserted rows which already have children on their own!" << child; + kWarning(300000) << "on_rowsInserted(): sourceModel() inserted rows which already have children on their own!" << child; Q_ASSERT(false); } } @@ -624,41 +624,41 @@ void FlatProxyModel::on_rowsRemoved(const QModelIndex &parent, int start, int en // integrity Tets void FlatProxyModel::linkTest() const { - qDebug() << "Checking FlatProxyModel for linklist integrity"; + kDebug(300000) << "Checking FlatProxyModel for linklist integrity"; if (!_rootSourceItem) return; int pos = -1; SourceItem *item = _rootSourceItem; while (true) { - qDebug() << item << ":" << item->pos() << "==" << pos; + kDebug(300000) << item << ":" << item->pos() << "==" << pos; Q_ASSERT(item->pos() == pos); pos++; if (!item->next()) break; item = item->next(); } - qDebug() << "Last item in linklist:" << item << item->pos(); + kDebug(300000) << "Last item in linklist:" << item << item->pos(); int lastPos = item->pos(); item = _rootSourceItem; while (item->childCount() > 0) { item = item->child(item->childCount() - 1); } - qDebug() << "Last item in tree:" << item << item->pos(); + kDebug(300000) << "Last item in tree:" << item << item->pos(); Q_ASSERT(lastPos == item->pos()); Q_UNUSED(lastPos); - qDebug() << "success!"; + kDebug(300000) << "success!"; } void FlatProxyModel::completenessTest() const { - qDebug() << "Checking FlatProxyModel for Completeness:"; + kDebug(300000) << "Checking FlatProxyModel for Completeness:"; int pos = -1; checkChildCount(QModelIndex(), _rootSourceItem, pos); - qDebug() << "success!"; + kDebug(300000) << "success!"; } @@ -667,8 +667,8 @@ void FlatProxyModel::checkChildCount(const QModelIndex &index, const SourceItem if (!sourceModel()) return; - qDebug() << index << "(Item:" << item << "):" << sourceModel()->rowCount(index) << "==" << item->childCount(); - qDebug() << "ProxyPos:" << item->pos() << "==" << pos; + kDebug(300000) << index << "(Item:" << item << "):" << sourceModel()->rowCount(index) << "==" << item->childCount(); + kDebug(300000) << "ProxyPos:" << item->pos() << "==" << pos; Q_ASSERT(sourceModel()->rowCount(index) == item->childCount()); for (int row = 0; row < sourceModel()->rowCount(index); row++) { diff --git a/kuassel/src/uisupport/networkmodelcontroller.cpp b/kuassel/src/uisupport/networkmodelcontroller.cpp index c420c230..36093926 100644 --- a/kuassel/src/uisupport/networkmodelcontroller.cpp +++ b/kuassel/src/uisupport/networkmodelcontroller.cpp @@ -205,7 +205,7 @@ void NetworkModelController::handleExternalAction(ActionType type, QAction *acti Q_UNUSED(type); if (receiver() && method()) { if (!QMetaObject::invokeMethod(receiver(), method(), Q_ARG(QAction *, action))) - qWarning() << "NetworkModelActionController::handleExternalAction(): Could not invoke slot" << receiver() << method(); + kWarning(300000) << "NetworkModelActionController::handleExternalAction(): Could not invoke slot" << receiver() << method(); } } @@ -229,7 +229,7 @@ void NetworkModelController::actionTriggered(QAction *action) else if (type & ExternalMask) handleExternalAction(type, action); else - qWarning() << "NetworkModelController::actionTriggered(): Unhandled action!"; + kWarning(300000) << "NetworkModelController::actionTriggered(): Unhandled action!"; } } @@ -514,7 +514,7 @@ void NetworkModelController::handleNickAction(ActionType type, QAction *action) Client::ignoreListManager()->requestToggleIgnoreRule(action->property("ignoreRule").toString()); break; default: - qWarning() << "Unhandled nick action"; + kWarning(300000) << "Unhandled nick action"; } } } diff --git a/kuassel/src/uisupport/nickview.cpp b/kuassel/src/uisupport/nickview.cpp index 782fcb91..dc6af0c7 100644 --- a/kuassel/src/uisupport/nickview.cpp +++ b/kuassel/src/uisupport/nickview.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include "buffermodel.h" diff --git a/kuassel/src/uisupport/qssparser.cpp b/kuassel/src/uisupport/qssparser.cpp index 2add4550..dafaf4f7 100644 --- a/kuassel/src/uisupport/qssparser.cpp +++ b/kuassel/src/uisupport/qssparser.cpp @@ -77,7 +77,7 @@ void QssParser::processStyleSheet(QString &ss) QRegExp blockrx("((?:ChatLine|ChatListItem|NickListItem)[^{]*)\\{([^}]+)\\}"); pos = 0; while ((pos = blockrx.indexIn(ss, pos)) >= 0) { - //qDebug() << blockrx.cap(1) << blockrx.cap(2); + //kDebug(300000) << blockrx.cap(1) << blockrx.cap(2); QString declaration = blockrx.cap(1).trimmed(); QString contents = blockrx.cap(2).trimmed(); @@ -125,7 +125,7 @@ void QssParser::parsePaletteBlock(const QString &decl, const QString &contents) // Check if we want to apply this palette definition for particular ColorGroups QRegExp rx("Palette((:(normal|active|inactive|disabled))*)"); if (!rx.exactMatch(decl)) { - qWarning() << Q_FUNC_INFO << i18n("Invalid block declaration: %1").arg(decl); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid block declaration: %1").arg(decl); return; } if (!rx.cap(1).isEmpty()) { @@ -144,7 +144,7 @@ void QssParser::parsePaletteBlock(const QString &decl, const QString &contents) foreach(QString line, contents.split(';', QString::SkipEmptyParts)) { int idx = line.indexOf(':'); if (idx <= 0) { - qWarning() << Q_FUNC_INFO << i18n("Invalid palette role assignment: %1").arg(line.trimmed()); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid palette role assignment: %1").arg(line.trimmed()); continue; } QString rolestr = line.left(idx).trimmed(); @@ -163,7 +163,7 @@ void QssParser::parsePaletteBlock(const QString &decl, const QString &contents) _uiStylePalette[_uiStyleColorRoles.value(rolestr)] = parseBrush(brushstr); } else - qWarning() << Q_FUNC_INFO << i18n("Unknown palette role name: %1").arg(rolestr); + kWarning(300000) << Q_FUNC_INFO << i18n("Unknown palette role name: %1").arg(rolestr); } } @@ -175,7 +175,7 @@ quint64 QssParser::parseFormatType(const QString &decl) QRegExp rx("ChatLine(?:::(\\w+))?(?:#([\\w\\-]+))?(?:\\[([=-,\\\"\\w\\s]+)\\])?"); // $1: subelement; $2: msgtype; $3: conditionals if (!rx.exactMatch(decl)) { - qWarning() << Q_FUNC_INFO << i18n("Invalid block declaration: %1").arg(decl); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid block declaration: %1").arg(decl); return UiStyle::Invalid; } QString subElement = rx.cap(1); @@ -201,7 +201,7 @@ quint64 QssParser::parseFormatType(const QString &decl) else if (subElement == "url") fmtType |= UiStyle::Url; else { - qWarning() << Q_FUNC_INFO << i18n("Invalid subelement name in %1").arg(decl); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid subelement name in %1").arg(decl); return UiStyle::Invalid; } } @@ -245,7 +245,7 @@ quint64 QssParser::parseFormatType(const QString &decl) else if (msgType == "invite") fmtType |= UiStyle::InviteMsg; else { - qWarning() << Q_FUNC_INFO << i18n("Invalid message type in %1").arg(decl); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid message type in %1").arg(decl); } } @@ -254,7 +254,7 @@ quint64 QssParser::parseFormatType(const QString &decl) if (!conditions.isEmpty()) { foreach(const QString &cond, conditions.split(',', QString::SkipEmptyParts)) { if (!condRx.exactMatch(cond)) { - qWarning() << Q_FUNC_INFO << i18n("Invalid condition %1").arg(cond); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid condition %1").arg(cond); return UiStyle::Invalid; } QString condName = condRx.cap(1); @@ -266,7 +266,7 @@ quint64 QssParser::parseFormatType(const QString &decl) else if (condValue == "selected") labeltype = UiStyle::Selected; else { - qWarning() << Q_FUNC_INFO << i18n("Invalid message label: %1").arg(condValue); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid message label: %1").arg(condValue); return UiStyle::Invalid; } fmtType |= (labeltype << 32); @@ -278,11 +278,11 @@ quint64 QssParser::parseFormatType(const QString &decl) bool ok = true; quint64 val = condValue.toUInt(&ok, 16); if (!ok) { - qWarning() << Q_FUNC_INFO << i18n("Invalid senderhash specification: %1").arg(condValue); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid senderhash specification: %1").arg(condValue); return UiStyle::Invalid; } if (val >= 16) { - qWarning() << Q_FUNC_INFO << i18n("Senderhash can be at most \"0x0f\"!"); + kWarning(300000) << Q_FUNC_INFO << i18n("Senderhash can be at most \"0x0f\"!"); return UiStyle::Invalid; } fmtType |= ++val << 48; @@ -298,7 +298,7 @@ quint64 QssParser::parseFormatType(const QString &decl) else if (condValue == "reverse") fmtType |= UiStyle::Reverse; else { - qWarning() << Q_FUNC_INFO << i18n("Invalid format name: %1").arg(condValue); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid format name: %1").arg(condValue); return UiStyle::Invalid; } } @@ -306,7 +306,7 @@ quint64 QssParser::parseFormatType(const QString &decl) bool ok; quint8 col = condValue.toUInt(&ok, 16); if (!ok || col > 0x0f) { - qWarning() << Q_FUNC_INFO << i18n("Illegal IRC color specification (must be between 00 and 0f): %1").arg(condValue); + kWarning(300000) << Q_FUNC_INFO << i18n("Illegal IRC color specification (must be between 00 and 0f): %1").arg(condValue); return UiStyle::Invalid; } if (condName == "fg-color") @@ -315,7 +315,7 @@ quint64 QssParser::parseFormatType(const QString &decl) fmtType |= 0x00800000 | (quint32)(col << 28); } else { - qWarning() << Q_FUNC_INFO << i18n("Unhandled condition: %1").arg(condName); + kWarning(300000) << Q_FUNC_INFO << i18n("Unhandled condition: %1").arg(condName); return UiStyle::Invalid; } } @@ -331,7 +331,7 @@ quint32 QssParser::parseItemFormatType(const QString &decl) QRegExp rx("(Chat|Nick)ListItem(?:\\[([=-,\\\"\\w\\s]+)\\])?"); // $1: item type; $2: properties if (!rx.exactMatch(decl)) { - qWarning() << Q_FUNC_INFO << i18n("Invalid block declaration: %1").arg(decl); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid block declaration: %1").arg(decl); return UiStyle::Invalid; } QString mainItemType = rx.cap(1); @@ -346,7 +346,7 @@ quint32 QssParser::parseItemFormatType(const QString &decl) QRegExp propRx("\\s*([\\w\\-]+)\\s*=\\s*\"([\\w\\-]+)\"\\s*"); foreach(const QString &prop, properties.split(',', QString::SkipEmptyParts)) { if (!propRx.exactMatch(prop)) { - qWarning() << Q_FUNC_INFO << i18n("Invalid proplist %1").arg(prop); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid proplist %1").arg(prop); return UiStyle::Invalid; } props[propRx.cap(1)] = propRx.cap(2); @@ -365,7 +365,7 @@ quint32 QssParser::parseItemFormatType(const QString &decl) else if (type == "query") fmtType |= UiStyle::QueryBufferItem; else { - qWarning() << Q_FUNC_INFO << i18n("Invalid chatlist item type %1").arg(type); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid chatlist item type %1").arg(type); return UiStyle::Invalid; } } @@ -381,7 +381,7 @@ quint32 QssParser::parseItemFormatType(const QString &decl) else if (state == "away") fmtType |= UiStyle::UserAway; else { - qWarning() << Q_FUNC_INFO << i18n("Invalid chatlist state %1").arg(state); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid chatlist state %1").arg(state); return UiStyle::Invalid; } } @@ -411,7 +411,7 @@ QTextCharFormat QssParser::parseFormat(const QString &qss) foreach(QString line, qss.split(';', QString::SkipEmptyParts)) { int idx = line.indexOf(':'); if (idx <= 0) { - qWarning() << Q_FUNC_INFO << i18n("Invalid property declaration: %1").arg(line.trimmed()); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid property declaration: %1").arg(line.trimmed()); continue; } QString property = line.left(idx).trimmed(); @@ -435,13 +435,13 @@ QTextCharFormat QssParser::parseFormat(const QString &qss) else if (property == "font-family") parseFontFamily(value, &format); else { - qWarning() << Q_FUNC_INFO << i18n("Invalid font property: %1").arg(line); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid font property: %1").arg(line); continue; } } else { - qWarning() << Q_FUNC_INFO << i18n("Unknown ChatLine property: %1").arg(property); + kWarning(300000) << Q_FUNC_INFO << i18n("Unknown ChatLine property: %1").arg(property); } } @@ -465,21 +465,21 @@ QBrush QssParser::parseBrush(const QString &str, bool *ok) if (str.startsWith("palette")) { // Palette color role QRegExp rx("palette\\s*\\(\\s*([a-z-]+)\\s*\\)"); if (!rx.exactMatch(str)) { - qWarning() << Q_FUNC_INFO << i18n("Invalid palette color role specification: %1").arg(str); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid palette color role specification: %1").arg(str); return QBrush(); } if (_paletteColorRoles.contains(rx.cap(1))) return QBrush(_palette.brush(_paletteColorRoles.value(rx.cap(1)))); if (_uiStyleColorRoles.contains(rx.cap(1))) return QBrush(_uiStylePalette.at(_uiStyleColorRoles.value(rx.cap(1)))); - qWarning() << Q_FUNC_INFO << i18n("Unknown palette color role: %1").arg(rx.cap(1)); + kWarning(300000) << Q_FUNC_INFO << i18n("Unknown palette color role: %1").arg(rx.cap(1)); return QBrush(); } else if (str.startsWith("qlineargradient")) { static QString rxFloat("\\s*(-?\\s*[0-9]*\\.?[0-9]+)\\s*"); QRegExp rx(QString("qlineargradient\\s*\\(\\s*x1:%1,\\s*y1:%1,\\s*x2:%1,\\s*y2:%1,(.+)\\)").arg(rxFloat)); if (!rx.exactMatch(str)) { - qWarning() << Q_FUNC_INFO << i18n("Invalid gradient declaration: %1").arg(str); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid gradient declaration: %1").arg(str); return QBrush(); } qreal x1 = rx.cap(1).toDouble(); @@ -488,7 +488,7 @@ QBrush QssParser::parseBrush(const QString &str, bool *ok) qreal y2 = rx.cap(4).toDouble(); QGradientStops stops = parseGradientStops(rx.cap(5).trimmed()); if (!stops.count()) { - qWarning() << Q_FUNC_INFO << i18n("Invalid gradient stops list: %1").arg(str); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid gradient stops list: %1").arg(str); return QBrush(); } QLinearGradient gradient(x1, y1, x2, y2); @@ -502,7 +502,7 @@ QBrush QssParser::parseBrush(const QString &str, bool *ok) static QString rxFloat("\\s*(-?\\s*[0-9]*\\.?[0-9]+)\\s*"); QRegExp rx(QString("qconicalgradient\\s*\\(\\s*cx:%1,\\s*cy:%1,\\s*angle:%1,(.+)\\)").arg(rxFloat)); if (!rx.exactMatch(str)) { - qWarning() << Q_FUNC_INFO << i18n("Invalid gradient declaration: %1").arg(str); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid gradient declaration: %1").arg(str); return QBrush(); } qreal cx = rx.cap(1).toDouble(); @@ -510,7 +510,7 @@ QBrush QssParser::parseBrush(const QString &str, bool *ok) qreal angle = rx.cap(3).toDouble(); QGradientStops stops = parseGradientStops(rx.cap(4).trimmed()); if (!stops.count()) { - qWarning() << Q_FUNC_INFO << i18n("Invalid gradient stops list: %1").arg(str); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid gradient stops list: %1").arg(str); return QBrush(); } QConicalGradient gradient(cx, cy, angle); @@ -524,7 +524,7 @@ QBrush QssParser::parseBrush(const QString &str, bool *ok) static QString rxFloat("\\s*(-?\\s*[0-9]*\\.?[0-9]+)\\s*"); QRegExp rx(QString("qradialgradient\\s*\\(\\s*cx:%1,\\s*cy:%1,\\s*radius:%1,\\s*fx:%1,\\s*fy:%1,(.+)\\)").arg(rxFloat)); if (!rx.exactMatch(str)) { - qWarning() << Q_FUNC_INFO << i18n("Invalid gradient declaration: %1").arg(str); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid gradient declaration: %1").arg(str); return QBrush(); } qreal cx = rx.cap(1).toDouble(); @@ -534,7 +534,7 @@ QBrush QssParser::parseBrush(const QString &str, bool *ok) qreal fy = rx.cap(5).toDouble(); QGradientStops stops = parseGradientStops(rx.cap(6).trimmed()); if (!stops.count()) { - qWarning() << Q_FUNC_INFO << i18n("Invalid gradient stops list: %1").arg(str); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid gradient stops list: %1").arg(str); return QBrush(); } QRadialGradient gradient(cx, cy, radius, fx, fy); @@ -643,7 +643,7 @@ void QssParser::parseFont(const QString &value, QTextCharFormat *format) { QRegExp rx("((?:(?:normal|italic|oblique|underline|bold|100|200|300|400|500|600|700|800|900) ){0,2}) ?(\\d+)(pt|px)? \"(.*)\""); if (!rx.exactMatch(value)) { - qWarning() << Q_FUNC_INFO << i18n("Invalid font specification: %1").arg(value); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid font specification: %1").arg(value); return; } format->setFontItalic(false); @@ -684,7 +684,7 @@ void QssParser::parseFontStyle(const QString &value, QTextCharFormat *format) //else if(value == "oblique") // format->setStyle(QFont::StyleOblique); else { - qWarning() << Q_FUNC_INFO << i18n("Invalid font style specification: %1").arg(value); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid font style specification: %1").arg(value); } } @@ -699,7 +699,7 @@ void QssParser::parseFontWeight(const QString &value, QTextCharFormat *format) bool ok; int w = value.toInt(&ok); if (!ok) { - qWarning() << Q_FUNC_INFO << i18n("Invalid font weight specification: %1").arg(value); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid font weight specification: %1").arg(value); return; } format->setFontWeight(qMin(w / 8, 99)); // taken from Qt's qss parser @@ -711,7 +711,7 @@ void QssParser::parseFontSize(const QString &value, QTextCharFormat *format) { QRegExp rx("(\\d+)(pt|px)"); if (!rx.exactMatch(value)) { - qWarning() << Q_FUNC_INFO << i18n("Invalid font size specification: %1").arg(value); + kWarning(300000) << Q_FUNC_INFO << i18n("Invalid font size specification: %1").arg(value); return; } if (rx.cap(2) == "px") diff --git a/kuassel/src/uisupport/settingspage.cpp b/kuassel/src/uisupport/settingspage.cpp index adbe13d2..260ed9ed 100644 --- a/kuassel/src/uisupport/settingspage.cpp +++ b/kuassel/src/uisupport/settingspage.cpp @@ -111,7 +111,7 @@ void SettingsPage::initAutoWidgets() else if (widget->inherits("FontSelector")) connect(widget, SIGNAL(fontChanged(QFont)), SLOT(autoWidgetHasChanged())); else - qWarning() << "SettingsPage::init(): Unknown autoWidget type" << widget->metaObject()->className(); + kWarning(300000) << "SettingsPage::init(): Unknown autoWidget type" << widget->metaObject()->className(); } } @@ -142,7 +142,7 @@ QByteArray SettingsPage::autoWidgetPropertyName(QObject *widget) const else if (widget->inherits("FontSelector")) prop = "selectedFont"; else - qWarning() << "SettingsPage::autoWidgetPropertyName(): Unhandled widget type for" << widget; + kWarning(300000) << "SettingsPage::autoWidgetPropertyName(): Unhandled widget type for" << widget; return prop; } @@ -167,7 +167,7 @@ void SettingsPage::autoWidgetHasChanged() foreach(QObject *widget, _autoWidgets) { QVariant curValue = widget->property(autoWidgetPropertyName(widget)); if (!curValue.isValid()) - qWarning() << "SettingsPage::autoWidgetHasChanged(): Unknown property"; + kWarning(300000) << "SettingsPage::autoWidgetHasChanged(): Unknown property"; if (curValue != widget->property("storedValue")) { changed_ = true; @@ -237,12 +237,12 @@ void SettingsPage::defaults() QVariant SettingsPage::loadAutoWidgetValue(const QString &widgetName) { - qWarning() << "Could not load value for SettingsPage widget" << widgetName; + kWarning(300000) << "Could not load value for SettingsPage widget" << widgetName; return QVariant(); } void SettingsPage::saveAutoWidgetValue(const QString &widgetName, const QVariant &) { - qWarning() << "Could not save value for SettingsPage widget" << widgetName; + kWarning(300000) << "Could not save value for SettingsPage widget" << widgetName; } diff --git a/kuassel/src/uisupport/uisettings.cpp b/kuassel/src/uisupport/uisettings.cpp index d1731185..2b5f3802 100644 --- a/kuassel/src/uisupport/uisettings.cpp +++ b/kuassel/src/uisupport/uisettings.cpp @@ -119,7 +119,7 @@ int SessionSettings::sessionAge() } else { // no int saved, delete session - //qDebug() << QString("deleting invalid session %1 (invalid session age found)").arg(_sessionId); + //kDebug(300000) << QString("deleting invalid session %1 (invalid session age found)").arg(_sessionId); removeSession(); } return 10; diff --git a/kuassel/src/uisupport/uistyle.cpp b/kuassel/src/uisupport/uistyle.cpp index 1f2cb619..1514d9b1 100644 --- a/kuassel/src/uisupport/uistyle.cpp +++ b/kuassel/src/uisupport/uistyle.cpp @@ -144,7 +144,7 @@ QString UiStyle::loadStyleSheet(const QString &styleSheet, bool shouldExist) } else { if (shouldExist) - qWarning() << "Could not open stylesheet file:" << file.fileName(); + kWarning(300000) << "Could not open stylesheet file:" << file.fileName(); return QString(); } } @@ -454,7 +454,7 @@ UiStyle::FormatType UiStyle::formatType(Message::Type msgType) return InviteMsg; } //Q_ASSERT(false); // we need to handle all message types - qWarning() << Q_FUNC_INFO << "Unknown message type:" << msgType; + kWarning(300000) << Q_FUNC_INFO << "Unknown message type:" << msgType; return ErrorMsg; } @@ -498,7 +498,7 @@ UiStyle::StyledString UiStyle::styleString(const QString &s_, quint32 baseFormat if (s.length() > 65535) { // We use quint16 for indexes - qWarning() << QString("String too long to be styled: %1").arg(s); + kWarning(300000) << QString("String too long to be styled: %1").arg(s); result.plainText = s; return result; } @@ -548,7 +548,7 @@ UiStyle::StyledString UiStyle::styleString(const QString &s_, quint32 baseFormat FormatType ftype = formatType(code); if (ftype == Invalid) { pos++; - qWarning() << (QString("Invalid format code in string: %1").arg(s)); + kWarning(300000) << (QString("Invalid format code in string: %1").arg(s)); continue; } curfmt ^= ftype;