OSDN Git Service

kuassel: replace custom logger with KDE debbuging infrastructure
authorIvailo Monev <xakepa10@gmail.com>
Tue, 27 Jan 2015 19:41:25 +0000 (19:41 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Tue, 27 Jan 2015 19:41:25 +0000 (19:41 +0000)
104 files changed:
kuassel/CMakeLists.txt
kuassel/src/CMakeLists.txt
kuassel/src/client/backlogrequester.cpp
kuassel/src/client/buffermodel.cpp
kuassel/src/client/bufferviewoverlay.cpp
kuassel/src/client/client.cpp
kuassel/src/client/clientauthhandler.cpp
kuassel/src/client/clientbacklogmanager.cpp
kuassel/src/client/clientignorelistmanager.cpp
kuassel/src/client/clienttransfer.cpp
kuassel/src/client/clienttransfermanager.cpp
kuassel/src/client/coreaccountmodel.cpp
kuassel/src/client/coreconnection.cpp
kuassel/src/client/networkmodel.cpp
kuassel/src/client/selectionmodelsynchronizer.cpp
kuassel/src/client/treemodel.cpp
kuassel/src/common/CMakeLists.txt
kuassel/src/common/aliasmanager.cpp
kuassel/src/common/authhandler.cpp
kuassel/src/common/basichandler.cpp
kuassel/src/common/bufferinfo.cpp
kuassel/src/common/cliparser.cpp
kuassel/src/common/compressor.cpp
kuassel/src/common/event.cpp
kuassel/src/common/event.h
kuassel/src/common/eventmanager.cpp
kuassel/src/common/identity.cpp
kuassel/src/common/ignorelistmanager.cpp
kuassel/src/common/internalpeer.cpp
kuassel/src/common/ircchannel.cpp
kuassel/src/common/ircuser.cpp
kuassel/src/common/logbacktrace_unix.cpp
kuassel/src/common/logger.cpp [deleted file]
kuassel/src/common/logger.h [deleted file]
kuassel/src/common/main.cpp
kuassel/src/common/network.cpp
kuassel/src/common/peer.h
kuassel/src/common/presetnetworks.cpp
kuassel/src/common/protocols/datastream/datastreampeer.cpp
kuassel/src/common/protocols/legacy/legacypeer.cpp
kuassel/src/common/quassel.cpp
kuassel/src/common/quassel.h
kuassel/src/common/remotepeer.cpp
kuassel/src/common/settings.cpp
kuassel/src/common/signalproxy.cpp
kuassel/src/common/syncableobject.cpp
kuassel/src/common/transfer.cpp
kuassel/src/common/transfermanager.cpp
kuassel/src/common/types.h
kuassel/src/common/util.cpp
kuassel/src/core/abstractsqlstorage.cpp
kuassel/src/core/cipher.cpp
kuassel/src/core/core.cpp
kuassel/src/core/corealiasmanager.cpp
kuassel/src/core/coreapplication.cpp
kuassel/src/core/coreauthhandler.cpp
kuassel/src/core/corebacklogmanager.cpp
kuassel/src/core/corebasichandler.cpp
kuassel/src/core/corebuffersyncer.cpp
kuassel/src/core/coreignorelistmanager.cpp
kuassel/src/core/corenetwork.cpp
kuassel/src/core/corenetworkconfig.cpp
kuassel/src/core/coresession.cpp
kuassel/src/core/coresessioneventprocessor.cpp
kuassel/src/core/coretransfer.cpp
kuassel/src/core/coretransfermanager.cpp
kuassel/src/core/coreuserinputhandler.cpp
kuassel/src/core/eventstringifier.cpp
kuassel/src/core/ircparser.cpp
kuassel/src/core/postgresqlstorage.cpp
kuassel/src/core/sessionthread.cpp
kuassel/src/core/sqlitestorage.cpp
kuassel/src/core/sslserver.cpp
kuassel/src/qtui/chatitem.cpp
kuassel/src/qtui/chatmonitorfilter.cpp
kuassel/src/qtui/chatscene.cpp
kuassel/src/qtui/coreconfigwizard.cpp
kuassel/src/qtui/dockmanagernotificationbackend.cpp
kuassel/src/qtui/inputwidget.cpp
kuassel/src/qtui/mainwin.cpp
kuassel/src/qtui/nicklistwidget.cpp
kuassel/src/qtui/qtui.cpp
kuassel/src/qtui/qtuiapplication.cpp
kuassel/src/qtui/qtuistyle.cpp
kuassel/src/qtui/settingspages/aliasesmodel.cpp
kuassel/src/qtui/settingspages/bufferviewsettingspage.cpp
kuassel/src/qtui/settingspages/highlightsettingspage.cpp
kuassel/src/qtui/settingspages/identitiessettingspage.cpp
kuassel/src/qtui/settingspages/ignorelistmodel.cpp
kuassel/src/qtui/settingspages/ignorelistsettingspage.cpp
kuassel/src/qtui/settingspages/networkssettingspage.cpp
kuassel/src/qtui/statusnotifieritem.cpp
kuassel/src/qtui/statusnotifieritemdbus.cpp
kuassel/src/qtui/verticaldock.cpp
kuassel/src/uisupport/bufferviewfilter.cpp
kuassel/src/uisupport/bufferviewoverlayfilter.cpp
kuassel/src/uisupport/clickablelabel.cpp
kuassel/src/uisupport/flatproxymodel.cpp
kuassel/src/uisupport/networkmodelcontroller.cpp
kuassel/src/uisupport/nickview.cpp
kuassel/src/uisupport/qssparser.cpp
kuassel/src/uisupport/settingspage.cpp
kuassel/src/uisupport/uisettings.cpp
kuassel/src/uisupport/uistyle.cpp

index cb7cf1e..8e95909 100644 (file)
@@ -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
 ##################
 
index 6cefe2d..0e56684 100644 (file)
@@ -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
index 510115a..d4373c3 100644 (file)
@@ -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();
index 8432625..f4c2248 100644 (file)
@@ -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<BufferId>();
+    kDebug(300000) << "Switched current Buffer: " << current << current.data().toString() << "Buffer:" << current.data(NetworkModel::BufferIdRole).value<BufferId>();
 }
 
 
index 106c7cc..41e3b3b 100644 (file)
@@ -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()));
index 8acb423..0da5e4a 100644 (file)
@@ -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!");
     }
 }
 
index 07e2355..979def5 100644 (file)
@@ -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("<b>Incompatible Quassel Core!</b><br>"
                            "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<QSslError>)), SLOT(onSslErrors()));
-        qDebug() << "Starting encryption...";
+        kDebug(300000) << "Starting encryption...";
         sslSocket->flush();
         sslSocket->startClientEncryption();
     }
index 426af5e..02f0429 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <ctime>
 
-#include <QDebug>
+#include <KDebug>
 
 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<BufferId> &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()) {
index d13ce71..bc3e2e2 100644 (file)
@@ -53,7 +53,7 @@ QMap<QString, bool> 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;
index 9f70e63..0a1b0a5 100644 (file)
@@ -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;
     }
 }
index 1860e48..68ff6e3 100644 (file)
@@ -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<const ClientTransfer *>(transfer);
     if (!t) {
-        qWarning() << "Invalid Transfer added to ClientTransferManager!";
+        kWarning(300000) << "Invalid Transfer added to ClientTransferManager!";
         return;
     }
 
index c3e8b66..5d85d43 100644 (file)
@@ -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();
index ee1b48c..b4378e6 100644 (file)
@@ -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();
index 31e1dd3..b465618 100644 (file)
@@ -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<IrcUser *> &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();
index b3d9480..6241c86 100644 (file)
@@ -23,7 +23,7 @@
 #include <QAbstractItemModel>
 #include <QAbstractProxyModel>
 
-#include <QDebug>
+#include <KDebug>
 
 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;
     }
 
index 3360199..3e74995 100644 (file)
@@ -21,7 +21,7 @@
 #include "treemodel.h"
 
 #include <QCoreApplication>
-#include <QDebug>
+#include <KDebug>
 
 #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<AbstractTreeItem *>(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<AbstractTreeItem *>::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<AbstractTreeItem *>(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<AbstractTreeItem *>(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<AbstractTreeItem *>(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<AbstractTreeItem *>(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<AbstractTreeItem *>(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<AbstractTreeItem *>(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;
     }
 }
index 88114fe..3954e63 100644 (file)
@@ -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})
index 94985bb..39ac3bf 100644 (file)
@@ -18,7 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#include <QDebug>
+#include <KDebug>
 #include <QStringList>
 
 #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;
     }
 
index 7c2905d..8c4a71c 100644 (file)
@@ -20,6 +20,8 @@
 
 #include <QHostAddress>
 
+#include <KDebug>
+
 #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!";
 }
 
 
index 42841c4..516a19b 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <QMetaMethod>
 
-#include "logger.h"
+#include <KDebug>
 
 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 {
index 5ff7f1f..8913684 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <QString>
 #include <QDataStream>
-#include <QDebug>
+#include <KDebug>
 #include <QByteArray>
 
 #include "bufferinfo.h"
index 5168ea2..61e1fc1 100644 (file)
@@ -21,7 +21,7 @@
 #include "cliparser.h"
 
 #include <QDir>
-#include <QDebug>
+#include <KDebug>
 #include <QString>
 #include <QFileInfo>
 
@@ -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 <defval>"
-    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;
     }
 }
index c1e3d67..68acf68 100644 (file)
@@ -23,6 +23,8 @@
 #include <QTcpSocket>
 #include <QTimer>
 
+#include <KDebug>
+
 #include <zlib.h>
 
 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;
 }
 
 
index 1abea9f..c74e3bf 100644 (file)
@@ -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;
index fbca50e..f2a0029 100644 (file)
@@ -22,7 +22,7 @@
 #define EVENT_H
 
 #include <QDateTime>
-#include <QDebug>
+#include <KDebug>
 
 #include "eventmanager.h"
 
index 203ad8a..2860805 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <QCoreApplication>
 #include <QEvent>
-#include <QDebug>
+#include <KDebug>
 
 #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<EventType> 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) {
index 105cb0e..d59afe5 100644 (file)
@@ -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<IdentityId>() != v2.value<IdentityId>()) return false;
index 845af07..d4208c9 100644 (file)
@@ -21,7 +21,7 @@
 #include "ignorelistmanager.h"
 
 #include <QtCore>
-#include <QDebug>
+#include <KDebug>
 #include <QStringList>
 
 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;
             }
         }
index 19a95b3..a05191a 100644 (file)
@@ -22,6 +22,7 @@
 #include <QThread>
 
 #include <KLocale>
+#include <KDebug>
 
 #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<class T>
 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;
     }
 
index 145a198..4eb5bfe 100644 (file)
@@ -28,7 +28,7 @@
 #include <QHashIterator>
 #include <QTextCodec>
 
-#include <QDebug>
+#include <KDebug>
 
 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<IrcUser *> &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;
     }
 
index d7276fd..ccdd03c 100644 (file)
@@ -26,7 +26,7 @@
 #include "ircchannel.h"
 
 #include <QTextCodec>
-#include <QDebug>
+#include <KDebug>
 
 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);
index cc9cbf6..49f4524 100644 (file)
@@ -27,7 +27,7 @@
 #  include <cxxabi.h>
 #  include <QFile>
 #  include <QTextStream>
-#  include <QDebug>
+#  include <KDebug>
 #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 (file)
index 27a3f6d..0000000
+++ /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 <QFile>
-#include <QTextStream>
-#include <QDateTime>
-
-#ifdef HAVE_SYSLOG
-#  include <syslog.h>
-#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 (file)
index 2caa5d3..0000000
+++ /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 <QStringList>
-#include <QTextStream>
-
-#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<typename T>
-    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
index 9abc002..bf2f395 100644 (file)
@@ -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 <path>", '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 <address>[,<address[,...]]>", 0, "The address(es) quasselcore will listen on", "::,0.0.0.0");
     cliParser->addOption("port <port>", 'p', "The port quasselcore will listen at", QString("4242"));
     cliParser->addSwitch("norestore", 'n', "Don't restore last core's state");
-    cliParser->addOption("loglevel <level>", 'L', "Loglevel Debug|Info|Warning|Error", "Info");
-#ifdef HAVE_SYSLOG
-    cliParser->addSwitch("syslog", 0, "Log to syslog");
-#endif
-    cliParser->addOption("logfile <path>", 'l', "Log to a file");
     cliParser->addOption("select-backend <backendidentifier>", 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 <username>", 0, "Starts an interactive session to change the password of the user identified by username");
index 40881de..ec32eb9 100644 (file)
@@ -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;
         }
     }
index 2bdcc56..c959ed2 100644 (file)
@@ -24,6 +24,8 @@
 #include <QAbstractSocket>
 #include <QPointer>
 
+#include <KDebug>
+
 #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;
     }
 }
index ac89f4a..dfbb7ac 100644 (file)
@@ -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);
index 737e807..524c354 100644 (file)
@@ -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!
index b02b02e..0ce3352 100644 (file)
@@ -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
index 6a2f4be..967c93b 100644 (file)
@@ -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();
     }
index 46554c8..5e85662 100644 (file)
@@ -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
index 30246ef..0f99fb7 100644 (file)
@@ -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();
index 056e01a..db2480d 100644 (file)
@@ -46,7 +46,7 @@ QHash<QString, SettingsChangeNotifier *> 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);
 //   }
index 17f7589..86a6c57 100644 (file)
@@ -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<QAbstractSocket *>(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;
index 0a14203..294a408 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <QMetaProperty>
 
-#include <QDebug>
+#include <KDebug>
 
 #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);
index 6037513..399f426 100644 (file)
@@ -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();
index 257f4b2..fbd872e 100644 (file)
@@ -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;
     }
index a63e296..4b0bb81 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef TYPES_H_
 #define TYPES_H_
 
-#include <QDebug>
+#include <KDebug>
 #include <QString>
 #include <QVariant>
 #include <QDataStream>
index 4797e72..28c0a42 100644 (file)
@@ -21,7 +21,7 @@
 #include "util.h"
 
 #include <QCoreApplication>
-#include <QDebug>
+#include <KDebug>
 #include <QFile>
 #include <QTextCodec>
 
@@ -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());
index 2a2aaee..363c01e 100644 (file)
@@ -21,8 +21,6 @@
 #include "abstractsqlstorage.h"
 #include "quassel.h"
 
-#include "logger.h"
-
 #include <QMutexLocker>
 #include <QSqlDriver>
 #include <QSqlError>
@@ -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<QVariant> 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;
 }
index a8232a3..9943f86 100644 (file)
@@ -13,7 +13,6 @@
 */
 
 #include "cipher.h"
-#include "logger.h"
 
 Cipher::Cipher()
 {
index 95a39e2..76646e5 100644 (file)
@@ -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<UserId>();
             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<CoreAuthHandler *>(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<AbstractSqlStorage *>(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<AbstractSqlStorage *>(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;
     }
 
index 2669a63..33956ef 100644 (file)
@@ -30,7 +30,7 @@ CoreAliasManager::CoreAliasManager(CoreSession *parent)
 {
     CoreSession *session = qobject_cast<CoreSession *>(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<CoreSession *>(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;
     }
 
index e7ecdf0..e6f4e9c 100644 (file)
@@ -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;
index ff39b32..c00a542 100644 (file)
@@ -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("<b>Your Quassel Client is too old!</b><br>"
                              "This core needs at least client/core protocol version %1 (got: %2).<br>"
                              "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("<b>Client not initialized!</b><br>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<QSslSocket *>(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<QSslError> &)), SLOT(onSslErrors()));
     sslSocket->flush(); // ensure that the write cache is flushed before we switch to ssl (bug 682)
     sslSocket->startServerEncryption();
index bfa3f79..84b3341 100644 (file)
@@ -22,7 +22,7 @@
 #include "core.h"
 #include "coresession.h"
 
-#include <QDebug>
+#include <KDebug>
 
 INIT_SYNCABLE_OBJECT(CoreBacklogManager)
 CoreBacklogManager::CoreBacklogManager(CoreSession *coreSession)
index d2bb0d5..e2c26ad 100644 (file)
@@ -21,7 +21,6 @@
 #include "corebasichandler.h"
 
 #include "util.h"
-#include "logger.h"
 
 CoreBasicHandler::CoreBasicHandler(CoreNetwork *parent)
     : BasicHandler(parent),
index 5e61de2..690231a 100644 (file)
@@ -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;
     }
 
index 3b630f3..fcd3cdd 100644 (file)
@@ -29,7 +29,7 @@ CoreIgnoreListManager::CoreIgnoreListManager(CoreSession *parent)
 {
     CoreSession *session = qobject_cast<CoreSession *>(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<CoreSession *>(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;
     }
 
index 0c75573..ffd1d34 100644 (file)
@@ -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<CoreNetwork *>(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());
index 4520528..cfbe6f8 100644 (file)
@@ -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<CoreSession *>(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;
     }
 
index d5baf09..f8796e3 100644 (file)
@@ -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<RemotePeer *>(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);
     }
 }
index 22207be..7e9a2d7 100644 (file)
@@ -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<IrcEventNumeric *>(e)->number() << " requires " << minParams << "params, got: " << e->params();
+            kWarning(300000) << "Command " << static_cast<IrcEventNumeric *>(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<NetworkEvent *> 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
             }
 
 
index 3b1245c..1545831 100644 (file)
@@ -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);
     }
index c8f79dd..00c425b 100644 (file)
@@ -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<CoreTransfer *>(qobject_cast<const CoreTransfer *>(transfer));
     if (!t) {
-        qWarning() << "Invalid Transfer added to CoreTransferManager!";
+        kWarning(300000) << "Invalid Transfer added to CoreTransferManager!";
         return;
     }
 
index 16b185e..d309e7b 100644 (file)
@@ -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!
index 7e4ca3d..8dc0514 100644 (file)
@@ -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<IrcEventNumeric *>(e)->number() << " requires " << minParams << "params, got: " << e->params();
+            kWarning(300000) << "Command " << static_cast<IrcEventNumeric *>(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();
index acc765a..f82fef5 100644 (file)
@@ -42,7 +42,7 @@ IrcParser::IrcParser(CoreSession *session) :
 bool IrcParser::checkParamCount(const QString &cmd, const QList<QByteArray> &params, 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<CoreNetwork *>(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!
index 9c64eb6..7568056 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <QtSql>
 
-#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<CoreIdentity> 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<NetworkInfo> 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<NetworkId> 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<QString, QString> 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<BufferInfo> 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<BufferId> 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<BufferId, MsgId> 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<BufferId, MsgId> 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<Message> 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<Message> 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<Message> 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<Message> 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<QVariant> 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);
             }
         }
index 74d260b..57470f7 100644 (file)
@@ -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;
 }
 
 
index b84d101..2d42522 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <QtSql>
 
-#include "logger.h"
 #include "network.h"
 #include "quassel.h"
 
index 203c377..ec152b3 100644 (file)
@@ -27,7 +27,8 @@
 #include <QDateTime>
 #include <QFile>
 
-#include "logger.h"
+#include <KDebug>
+
 #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<QSslCertificate> 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;
     }
 
index 9e3bf17..4bac7a5 100644 (file)
@@ -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));
index db0c889..cf9b1d0 100644 (file)
@@ -104,7 +104,7 @@ QVariant ChatMonitorFilter::data(const QModelIndex &index, int role) const
 
     BufferId bufid = data(index, ChatLineModel::BufferIdRole).value<BufferId>();
     if (!bufid.isValid()) {
-        qDebug() << "ChatMonitorFilter::data(): chatline belongs to an invalid buffer!";
+        kDebug(300000) << "ChatMonitorFilter::data(): chatline belongs to an invalid buffer!";
         return QVariant();
     }
 
index d033de7..43ed45a 100644 (file)
@@ -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<MsgId>()
+//     kDebug(300000) << "Start--:" << start - 1 << ssidx.data(MessageModel::MsgIdRole).value<MsgId>()
 //           << ssidx.data(Qt::DisplayRole).toString();
 //   }
-//   qDebug() << "Start:" << start << sidx.data(MessageModel::MsgIdRole).value<MsgId>()
+//   kDebug(300000) << "Start:" << start << sidx.data(MessageModel::MsgIdRole).value<MsgId>()
 //         << sidx.data(Qt::DisplayRole).toString();
-//   qDebug() << "End:" << end << eidx.data(MessageModel::MsgIdRole).value<MsgId>()
+//   kDebug(300000) << "End:" << end << eidx.data(MessageModel::MsgIdRole).value<MsgId>()
 //         << 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<MsgId>()
+//     kDebug(300000) << "End++:" << end + 1 << eeidx.data(MessageModel::MsgIdRole).value<MsgId>()
 //           << 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;
index 2ba8936..6fda60b 100644 (file)
@@ -18,7 +18,7 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#include <QDebug>
+#include <KDebug>
 #include <QAbstractButton>
 #include <QFormLayout>
 #include <QSpinBox>
@@ -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) {
index af7d25d..991fa66 100644 (file)
@@ -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;
         }
     }
index a051f37..332361f 100644 (file)
@@ -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;
     }
 
index 454195a..c1538fa 100644 (file)
@@ -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();
index 5f8d7a8..e4b3639 100644 (file)
@@ -28,7 +28,7 @@
 #include "qtuisettings.h"
 
 #include <QAction>
-#include <QDebug>
+#include <KDebug>
 #include <QEvent>
 #include <QAbstractButton>
 
@@ -140,7 +140,7 @@ void NickListWidget::nickSelectionChanged()
     NickView *view = qobject_cast<NickView *>(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());
index 4dd8d8f..f9b6158 100644 (file)
@@ -45,7 +45,7 @@ QList<AbstractNotificationBackend::Notification> QtUi::_notifications;
 QtUi::QtUi() : GraphicalUi()
 {
     if (_instance != 0) {
-        qWarning() << "QtUi has been instantiated again!";
+        kWarning(300000) << "QtUi has been instantiated again!";
         return;
     }
     _instance = this;
index 755f09c..7a8f867 100644 (file)
@@ -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);
index 2ec8a7e..50df589 100644 (file)
@@ -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);
index 4734daf..9615e70 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "aliasesmodel.h"
 
-#include <QDebug>
+#include <KDebug>
 #include <QStringList>
 
 #include "client.h"
index 0c1c75e..5703806 100644 (file)
@@ -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());
index cfcff5a..ee7dc90 100644 (file)
@@ -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);
index f25220b..15942ed 100644 (file)
@@ -231,11 +231,11 @@ void IdentitiesSettingsPage::clientIdentityUpdated()
 {
     const Identity *clientIdentity = qobject_cast<Identity *>(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<CertIdentity *> &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<CertIdentity *> &toCreate, cons
         }
     }
     else {
-        qWarning() << "Sync dialog called without stuff to change!";
+        kWarning(300000) << "Sync dialog called without stuff to change!";
         accept();
     }
 }
index 6f69edd..3588f2d 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "ignorelistmodel.h"
 
-#include <QDebug>
+#include <KDebug>
 #include <QStringList>
 #include <QPushButton>
 
index d53b159..1eb011b 100644 (file)
@@ -25,7 +25,7 @@
 #include <QMessageBox>
 #include <QString>
 #include <QEvent>
-#include <QDebug>
+#include <KDebug>
 
 #include <KIcon>
 #include <KLocale>
index 3e30e2b..8c5f268 100644 (file)
@@ -342,12 +342,12 @@ void NetworksSettingsPage::clientIdentityUpdated()
 {
     const Identity *identity = qobject_cast<const Identity *>(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<const Network *>(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<NetworkInfo> &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<NetworkInfo> &toCreate, const QList
         }
     }
     else {
-        qWarning() << "Sync dialog called without stuff to change!";
+        kWarning(300000) << "Sync dialog called without stuff to change!";
         accept();
     }
 }
index 1df1f2c..c641758 100644 (file)
@@ -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);
index 70587a5..d548828 100644 (file)
@@ -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);
index 4f0bbeb..44460b3 100644 (file)
@@ -24,7 +24,7 @@
 #include <QLayout>
 #include <QPainter>
 
-#include <QDebug>
+#include <KDebug>
 
 VerticalDockTitle::VerticalDockTitle(QDockWidget *parent)
     : QWidget(parent)
index 2459981..eee949d 100644 (file)
@@ -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;
     }
 
index 86569ae..29bbb36 100644 (file)
@@ -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;
 }
index a1ca1a7..a7f2ec9 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "clickablelabel.h"
 
-#include <QDebug>
+#include <KDebug>
 #include <QMouseEvent>
 
 ClickableLabel::ClickableLabel(QWidget *parent)
index 9587403..b4f4ecb 100644 (file)
@@ -21,7 +21,7 @@
 #include "flatproxymodel.h"
 
 #include <QItemSelection>
-#include <QDebug>
+#include <KDebug>
 
 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++) {
index c420c23..3609392 100644 (file)
@@ -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";
         }
     }
 }
index 782fcb9..dc6af0c 100644 (file)
@@ -23,7 +23,7 @@
 #include <QApplication>
 #include <QHeaderView>
 #include <QScrollBar>
-#include <QDebug>
+#include <KDebug>
 #include <QMenu>
 
 #include "buffermodel.h"
index 2add455..dafaf4f 100644 (file)
@@ -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")
index adbe13d..260ed9e 100644 (file)
@@ -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;
 }
index d173118..2b5f380 100644 (file)
@@ -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;
index 1f2cb61..1514d9b 100644 (file)
@@ -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;