From 05ea3065f899faeae946157326e0724838180e26 Mon Sep 17 00:00:00 2001
From: Leo Franchi <lfranchi@kde.org>
Date: Sat, 26 May 2012 18:35:12 -0400
Subject: [PATCH] Allow rating custom resolvers

---
 src/libtomahawk/accounts/AccountModel.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/libtomahawk/accounts/AccountModel.cpp b/src/libtomahawk/accounts/AccountModel.cpp
index 61ae6e71e..2f263b9ac 100644
--- a/src/libtomahawk/accounts/AccountModel.cpp
+++ b/src/libtomahawk/accounts/AccountModel.cpp
@@ -559,18 +559,22 @@ AccountModel::setData( const QModelIndex& index, const QVariant& value, int role
         // We only support rating Attica resolvers for the moment.
         Attica::Content content;
         if ( node->type == AccountModelNode::AtticaType )
+        {
             content = node->atticaContent;
+
+            AtticaManager::ResolverState state = AtticaManager::instance()->resolverState( content );
+            // For now only allow rating if a resolver is installed!
+            if ( state != AtticaManager::Installed && state != AtticaManager::NeedsUpgrade )
+                return false;
+        } // Allow rating custom attica accounts regardless as user may have installed manually
         else if ( node->type == AccountModelNode::CustomAccountType && qobject_cast< CustomAtticaAccount* >( node->customAccount ) )
             content = qobject_cast< CustomAtticaAccount* >( node->customAccount )->atticaContent();
 
         Q_ASSERT( !content.id().isNull() );
 
-        AtticaManager::ResolverState state = AtticaManager::instance()->resolverState( content );
-        // For now only allow rating if a resolver is installed!
-        if ( state != AtticaManager::Installed && state != AtticaManager::NeedsUpgrade )
-            return false;
         if ( AtticaManager::instance()->userHasRated( content ) )
             return false;
+
         content.setRating( value.toInt() * 20 );
         AtticaManager::instance()->uploadRating( content );