Default identity is now created by the client, if no identity exists.
authorMarcus Eggenberger <egs@quassel-irc.org>
Sun, 11 Jan 2009 16:03:06 +0000 (17:03 +0100)
committerMarcus Eggenberger <egs@quassel-irc.org>
Sun, 11 Jan 2009 16:03:06 +0000 (17:03 +0100)
This has the benefit, that the identity is translated according to the client's language settings.

src/client/client.cpp
src/client/client.h
src/core/coresession.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()));
   _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);
   _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();
 }
 void Client::setSecuredConnection() {
   emit securedConnection();
 }
index 2c65e1e..003a23d 100644 (file)
@@ -186,6 +186,7 @@ private slots:
   void setSyncedToCore();
   void requestInitialBacklog();
   void createDefautBufferView();
   void setSyncedToCore();
   void requestInitialBacklog();
   void createDefautBufferView();
+  void createDefaultIdentity();
   void setSecuredConnection();
 
 
   void setSecuredConnection();
 
 
index 491e99a..1e7d2a1 100644 (file)
@@ -133,12 +133,6 @@ void CoreSession::loadSettings() {
   foreach(CoreIdentity identity, Core::identities(user())) {
     createIdentity(identity);
   }
   foreach(CoreIdentity identity, Core::identities(user())) {
     createIdentity(identity);
   }
-  if(!_identities.count()) {
-    Identity identity;
-    identity.setToDefaults();
-    identity.setIdentityName(tr("Default Identity"));
-    createIdentity(identity, QVariantMap());
-  }
 
   foreach(NetworkInfo info, Core::networks(user())) {
     createNetwork(info);
 
   foreach(NetworkInfo info, Core::networks(user())) {
     createNetwork(info);