From 93800658bba5dcbeca7f3deb02dd7091c455efe8 Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Sun, 11 Jan 2009 17:03:06 +0100 Subject: [PATCH] Default identity is now created by the client, if no identity exists. This has the benefit, that the identity is translated according to the client's language settings. --- src/client/client.cpp | 12 ++++++++++++ src/client/client.h | 1 + src/core/coresession.cpp | 6 ------ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/client/client.cpp b/src/client/client.cpp index 64d228d6..b599c9aa 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -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(); } diff --git a/src/client/client.h b/src/client/client.h index 2c65e1ee..003a23d8 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -186,6 +186,7 @@ private slots: void setSyncedToCore(); void requestInitialBacklog(); void createDefautBufferView(); + void createDefaultIdentity(); void setSecuredConnection(); diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 491e99a8..1e7d2a1e 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -133,12 +133,6 @@ void CoreSession::loadSettings() { 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); -- 2.20.1