From bbf76e1e6418f3f1ffed52e3b421ba7d122e6897 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sun, 23 Oct 2022 23:23:56 +0200 Subject: [PATCH] Fix disconnects --- src/chatdocumenthandler.cpp | 2 +- src/controller.cpp | 2 +- src/customemojimodel.cpp | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/chatdocumenthandler.cpp b/src/chatdocumenthandler.cpp index 300d3ab53..460348866 100644 --- a/src/chatdocumenthandler.cpp +++ b/src/chatdocumenthandler.cpp @@ -102,7 +102,7 @@ ChatDocumentHandler::ChatDocumentHandler(QObject *parent) m_completionModel->setRoom(m_room); static NeoChatRoom *previousRoom = nullptr; if (previousRoom) { - disconnect(nullptr, &NeoChatRoom::chatBoxTextChanged, this, nullptr); + disconnect(previousRoom, &NeoChatRoom::chatBoxTextChanged, this, nullptr); } previousRoom = m_room; connect(m_room, &NeoChatRoom::chatBoxTextChanged, this, [this]() { diff --git a/src/controller.cpp b/src/controller.cpp index d7def8f72..dc6cf1868 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -635,7 +635,7 @@ void Controller::setActiveConnection(Connection *connection) return; } if (m_connection != nullptr) { - disconnect(connection, &Connection::syncError, this, nullptr); + disconnect(m_connection, &Connection::syncError, this, nullptr); } m_connection = connection; if (connection != nullptr) { diff --git a/src/customemojimodel.cpp b/src/customemojimodel.cpp index e16d0a58f..9818b11cb 100644 --- a/src/customemojimodel.cpp +++ b/src/customemojimodel.cpp @@ -113,7 +113,6 @@ CustomEmojiModel::CustomEmojiModel(QObject *parent) return; } CustomEmojiModel::fetchEmojis(); - disconnect(nullptr, &Connection::accountDataChanged, this, nullptr); connect(Controller::instance().activeConnection(), &Connection::accountDataChanged, this, [this](const QString &id) { if (id != QStringLiteral("im.ponies.user_emotes")) { return;