From: Marcus Eggenberger Date: Tue, 25 Nov 2008 22:25:14 +0000 (+0100) Subject: postponed backlog loading until custom views are loaded and the buffersyncer knows... X-Git-Tag: 0.4.0~403 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=f7e987956ef7e469a493a669e2f0c0901f5a7ead postponed backlog loading until custom views are loaded and the buffersyncer knows the last read message state --- diff --git a/src/client/client.cpp b/src/client/client.cpp index 0ccde849..16437570 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -277,17 +277,25 @@ void Client::setSyncedToCore() { 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(bufferSyncer(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog())); connect(networkModel(), SIGNAL(setLastSeenMsg(BufferId, MsgId)), bufferSyncer(), SLOT(requestSetLastSeenMsg(BufferId, const MsgId &))); signalProxy()->synchronize(bufferSyncer()); // create a new BufferViewManager + Q_ASSERT(!_bufferViewManager); _bufferViewManager = new BufferViewManager(signalProxy(), this); + connect(bufferViewManager(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog())); _syncedToCore = true; emit connected(); emit coreConnectionStateChanged(true); } +void Client::requestInitialBacklog() { + if(bufferViewManager()->isInitialized() && bufferSyncer()->isInitialized()) + Client::backlogManager()->requestInitialBacklog(); +} + void Client::setSecuredConnection() { emit securedConnection(); } diff --git a/src/client/client.h b/src/client/client.h index 8a68d997..40086acc 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -176,6 +176,7 @@ private slots: void setConnectedToCore(AccountId id, QIODevice *socket = 0); void setSyncedToCore(); + void requestInitialBacklog(); void setSecuredConnection(); diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index b7a6181f..24b89dce 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -481,9 +481,8 @@ void MainWin::connectedToCore() { connect(Client::bufferViewManager(), SIGNAL(bufferViewConfigAdded(int)), this, SLOT(addBufferView(int))); connect(Client::bufferViewManager(), SIGNAL(bufferViewConfigDeleted(int)), this, SLOT(removeBufferView(int))); connect(Client::bufferViewManager(), SIGNAL(initDone()), this, SLOT(loadLayout())); - + setConnectedState(); - Client::backlogManager()->requestInitialBacklog(); } void MainWin::setConnectedState() {