#include "messagemodel.h"
#include "network.h"
#include "networkmodel.h"
+#include "quassel.h"
#include "quasselui.h"
#include "signalproxy.h"
#include "util.h"
+#include <stdio.h>
+#include <stdlib.h>
+
QPointer<Client> Client::instanceptr = 0;
AccountId Client::_currentCoreAccount = 0;
_messageModel(0),
_messageProcessor(0),
_connectedToCore(false),
- _syncedToCore(false)
+ _syncedToCore(false),
+ _debugLog(&_debugLogBuffer)
{
_signalProxy->synchronize(_ircListHelper);
}
connect(bufferSyncer(), SIGNAL(lastSeenMsgSet(BufferId, MsgId)), _networkModel, SLOT(setLastSeenMsgId(BufferId, MsgId)));
connect(bufferSyncer(), SIGNAL(bufferRemoved(BufferId)), this, SLOT(bufferRemoved(BufferId)));
connect(bufferSyncer(), SIGNAL(bufferRenamed(BufferId, QString)), this, SLOT(bufferRenamed(BufferId, QString)));
+ connect(networkModel(), SIGNAL(setLastSeenMsg(BufferId, MsgId)), bufferSyncer(), SLOT(requestSetLastSeenMsg(BufferId, const MsgId &)));
signalProxy()->synchronize(bufferSyncer());
// create a new BufferViewManager
emit disconnected();
emit coreConnectionStateChanged(false);
+ backlogManager()->reset();
messageProcessor()->reset();
// Clear internal data. Hopefully nothing relies on it at this point.
//recvMessage(net, Message::server("", QString("[STATUS] %1").arg(msg)));
}
-void Client::recvMessage(const Message &msg_) {
- Message msg = msg_;
- messageProcessor()->process(msg);
+void Client::recvMessage(const Message &msg) {
+ Message msg_ = msg;
+ messageProcessor()->process(msg_);
}
void Client::setBufferLastSeenMsg(BufferId id, const MsgId &msgId) {
networkModel()->setData(bufferIndex, newName, Qt::DisplayRole);
}
}
+
+void Client::logMessage(QtMsgType type, const char *msg) {
+ fprintf(stderr, "%s\n", msg);
+ fflush(stderr);
+ if(type == QtFatalMsg) {
+ Quassel::logFatalMessage(msg);
+ } else {
+ QString msgString = QString("%1\n").arg(msg);
+ instance()->_debugLog << msgString;
+ emit instance()->logUpdated(msgString);
+ }
+}
+