1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 23:39:42 +01:00

more debug for account row removing

This commit is contained in:
Leo Franchi 2012-02-17 11:31:33 -05:00
parent e6f4674064
commit 0b452cc415

View File

@ -511,6 +511,7 @@ AccountModel::accountRemoved( Account* account )
{
// Find the row this belongs to and update/remove
AccountFactory* factory = AccountManager::instance()->factoryForAccount( account );
qDebug() << "AccountModel got account removed:" << account->accountFriendlyName();
for ( int i = 0; i < m_accounts.size(); i++ )
{
AccountModelNode* n = m_accounts.at( i );
@ -533,6 +534,7 @@ AccountModel::accountRemoved( Account* account )
if ( found )
{
qDebug() << "Found account removed but we don't want to delete a row!" << i << n->type << n->factory;
const QModelIndex idx = index( i, 0, QModelIndex() );
emit dataChanged( idx, idx );
@ -542,6 +544,8 @@ AccountModel::accountRemoved( Account* account )
// Manual resolver added, remove the row now
if ( n->type == AccountModelNode::ManualResolverType && n->resolverAccount && n->resolverAccount == account )
{
qDebug() << "Found account removed AND REMOVING IT FROM THE LIST!" << n->factory << n->type << n->accounts << i;
beginRemoveRows( QModelIndex(), i, i );
m_accounts.removeAt( i );
endRemoveRows();