properly rewind oidentd config file
[quassel.git] / src / client / client.cpp
index b1b28ee..21beda0 100644 (file)
@@ -322,13 +322,13 @@ void Client::setSyncedToCore() {
   connect(bufferSyncer(), SIGNAL(buffersPermanentlyMerged(BufferId, BufferId)), this, SLOT(buffersPermanentlyMerged(BufferId, BufferId)));
   connect(bufferSyncer(), SIGNAL(buffersPermanentlyMerged(BufferId, BufferId)), _messageModel, SLOT(buffersPermanentlyMerged(BufferId, BufferId)));
   connect(bufferSyncer(), SIGNAL(bufferMarkedAsRead(BufferId)), SIGNAL(bufferMarkedAsRead(BufferId)));
-  connect(networkModel(), SIGNAL(setLastSeenMsg(BufferId, MsgId)), bufferSyncer(), SLOT(requestSetLastSeenMsg(BufferId, const MsgId &)));
+  connect(networkModel(), SIGNAL(requestSetLastSeenMsg(BufferId, MsgId)), bufferSyncer(), SLOT(requestSetLastSeenMsg(BufferId, const MsgId &)));
   signalProxy()->synchronize(bufferSyncer());
 
   // create a new BufferViewManager
   Q_ASSERT(!_bufferViewManager);
   _bufferViewManager = new ClientBufferViewManager(signalProxy(), this);
-  connect(bufferViewManager(), SIGNAL(initDone()), this, SLOT(createDefaultBufferView()));
+  connect(_bufferViewManager, SIGNAL(initDone()), _bufferViewOverlay, SLOT(restore()));
 
   // create AliasManager
   Q_ASSERT(!_aliasManager);
@@ -359,20 +359,14 @@ void Client::requestInitialBacklog() {
   // triggers this slot. But we have to make sure that we know all buffers yet.
   // so we check the BufferSyncer and in case it wasn't initialized we wait for that instead
   if(!bufferSyncer()->isInitialized()) {
-    connect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
+    disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
     connect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
     return;
   }
-  _backlogManager->requestInitialBacklog();
-}
+  disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
+  disconnect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
 
-void Client::createDefaultBufferView() {
-  if(bufferViewManager()->bufferViewConfigs().isEmpty()) {
-    BufferViewConfig config(-1);
-    config.setBufferViewName(tr("All Chats"));
-    config.initSetBufferList(networkModel()->allBufferIdsSorted());
-    bufferViewManager()->requestCreateBufferView(config.toVariantMap());
-  }
+  _backlogManager->requestInitialBacklog();
 }
 
 void Client::disconnectFromCore() {
@@ -404,6 +398,8 @@ void Client::setDisconnectedFromCore() {
     _bufferViewManager = 0;
   }
 
+  _bufferViewOverlay->reset();
+
   if(_aliasManager) {
     _aliasManager->deleteLater();
     _aliasManager = 0;
@@ -474,11 +470,17 @@ void Client::setBufferLastSeenMsg(BufferId id, const MsgId &msgId) {
     bufferSyncer()->requestSetLastSeenMsg(id, msgId);
 }
 
-void Client::setBufferMarkerLine(BufferId id, const MsgId &msgId) {
+void Client::setMarkerLine(BufferId id, const MsgId &msgId) {
   if(bufferSyncer())
     bufferSyncer()->requestSetMarkerLine(id, msgId);
 }
 
+MsgId Client::markerLine(BufferId id) {
+  if(id.isValid() && networkModel())
+    return networkModel()->markerLineMsgId(id);
+  return MsgId();
+}
+
 void Client::removeBuffer(BufferId id) {
   if(!bufferSyncer()) return;
   bufferSyncer()->requestRemoveBuffer(id);