forked from blue/squawk
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:
parent
0d584c5aba
commit
721f6daa36
10 changed files with 62 additions and 8 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue