settings: add GetSections() to CSettingsManager
authormontellese <montellese@xbmc.org>
Mon, 28 Oct 2013 13:41:20 +0000 (14:41 +0100)
committermontellese <montellese@xbmc.org>
Mon, 11 Nov 2013 19:32:28 +0000 (20:32 +0100)
xbmc/settings/SettingsManager.cpp
xbmc/settings/SettingsManager.h

index 6e3f105..b2255cb 100644 (file)
@@ -450,6 +450,16 @@ CSetting* CSettingsManager::GetSetting(const std::string &id) const
   return NULL;
 }
 
+std::vector<CSettingSection*> CSettingsManager::GetSections() const
+{
+  CSharedLock lock(m_critical);
+  std::vector<CSettingSection*> sections;
+  for (SettingSectionMap::const_iterator sectionIt = m_sections.begin(); sectionIt != m_sections.end(); ++sectionIt)
+    sections.push_back(sectionIt->second);
+
+  return sections;
+}
+
 CSettingSection* CSettingsManager::GetSection(const std::string &section) const
 {
   CSharedLock lock(m_critical);
index c8c8aec..ee6c774 100644 (file)
@@ -234,6 +234,12 @@ public:
    */
   CSetting* GetSetting(const std::string &id) const;
   /*!
+   \brief Gets the full list of setting sections.
+
+   \return List of setting sections
+   */
+  std::vector<CSettingSection*> GetSections() const;
+  /*!
    \brief Gets the setting section with the given identifier.
 
    \param section Setting section identifier