From b6737f1d50245e7cb41a00257c434846f6c31b07 Mon Sep 17 00:00:00 2001 From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> Date: Fri, 19 May 2023 15:55:08 -0400 Subject: [PATCH] misc: fix some connect warnings when starting with 0 accounts Change-Id: I15f3a79107912d83a3c1ffe18538c26e37a419e8 --- src/app/contactadapter.cpp | 5 ++--- src/app/currentaccount.cpp | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/contactadapter.cpp b/src/app/contactadapter.cpp index 7585f3466..dd39ab6fd 100644 --- a/src/app/contactadapter.cpp +++ b/src/app/contactadapter.cpp @@ -33,11 +33,11 @@ ContactAdapter::ContactAdapter(LRCInstance* instance, QObject* parent) selectableProxyModel_.reset(new SelectableProxyModel(this)); if (lrcInstance_) { - connectSignals(); connect(lrcInstance_, &LRCInstance::currentAccountIdChanged, this, &ContactAdapter::connectSignals); + connectSignals(); } } @@ -261,8 +261,7 @@ ContactAdapter::updateConnectionInfo() void ContactAdapter::connectSignals() { - if (!lrcInstance_->getCurrentContactModel()) { - qWarning() << Q_FUNC_INFO << "No contact model"; + if (lrcInstance_->get_currentAccountId().isEmpty()) { return; } diff --git a/src/app/currentaccount.cpp b/src/app/currentaccount.cpp index 0867aa6e2..bf42baa81 100644 --- a/src/app/currentaccount.cpp +++ b/src/app/currentaccount.cpp @@ -90,6 +90,9 @@ CurrentAccount::get_isLocalModeratorsEnabled() void CurrentAccount::setupForAccount() { + if (lrcInstance_->get_currentAccountId().isEmpty()) + return; + connect(lrcInstance_->getCurrentContactModel(), &ContactModel::bannedStatusChanged, this, -- GitLab