From 26729f6f870b3ab1ae260e1a7e69a2264c178240 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Mon, 11 Jun 2012 11:03:15 +0200 Subject: [PATCH] Extra safety, but wtf --- src/libtomahawk/accounts/AccountModel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/accounts/AccountModel.cpp b/src/libtomahawk/accounts/AccountModel.cpp index 7b03cbe7d..41a1963c1 100644 --- a/src/libtomahawk/accounts/AccountModel.cpp +++ b/src/libtomahawk/accounts/AccountModel.cpp @@ -496,9 +496,14 @@ AccountModel::setData( const QModelIndex& index, const QVariant& value, int role if ( node->type == AccountModelNode::FactoryType ) { - // Turn on or off all accounts for this factory\ + tLog() << "Factory account with members:" << node->accounts << node->accounts.size(); + // Turn on or off all accounts for this factory foreach ( Account* acct, node->accounts ) { + tLog() << "Account we are toggling for factory:" << acct; + if ( !acct ) + continue; + checkState == Qt::Checked ? AccountManager::instance()->enableAccount( acct ) : AccountManager::instance()->disableAccount( acct ); }