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
##################
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
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();
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";
}
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));
}
}
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>();
}
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;
}
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()));
{
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);
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);
{
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);
emit identityCreated(other.id());
}
else {
- qWarning() << i18n("Identity already exists in client!");
+ kWarning(300000) << i18n("Identity already exists in client!");
}
}
void ClientAuthHandler::onSocketConnected()
{
if (_peer) {
- qWarning() << Q_FUNC_INFO << "Peer already exists!";
+ kWarning(300000) << Q_FUNC_INFO << "Peer already exists!";
return;
}
// 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
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."));
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)));
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();
}
#include <ctime>
-#include <QDebug>
+#include <KDebug>
INIT_SYNCABLE_OBJECT(ClientBacklogManager)
ClientBacklogManager::ClientBacklogManager(QObject *parent)
{
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;
}
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()) {
&& ((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;
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;
}
}
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;
}
}
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;
}
{
const ClientTransfer *t = qobject_cast<const ClientTransfer *>(transfer);
if (!t) {
- qWarning() << "Invalid Transfer added to ClientTransferManager!";
+ kWarning(300000) << "Invalid Transfer added to ClientTransferManager!";
return;
}
{
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();
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();
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();
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);
}
void ChannelBufferItem::part(IrcUser *ircUser)
{
if (!ircUser) {
- qWarning() << bufferName() << "ChannelBufferItem::part(): unknown User" << ircUser;
+ kWarning(300000) << bufferName() << "ChannelBufferItem::part(): unknown User" << ircUser;
return;
}
}
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);
{
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();
}
{
BufferItem *bufferItem = findBufferItem(bufferId);
if (!bufferItem) {
- qDebug() << "NetworkModel::setLastSeenMsgId(): buffer is unknown:" << bufferId;
+ kDebug(300000) << "NetworkModel::setLastSeenMsgId(): buffer is unknown:" << bufferId;
Client::purgeKnownBufferIds();
return;
}
{
BufferItem *bufferItem = findBufferItem(bufferId);
if (!bufferItem) {
- qDebug() << "NetworkModel::setMarkerLineMsgId(): buffer is unknown:" << bufferId;
+ kDebug(300000) << "NetworkModel::setMarkerLineMsgId(): buffer is unknown:" << bufferId;
Client::purgeKnownBufferIds();
return;
}
{
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);
{
BufferItem *bufferItem = findBufferItem(bufferId);
if (!bufferItem) {
- qDebug() << "NetworkModel::clearBufferActivity(): buffer is unknown:" << bufferId;
+ kDebug(300000) << "NetworkModel::clearBufferActivity(): buffer is unknown:" << bufferId;
return;
}
bufferItem->clearActivityLevel();
#include <QAbstractItemModel>
#include <QAbstractProxyModel>
-#include <QDebug>
+#include <KDebug>
SelectionModelSynchronizer::SelectionModelSynchronizer(QAbstractItemModel *parent)
: QObject(parent),
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;
}
#include "treemodel.h"
#include <QCoreApplication>
-#include <QDebug>
+#include <KDebug>
#include "quassel.h"
// 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;
}
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();
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 ====";
}
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();
}
{
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();
}
{
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;
}
{
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);
{
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;
}
{
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;
}
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;
}
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();
}
}
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;
}
}
ircevent.cpp
irclisthelper.cpp
ircuser.cpp
- logger.cpp
message.cpp
messageevent.cpp
network.cpp
include_directories(${ZLIB_INCLUDE_DIRS})
-if (HAVE_SYSLOG)
- add_definitions(-DHAVE_SYSLOG)
-endif()
-
if (EXECINFO_FOUND)
add_definitions(-DHAVE_EXECINFO)
include_directories(${EXECINFO_INCLUDES})
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QDebug>
+#include <KDebug>
#include <QStringList>
#include "aliasmanager.h"
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;
}
#include <QHostAddress>
+#include <KDebug>
+
#include "authhandler.h"
AuthHandler::AuthHandler(QObject *parent)
void AuthHandler::invalidMessage()
{
- qWarning() << Q_FUNC_INFO << "No handler for message!";
+ kWarning(300000) << Q_FUNC_INFO << "No handler for message!";
}
#include <QMetaMethod>
-#include "logger.h"
+#include <KDebug>
BasicHandler::BasicHandler(QObject *parent)
: QObject(parent),
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 {
#include <QString>
#include <QDataStream>
-#include <QDebug>
+#include <KDebug>
#include <QByteArray>
#include "bufferinfo.h"
#include "cliparser.h"
#include <QDir>
-#include <QDebug>
+#include <KDebug>
#include <QString>
#include <QFileInfo>
{
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);
}
return true;
}
}
- qWarning() << "Warning: Unrecognized argument:" << name;
+ kWarning(300000) << "Warning: Unrecognized argument:" << name;
return false;
}
}
// 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;
}
// 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;
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();
}
}
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;
}
}
#include <QTcpSocket>
#include <QTimer>
+#include <KDebug>
+
#include <zlib.h>
const int maxBufferSize = 64 * 1024 * 1024; // protect us from zip bombs
_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;
}
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;
}
_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;
}
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;
}
, _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;
}
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;
}
}
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;
#define EVENT_H
#include <QDateTime>
-#include <QDebug>
+#include <KDebug>
#include "eventmanager.h"
#include <QCoreApplication>
#include <QEvent>
-#include <QDebug>
+#include <KDebug>
#include "event.h"
#include "ircevent.h"
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;
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;
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;
}
}
}
{
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;
}
}
}
void EventManager::dispatchEvent(Event *event)
{
- //qDebug() << "Dispatching" << event;
+ //kDebug(300000) << "Dispatching" << event;
// we try handlers from specialized to generic by masking the enum
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) {
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;
#include "ignorelistmanager.h"
#include <QtCore>
-#include <QDebug>
+#include <KDebug>
#include <QStringList>
INIT_SYNCABLE_OBJECT(IgnoreListManager)
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;
}
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;
}
}
#include <QThread>
#include <KLocale>
+#include <KDebug>
#include "internalpeer.h"
{
// FIXME
Q_UNUSED(reason)
- qWarning() << "closing not implemented!";
+ kWarning(300000) << "closing not implemented!";
}
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;
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;
}
}
default:
- qWarning() << Q_FUNC_INFO << "Received unknown custom event:" << event->type();
+ kWarning(300000) << Q_FUNC_INFO << "Received unknown custom event:" << event->type();
return;
}
#include <QHashIterator>
#include <QTextCodec>
-#include <QDebug>
+#include <KDebug>
INIT_SYNCABLE_OBJECT(IrcChannel)
IrcChannel::IrcChannel(const QString &channelname, Network *network)
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;
}
{
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;
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;
}
#include "ircchannel.h"
#include <QTextCodec>
-#include <QDebug>
+#include <KDebug>
INIT_SYNCABLE_OBJECT(IrcUser)
IrcUser::IrcUser(const QString &hostmask, Network *network) : SyncableObject(network),
{
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);
# include <cxxabi.h>
# include <QFile>
# include <QTextStream>
-# include <QDebug>
+# include <KDebug>
#endif
void Quassel::logBacktrace(const QString &filename)
.arg(funcName);
dumpStream << debugLine << "\n";
- qDebug() << qPrintable(debugLine);
+ kDebug(300000) << qPrintable(debugLine);
}
dumpFile.close();
#endif /* BUILD_CRASHHANDLER */
+++ /dev/null
-/***************************************************************************
- * 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
+++ /dev/null
-/***************************************************************************
- * 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
// 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");
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");
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;
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)));
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;
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);
}
{
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;
}
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;
}
}
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;
}
}
#include <QAbstractSocket>
#include <QPointer>
+#include <KDebug>
+
#include "authhandler.h"
#include "protocol.h"
#include "signalproxy.h"
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);
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;
}
}
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);
QVariantList params(packedFunc);
if (params.isEmpty()) {
- qWarning() << Q_FUNC_INFO << "Received incompatible data:" << packedFunc;
+ kWarning(300000) << Q_FUNC_INFO << "Received incompatible data:" << packedFunc;
return;
}
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();
}
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();
}
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();
}
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();
}
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!
}
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!
// 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());
}
}
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;
}
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();
}
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();
}
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();
}
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();
}
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
}
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
#include "bufferinfo.h"
#include "identity.h"
-#include "logger.h"
#include "message.h"
#include "network.h"
#include "protocol.h"
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()
{
Quassel::~Quassel()
{
- if (logFile()) {
- logFile()->close();
- logFile()->deleteLater();
- }
delete _cliParser;
}
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;
}
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();
}
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:
static QString _coreDumpFileName;
static QString _configDirPath;
static QStringList _dataDirPaths;
-
- static LogLevel _logLevel;
- static QFile *_logFile;
- static bool _logToSyslog;
};
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
}
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;
void RemotePeer::close(const QString &reason)
{
if (!reason.isEmpty()) {
- qWarning() << "Disconnecting:" << reason;
+ kWarning(300000) << "Disconnecting:" << reason;
}
if (socket() && socket()->state() != QTcpSocket::UnconnectedState) {
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();
// 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);
// }
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]);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
: 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;
}
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
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;
}
}
default:
- qWarning() << Q_FUNC_INFO << "Received unknown custom event:" << event->type();
+ kWarning(300000) << Q_FUNC_INFO << "Received unknown custom event:" << event->type();
return;
}
}
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;
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 *));
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();
}
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();
}
}
}
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;
#include <QMetaProperty>
-#include <QDebug>
+#include <KDebug>
#include "syncableobject.h"
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;
}
setInitValue(propName, iterator.value());
else
setProperty(propName.toLatin1(), iterator.value());
- // qDebug() << "<<< SYNC:" << name << iterator.value();
+ // kDebug(300000) << "<<< SYNC:" << name << iterator.value();
iterator++;
}
}
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);
void Transfer::setError(const QString &errorString)
{
- qWarning() << Q_FUNC_INFO << errorString;
+ kWarning(300000) << Q_FUNC_INFO << errorString;
emit error(errorString);
setState(Failed);
cleanUp();
{
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;
}
#ifndef TYPES_H_
#define TYPES_H_
-#include <QDebug>
+#include <KDebug>
#include <QString>
#include <QVariant>
#include <QDataStream>
#include "util.h"
#include <QCoreApplication>
-#include <QDebug>
+#include <KDebug>
#include <QFile>
#include <QTextCodec>
}
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());
#include "abstractsqlstorage.h"
#include "quassel.h"
-#include "logger.h"
-
#include <QMutexLocker>
#include <QSqlDriver>
#include <QSqlError>
}
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();
}
}
}
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;
}
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();
}
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;
}
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();
}
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);
file.flush();
}
- qDebug() << "Done.";
+ kDebug(300000) << "Done.";
return true;
}
*/
#include "cipher.h"
-#include "logger.h"
Cipher::Cipher()
{
#include "coreauthhandler.h"
#include "coresession.h"
#include "coresettings.h"
-#include "logger.h"
#include "internalpeer.h"
#include "network.h"
#include "postgresqlstorage.h"
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")) {
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);
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();
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())
success = true;
}
else
- quWarning() << qPrintable(
+ kWarning(30000) << qPrintable(
i18n("Could not open IPv6 interface %1:%2: %3")
.arg(addr.toString())
.arg(port)
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())
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)
}
}
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;
}
}
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);
}
}
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."));
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();
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;
{
// 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;
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;
}
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);
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);
}
// 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;
}
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;
}
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/
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;
}
out << "Added user " << username << " successfully!" << endl;
}
else {
- qWarning() << "Unable to add user:" << qPrintable(username);
+ kWarning(300000) << "Unable to add user:" << qPrintable(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;
}
out << "Password changed successfully!" << endl;
}
else {
- qWarning() << "Failed to change password!";
+ kWarning(300000) << "Failed to change password!";
}
}
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;
}
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;
}
{
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;
}
{
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;
}
#include "coreapplication.h"
#include "core.h"
-#include "logger.h"
CoreApplicationInternal::CoreApplicationInternal()
: _coreCreated(false)
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;
bool CoreApplication::init()
{
if (Quassel::init() && _internal->init()) {
-#if QT_VERSION < 0x050000
- qInstallMsgHandler(Logger::logMessage);
-#else
- qInstallMessageHandler(Logger::logMessage);
-#endif
return true;
}
return false;
#endif
#include "core.h"
-#include "logger.h"
using namespace Protocol;
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)));
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()));
// 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);
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;
}
_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);
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();
#include "core.h"
#include "coresession.h"
-#include <QDebug>
+#include <KDebug>
INIT_SYNCABLE_OBJECT(CoreBacklogManager)
CoreBacklogManager::CoreBacklogManager(CoreSession *coreSession)
#include "corebasichandler.h"
#include "util.h"
-#include "logger.h"
CoreBasicHandler::CoreBasicHandler(CoreNetwork *parent)
: BasicHandler(parent),
{
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;
}
}
{
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;
}
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;
}
{
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;
}
{
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;
}
_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;
}
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());
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];
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)
{
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) {
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);
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());
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;
}
{
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;
}
#include "ircchannel.h"
#include "ircparser.h"
#include "ircuser.h"
-#include "logger.h"
#include "messageevent.h"
#include "remotepeer.h"
#include "storage.h"
{
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()));
}
net->userInput(bufinfo, msg);
}
else {
- qWarning() << "Trying to send to unconnected network:" << msg;
+ kWarning(300000) << "Trying to send to unconnected network:" << msg;
}
}
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;
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;
}
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);
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);
}
}
#include "ctcpevent.h"
#include "ircevent.h"
#include "ircuser.h"
-#include "logger.h"
#include "messageevent.h"
#include "netsplit.h"
#include "quassel.h"
{
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;
return;
if (e->params().at(0) != "+") {
- qWarning() << "Invalid AUTHENTICATE" << e;
+ kWarning(300000) << "Invalid AUTHENTICATE" << e;
return;
}
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) {
}
}
else {
- qWarning() << "Received MODE with too few parameters:" << e->params();
+ kWarning(300000) << "Received MODE with too few parameters:" << e->params();
}
++paramOffset;
}
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;
}
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);
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);
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;
}
{
IrcChannel *ircChannel = net->ircChannel(channel);
if (!ircChannel) {
- qDebug() << "handleEarlyNetsplitJoin(): channel " << channel << " invalid";
+ kDebug(300000) << "handleEarlyNetsplitJoin(): channel " << channel << " invalid";
return;
}
QList<NetworkEvent *> events;
{
// 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;
}
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];
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;
}
}
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
}
// 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);
}
// 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;
}
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!
{
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;
void EventStringifier::processIrcEventNumeric(IrcEventNumeric *e)
{
- //qDebug() << e->number();
+ //kDebug(300000) << e->number();
switch (e->number()) {
// Welcome, status, info messages. Just display these.
case 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()[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();
bool IrcParser::checkParamCount(const QString &cmd, const QList<QByteArray> ¶ms, int minParams)
{
if (params.count() < minParams) {
- qWarning() << "Expected" << minParams << "params for IRC command" << cmd << ", got:" << params;
+ kWarning(300000) << "Expected" << minParams << "params for IRC command" << cmd << ", got:" << params;
return false;
}
return true;
{
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;
}
QByteArray msg = e->data();
if (msg.isEmpty()) {
- qWarning() << "Received empty string from server!";
+ kWarning(300000) << "Received empty string from server!";
return;
}
if (!trailing.isEmpty())
params << trailing;
if (params.count() < 1) {
- qWarning() << "Received invalid string from server!";
+ kWarning(300000) << "Received invalid string from server!";
return;
}
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());
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!
#include <QtSql>
-#include "logger.h"
#include "network.h"
#include "quassel.h"
bool PostgreSqlStorage::isAvailable() const
{
- qDebug() << QSqlDatabase::drivers();
+ kDebug(300000) << QSqlDatabase::drivers();
if (!QSqlDatabase::isDriverAvailable("QPSQL")) return false;
return true;
}
// 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");
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;
}
{
QSqlDatabase db = logDb();
if (!beginTransaction(db)) {
- qWarning() << "PostgreSqlStorage::delUser(): cannot start transaction!";
+ kWarning(300000) << "PostgreSqlStorage::delUser(): cannot start transaction!";
return;
}
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;
}
}
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;
{
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;
}
}
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;
{
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;
}
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;
}
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;
}
}
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;
{
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;
}
}
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;
{
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;
}
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;
}
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;
}
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;
}
{
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();
}
safeExec(createQuery);
if (!watchQuery(createQuery)) {
- qWarning() << "PostgreSqlStorage::bufferInfo(): unable to create buffer";
+ kWarning(300000) << "PostgreSqlStorage::bufferInfo(): unable to create buffer";
db.rollback();
return BufferInfo();
}
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;
}
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;
}
{
QSqlDatabase db = logDb();
if (!beginTransaction(db)) {
- qWarning() << "PostgreSqlStorage::removeBuffer(): cannot start transaction!";
+ kWarning(300000) << "PostgreSqlStorage::removeBuffer(): cannot start transaction!";
return false;
}
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;
}
{
QSqlDatabase db = logDb();
if (!beginTransaction(db)) {
- qWarning() << "PostgreSqlStorage::renameBuffer(): cannot start transaction!";
+ kWarning(300000) << "PostgreSqlStorage::renameBuffer(): cannot start transaction!";
return false;
}
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;
}
{
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;
}
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;
}
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;
}
{
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;
}
{
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;
}
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;
}
QSqlQuery query = executePreparedQuery(queryName, params, db);
if (!watchQuery(query)) {
- qDebug() << "select_messages failed";
+ kDebug(300000) << "select_messages failed";
db.rollback();
return messagelist;
}
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;
}
// 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;
// }
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");
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);
}
}
return;
}
- qWarning() << "SessionThread::addClient() received invalid peer!" << peer;
+ kWarning(300000) << "SessionThread::addClient() received invalid peer!" << peer;
}
#include <QtSql>
-#include "logger.h"
#include "network.h"
#include "quassel.h"
#include <QDateTime>
#include <QFile>
-#include "logger.h"
+#include <KDebug>
+
#include "quassel.h"
#ifdef HAVE_SSL
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.";
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;
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;
}
_ca = certList;
if (!certFile.reset()) {
- quWarning() << "SslServer: IO error reading certificate file";
+ kWarning(300000) << "SslServer: IO error reading certificate file";
return false;
}
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
#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;
}
{
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);
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));
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();
}
// 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();
// }
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);
// }
// }
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";
}
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";
}
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";
}
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;
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QDebug>
+#include <KDebug>
#include <QAbstractButton>
#include <QFormLayout>
#include <QSpinBox>
properties[key] = def;
}
}
- qDebug() << properties;
+ kDebug(300000) << properties;
// QVariantMap properties = _backends[backend].toMap()["ConnectionProperties"].toMap();
// if(!properties.isEmpty() && _connectionBox) {
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;
}
// 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;
}
}
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;
}
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");
}
}
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();
#include "qtuisettings.h"
#include <QAction>
-#include <QDebug>
+#include <KDebug>
#include <QEvent>
#include <QAbstractButton>
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());
QtUi::QtUi() : GraphicalUi()
{
if (_instance != 0) {
- qWarning() << "QtUi has been instantiated again!";
+ kWarning(300000) << "QtUi has been instantiated again!";
return;
}
_instance = this;
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);
{
// 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);
{
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);
#include "aliasesmodel.h"
-#include <QDebug>
+#include <KDebug>
#include <QStringList>
#include "client.h"
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());
{
// 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);
{
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;
}
foreach(CertIdentity *id, toUpdate) {
const Identity *cid = Client::identity(id->id());
if (!cid) {
- qWarning() << "Invalid client identity!";
+ kWarning(300000) << "Invalid client identity!";
numevents--;
continue;
}
}
}
else {
- qWarning() << "Sync dialog called without stuff to change!";
+ kWarning(300000) << "Sync dialog called without stuff to change!";
accept();
}
}
#include "ignorelistmodel.h"
-#include <QDebug>
+#include <KDebug>
#include <QStringList>
#include <QPushButton>
#include <QMessageBox>
#include <QString>
#include <QEvent>
-#include <QDebug>
+#include <KDebug>
#include <KIcon>
#include <KLocale>
{
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()) {
{
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();
foreach(NetworkInfo info, toUpdate) {
const Network *net = Client::network(info.networkId);
if (!net) {
- qWarning() << "Invalid client network!";
+ kWarning(300000) << "Invalid client network!";
numevents--;
continue;
}
}
}
else {
- qWarning() << "Sync dialog called without stuff to change!";
+ kWarning(300000) << "Sync dialog called without stuff to change!";
accept();
}
}
checkForRegisteredHosts();
}
else {
- //qDebug() << "StatusNotifierWatcher not reachable!";
+ //kDebug(300000) << "StatusNotifierWatcher not reachable!";
setMode(Legacy);
}
}
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);
m_dbus(QDBusConnection::connectToBus(QDBusConnection::SessionBus, m_service))
{
new StatusNotifierItemAdaptor(this);
- //qDebug() << "service is" << m_service;
+ //kDebug(300000) << "service is" << m_service;
registerService();
}
//
void StatusNotifierItemDBus::registerService()
{
- //qDebug() << "registering to" << m_service;
+ //kDebug(300000) << "registering to" << m_service;
m_dbus.registerService(m_service);
m_dbus.registerObject("/StatusNotifierItem", this);
}
// 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);
#include <QLayout>
#include <QPainter>
-#include <QDebug>
+#include <KDebug>
VerticalDockTitle::VerticalDockTitle(QDockWidget *parent)
: QWidget(parent)
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;
}
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;
}
return false;
// the buffer is not known to us
- qDebug() << "BufferViewOverlayFilter::filterAcceptsRow()" << bufferId << "is unknown!";
+ kDebug(300000) << "BufferViewOverlayFilter::filterAcceptsRow()" << bufferId << "is unknown!";
return false;
}
#include "clickablelabel.h"
-#include <QDebug>
+#include <KDebug>
#include <QMouseEvent>
ClickableLabel::ClickableLabel(QWidget *parent)
#include "flatproxymodel.h"
#include <QItemSelection>
-#include <QDebug>
+#include <KDebug>
FlatProxyModel::FlatProxyModel(QObject *parent)
: QAbstractProxyModel(parent),
}
}
- 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 :)
}
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();
}
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();
}
}
// 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);
}
}
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);
}
}
// 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!";
}
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++) {
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();
}
}
else if (type & ExternalMask)
handleExternalAction(type, action);
else
- qWarning() << "NetworkModelController::actionTriggered(): Unhandled action!";
+ kWarning(300000) << "NetworkModelController::actionTriggered(): Unhandled action!";
}
}
Client::ignoreListManager()->requestToggleIgnoreRule(action->property("ignoreRule").toString());
break;
default:
- qWarning() << "Unhandled nick action";
+ kWarning(300000) << "Unhandled nick action";
}
}
}
#include <QApplication>
#include <QHeaderView>
#include <QScrollBar>
-#include <QDebug>
+#include <KDebug>
#include <QMenu>
#include "buffermodel.h"
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();
// 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()) {
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();
_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);
}
}
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);
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;
}
}
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);
}
}
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);
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);
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;
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;
}
}
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")
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;
}
}
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);
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);
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;
}
}
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;
}
}
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();
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);
}
}
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();
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);
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();
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);
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();
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);
{
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);
//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);
}
}
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
{
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")
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();
}
}
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;
}
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;
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;
}
}
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;
}
else {
if (shouldExist)
- qWarning() << "Could not open stylesheet file:" << file.fileName();
+ kWarning(300000) << "Could not open stylesheet file:" << file.fileName();
return QString();
}
}
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;
}
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;
}
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;