fix bug when everything was treated as animation, bug with not working group amount of messages, handled the situation when preview is painted but the file was lost

This commit is contained in:
Blue 2021-05-17 00:52:59 +03:00
parent 0d584c5aba
commit 721f6daa36
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
10 changed files with 62 additions and 8 deletions

View file

@ -48,6 +48,7 @@ Models::Roster::~Roster()
void Models::Roster::addAccount(const QMap<QString, QVariant>& data)
{
Account* acc = new Account(data);
connect(acc, &Account::reconnected, this, &Roster::onAccountReconnected);
root->appendChild(acc);
accounts.insert(std::make_pair(acc->getName(), acc));
accountsModel->addAccount(acc);
@ -744,6 +745,7 @@ void Models::Roster::removeAccount(const QString& account)
}
}
disconnect(acc, &Account::reconnected, this, &Roster::onAccountReconnected);
acc->deleteLater();
}
@ -1003,3 +1005,15 @@ Models::Element * Models::Roster::getElement(const Models::Roster::ElId& id)
return NULL;
}
void Models::Roster::onAccountReconnected()
{
Account* acc = static_cast<Account*>(sender());
QString accName = acc->getName();
for (const std::pair<const ElId, Contact*>& pair : contacts) {
if (pair.first.account == accName) {
pair.second->handleRecconnect();
}
}
}