Default identity is now created by the client, if no identity exists.
[quassel.git] / src / client / client.cpp
index 64d228d..b599c9a 100644 (file)
@@ -300,6 +300,9 @@ void Client::setSyncedToCore() {
   _bufferViewManager = new BufferViewManager(signalProxy(), this);
   connect(bufferViewManager(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
   connect(bufferViewManager(), SIGNAL(initDone()), this, SLOT(createDefautBufferView()));
+
+  createDefaultIdentity();
+
   _syncedToCore = true;
   emit connected();
   emit coreConnectionStateChanged(true);
@@ -319,6 +322,15 @@ void Client::createDefautBufferView() {
   }
 }
 
+void Client::createDefaultIdentity() {
+  if(_identities.isEmpty()) {
+    Identity identity;
+    identity.setToDefaults();
+    identity.setIdentityName(tr("Default Identity"));
+    createIdentity(identity);
+  }
+}
+
 void Client::setSecuredConnection() {
   emit securedConnection();
 }