Skip to content
Snippets Groups Projects
Commit b6737f1d authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Sébastien Blin
Browse files

misc: fix some connect warnings when starting with 0 accounts

Change-Id: I15f3a79107912d83a3c1ffe18538c26e37a419e8
parent 15eb51c7
No related branches found
No related tags found
No related merge requests found
...@@ -33,11 +33,11 @@ ContactAdapter::ContactAdapter(LRCInstance* instance, QObject* parent) ...@@ -33,11 +33,11 @@ ContactAdapter::ContactAdapter(LRCInstance* instance, QObject* parent)
selectableProxyModel_.reset(new SelectableProxyModel(this)); selectableProxyModel_.reset(new SelectableProxyModel(this));
if (lrcInstance_) { if (lrcInstance_) {
connectSignals();
connect(lrcInstance_, connect(lrcInstance_,
&LRCInstance::currentAccountIdChanged, &LRCInstance::currentAccountIdChanged,
this, this,
&ContactAdapter::connectSignals); &ContactAdapter::connectSignals);
connectSignals();
} }
} }
...@@ -261,8 +261,7 @@ ContactAdapter::updateConnectionInfo() ...@@ -261,8 +261,7 @@ ContactAdapter::updateConnectionInfo()
void void
ContactAdapter::connectSignals() ContactAdapter::connectSignals()
{ {
if (!lrcInstance_->getCurrentContactModel()) { if (lrcInstance_->get_currentAccountId().isEmpty()) {
qWarning() << Q_FUNC_INFO << "No contact model";
return; return;
} }
......
...@@ -90,6 +90,9 @@ CurrentAccount::get_isLocalModeratorsEnabled() ...@@ -90,6 +90,9 @@ CurrentAccount::get_isLocalModeratorsEnabled()
void void
CurrentAccount::setupForAccount() CurrentAccount::setupForAccount()
{ {
if (lrcInstance_->get_currentAccountId().isEmpty())
return;
connect(lrcInstance_->getCurrentContactModel(), connect(lrcInstance_->getCurrentContactModel(),
&ContactModel::bannedStatusChanged, &ContactModel::bannedStatusChanged,
this, this,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment