settings: refactor for SettingsView - stage one

1. Add account config QML properties and use them
   in settings directly to avoid manual update
2. Rough clean up for video/audio settings
3. Remove settingsAdapter entirely and split the
   responsibility

Change-Id: Icf81b91d5a3a0dd9f2a52824159cd222367b801f
This commit is contained in:
Ming Rui Zhang
2021-08-26 14:57:24 -04:00
parent 8e1736fd9e
commit a196513d2e
57 changed files with 1078 additions and 2132 deletions

View File

@@ -530,6 +530,22 @@ MessagesAdapter::blockConversation(const QString& convUid)
lrcInstance_->getCurrentConversationModel()->removeConversation(currentConvUid, true);
}
void
MessagesAdapter::unbanContact(int index)
{
auto& accountInfo = lrcInstance_->getCurrentAccountInfo();
auto bannedContactList = accountInfo.contactModel->getBannedContacts();
auto it = bannedContactList.begin();
std::advance(it, index);
try {
auto contactInfo = accountInfo.contactModel->getContact(*it);
accountInfo.contactModel->addContact(contactInfo);
} catch (const std::out_of_range& e) {
qDebug() << e.what();
}
}
void
MessagesAdapter::clearConversationHistory(const QString& accountId, const QString& convUid)
{