From ea47a5556d3d6301a2900c177f3f28c6aa8c0392 Mon Sep 17 00:00:00 2001 From: Leo Franchi <lfranchi@kde.org> Date: Fri, 24 Feb 2012 16:49:14 -0600 Subject: [PATCH] better assert --- src/libtomahawk/accounts/AccountModel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/accounts/AccountModel.cpp b/src/libtomahawk/accounts/AccountModel.cpp index 8f3869378..ad3c93d8e 100644 --- a/src/libtomahawk/accounts/AccountModel.cpp +++ b/src/libtomahawk/accounts/AccountModel.cpp @@ -370,8 +370,9 @@ AccountModel::setData( const QModelIndex& index, const QVariant& value, int role case AccountModelNode::UniqueFactoryType: { const Qt::CheckState state = static_cast< Qt::CheckState >( value.toInt() ); - if ( node->accounts.isEmpty() && state == Qt::Checked ) + if ( node->accounts.isEmpty() ) { + Q_ASSERT( state == Qt::Checked ); // How could we have a checked unique factory w/ no account?? // No account for this unique factory, create it // Don't add it to node->accounts here, slot attached to accountmanager::accountcreated will do it for us acct = node->factory->createAccount();