示例#1
0
文件: Setting.cpp 项目: B0k0/xbmc
bool CSetting::IsEnabled() const
{
    if (m_dependencies.empty() && m_parentSetting.empty())
        return m_enabled;

    // if the setting has a parent setting and that parent setting is disabled
    // the setting should automatically also be disabled
    if (!m_parentSetting.empty())
    {
        CSetting *parentSetting = m_settingsManager->GetSetting(m_parentSetting);
        if (parentSetting != NULL && !parentSetting->IsEnabled())
            return false;
    }

    bool enabled = true;
    for (SettingDependencies::const_iterator depIt = m_dependencies.begin(); depIt != m_dependencies.end(); ++depIt)
    {
        if (depIt->GetType() != SettingDependencyTypeEnable)
            continue;

        if (!depIt->Check())
        {
            enabled = false;
            break;
        }
    }

    return enabled;
}
示例#2
0
bool CSetting::IsEnabled() const
{
  bool enabled = true;
  for (SettingDependencies::const_iterator depIt = m_dependencies.begin(); depIt != m_dependencies.end(); ++depIt)
  {
    if (depIt->GetType() != SettingDependencyTypeEnable)
      continue;

    if (!depIt->Check())
    {
      enabled = false;
      break;
    }
  }

  return enabled;
}
示例#3
0
bool CSetting::IsVisible() const
{
  if (!ISetting::IsVisible())
    return false;

  bool visible = true;
  for (SettingDependencies::const_iterator depIt = m_dependencies.begin(); depIt != m_dependencies.end(); ++depIt)
  {
    if (depIt->GetType() != SettingDependencyTypeVisible)
      continue;

    if (!depIt->Check())
    {
      visible = false;
      break;
    }
  }

  return visible;
}