| 228 | } |
| 229 | |
| 230 | int Selector::GetScore() const { |
| 231 | int score = 0; |
| 232 | |
| 233 | score += ( ( GetWidgetName().empty() || ( GetWidgetName() == "*" ) ) ? 0 : 1 ); |
| 234 | score += ( ( !GetState() ) ? 0 : 1 ); |
| 235 | score += ( GetClass().empty() ? 0 : 100 ); |
| 236 | score += ( GetId().empty() ? 0 : 10000 ); |
| 237 | |
| 238 | if( ( m_hierarchy_type != HierarchyType::ROOT ) && GetParent() ) { |
| 239 | score += GetParent()->GetScore(); |
| 240 | } |
| 241 | |
| 242 | return score; |
| 243 | } |
| 244 | |
| 245 | } |