1
0
Fork 0
forked from blue/squawk

first attempt to remove accounts

This commit is contained in:
Blue 2019-05-29 18:05:54 +03:00
parent 8432a574b9
commit 234697050b
14 changed files with 190 additions and 14 deletions

View file

@ -78,9 +78,19 @@ void Models::Accounts::onAccountChanged(Item* item, int row, int col)
if (col < columnCount(QModelIndex())) {
emit dataChanged(createIndex(row, col, this), createIndex(row, col, this));
}
emit changed();
}
Models::Account * Models::Accounts::getAccount(int index)
{
return accs[index];
}
void Models::Accounts::removeAccount(int index)
{
Account* account = accs[index];
beginRemoveRows(QModelIndex(), index, index);
disconnect(account, SIGNAL(childChanged(Models::Item*, int, int)), this, SLOT(onAccountChanged(Models::Item*, int, int)));
accs.erase(accs.begin() + index);
endRemoveRows();
}