mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-10 09:45:40 +02:00
qml: reconnect models on account's change
Change-Id: I7e88828308c8d64ea30e8ad15db950e0605d86dc
This commit is contained in:
parent
929bc9b9ce
commit
5f35e19260
7 changed files with 38 additions and 1 deletions
|
@ -42,12 +42,22 @@ CallAdapter::initQmlObject()
|
|||
&BehaviorController::showIncomingCallView,
|
||||
this,
|
||||
&CallAdapter::slotShowIncomingCallView);
|
||||
connect(&LRCInstance::instance(),
|
||||
&LRCInstance::currentAccountChanged,
|
||||
this,
|
||||
&CallAdapter::slotAccountChanged);
|
||||
connect(&LRCInstance::behaviorController(),
|
||||
&BehaviorController::showCallView,
|
||||
this,
|
||||
&CallAdapter::slotShowCallView);
|
||||
}
|
||||
|
||||
void
|
||||
CallAdapter::slotAccountChanged()
|
||||
{
|
||||
connectCallModel(LRCInstance::getCurrAccId());
|
||||
}
|
||||
|
||||
void
|
||||
CallAdapter::placeAudioOnlyCall()
|
||||
{
|
||||
|
|
|
@ -86,6 +86,7 @@ public slots:
|
|||
void slotShowIncomingCallView(const QString &accountId,
|
||||
const lrc::api::conversation::Info &convInfo);
|
||||
void slotShowCallView(const QString &accountId, const lrc::api::conversation::Info &convInfo);
|
||||
void slotAccountChanged();
|
||||
|
||||
private:
|
||||
void updateCall(const QString &convUid = {},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2020 by Savoir-faire Linux
|
||||
* Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>
|
||||
* Author: Anthony Léonard <anthony.leonard@savoirfairelinux.com>
|
||||
* Author: Anthony L�onard <anthony.leonard@savoirfairelinux.com>
|
||||
* Author: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
|
||||
* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
|
||||
* Author: Isa Nanic <isa.nanic@savoirfairelinux.com>
|
||||
|
@ -45,10 +45,20 @@ ConversationsAdapter::initQmlObject()
|
|||
[this](const QString &accountId, lrc::api::conversation::Info convInfo) {
|
||||
emit showChatView(accountId, convInfo.uid);
|
||||
});
|
||||
connect(&LRCInstance::instance(),
|
||||
&LRCInstance::currentAccountChanged,
|
||||
this,
|
||||
&ConversationsAdapter::slotAccountChanged);
|
||||
|
||||
connectConversationModel();
|
||||
}
|
||||
|
||||
void
|
||||
ConversationsAdapter::slotAccountChanged()
|
||||
{
|
||||
connectConversationModel();
|
||||
}
|
||||
|
||||
void
|
||||
ConversationsAdapter::backToWelcomePage()
|
||||
{
|
||||
|
|
|
@ -47,6 +47,9 @@ signals:
|
|||
void showChatView(const QString &accountId, const QString &convUid);
|
||||
void showConversationTabs(bool visible);
|
||||
|
||||
public slots:
|
||||
void slotAccountChanged();
|
||||
|
||||
private:
|
||||
void initQmlObject() override;
|
||||
void setConversationFilter(lrc::api::profile::Type filter);
|
||||
|
|
|
@ -284,6 +284,7 @@ public:
|
|||
setSelectedAccountId(const QString &accountId = {})
|
||||
{
|
||||
instance().selectedAccountId_ = accountId;
|
||||
emit instance().currentAccountChanged();
|
||||
QSettings settings("jami.net", "Jami");
|
||||
settings.setValue(SettingsKey::selectedAccount, accountId);
|
||||
|
||||
|
@ -454,6 +455,7 @@ public:
|
|||
|
||||
signals:
|
||||
void accountListChanged();
|
||||
void currentAccountChanged();
|
||||
|
||||
private:
|
||||
LRCInstance(migrateCallback willMigrateCb = {}, migrateCallback didMigrateCb = {})
|
||||
|
|
|
@ -40,6 +40,16 @@ MessagesAdapter::~MessagesAdapter() {}
|
|||
|
||||
void
|
||||
MessagesAdapter::initQmlObject()
|
||||
{
|
||||
connect(&LRCInstance::instance(),
|
||||
&LRCInstance::currentAccountChanged,
|
||||
this,
|
||||
&MessagesAdapter::slotAccountChanged);
|
||||
connectConversationModel();
|
||||
}
|
||||
|
||||
void
|
||||
MessagesAdapter::slotAccountChanged()
|
||||
{
|
||||
connectConversationModel();
|
||||
}
|
||||
|
|
|
@ -91,6 +91,7 @@ public slots:
|
|||
void slotUpdateDraft(const QString &content);
|
||||
void slotMessagesCleared();
|
||||
void slotMessagesLoaded();
|
||||
void slotAccountChanged();
|
||||
|
||||
private:
|
||||
void initQmlObject() override final;
|
||||
|
|
Loading…
Add table
Reference in a new issue