X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcoresession.cpp;h=33f094cedd7e6a813c0976c89558b5517d95aaa1;hb=bd1a18355495899b5ce3003599a67e1ea7ca01cc;hp=c9891d23bb65738ec6c8e347ad29bb8494ef8cbb;hpb=78f804479b1278b89adf09e41a8cc33236562430;p=quassel.git diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index c9891d23..33f094ce 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -75,6 +75,7 @@ CoreSession::CoreSession(UserId uid, bool restoreState, QObject *parent) : QObje connect(_bufferSyncer, SIGNAL(lastSeenSet(BufferId, const QDateTime &)), this, SLOT(storeBufferLastSeen(BufferId, const QDateTime &))); connect(_bufferSyncer, SIGNAL(removeBufferRequested(BufferId)), this, SLOT(removeBufferRequested(BufferId))); connect(this, SIGNAL(bufferRemoved(BufferId)), _bufferSyncer, SLOT(removeBuffer(BufferId))); + connect(this, SIGNAL(bufferRenamed(BufferId, QString)), _bufferSyncer, SLOT(renameBuffer(BufferId, QString))); p->synchronize(_bufferSyncer); // Restore session state @@ -242,6 +243,8 @@ void CoreSession::attachNetworkConnection(NetworkConnection *conn) { this, SLOT(recvMessageFromServer(Message::Type, BufferInfo::Type, QString, QString, QString, quint8))); connect(conn, SIGNAL(displayStatusMsg(QString)), this, SLOT(recvStatusMsgFromServer(QString))); + connect(conn, SIGNAL(nickChanged(const NetworkId &, const QString &, const QString &)), + this, SLOT(renameBuffer(const NetworkId &, const QString &, const QString &))); } void CoreSession::disconnectFromNetwork(NetworkId id) { @@ -500,3 +503,10 @@ void CoreSession::removeBufferRequested(BufferId bufferId) { if(Core::removeBuffer(user(), bufferId)) emit bufferRemoved(bufferId); } + +void CoreSession::renameBuffer(const NetworkId &networkId, const QString &newName, const QString &oldName) { + BufferId bufferId = Core::renameBuffer(user(), networkId, newName, oldName); + if(bufferId.isValid()) { + emit bufferRenamed(bufferId, newName); + } +}