From 429d448ea60f4b2a3110d0b05e47755aeec18ebc Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 18 May 2013 12:23:26 +0200 Subject: settings: move tag out of tag --- system/settings/darwin.xml | 16 +- system/settings/settings.xml | 724 +++++++++++++++++++------------------------ xbmc/settings/Setting.cpp | 32 +- 3 files changed, 338 insertions(+), 434 deletions(-) diff --git a/system/settings/darwin.xml b/system/settings/darwin.xml index 5d7e9d9898..71d61de31e 100644 --- a/system/settings/darwin.xml +++ b/system/settings/darwin.xml @@ -37,11 +37,9 @@ 4 false - - - 0 - - + + 0 + 1 @@ -51,11 +49,11 @@ 50 1000 14046 - - 2 - - + + 2 + + diff --git a/system/settings/settings.xml b/system/settings/settings.xml index a53a61067c..798cca75f1 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -10,11 +10,10 @@ 0 - - - - - + + + + 1 @@ -77,11 +76,10 @@ 1 true - - - true - - + + true + + @@ -101,11 +99,10 @@ regions - - - - - + + + + 1 @@ -113,11 +110,10 @@ charsets - - - - - + + + + @@ -135,11 +131,10 @@ timezones - - - - - + + + + @@ -178,30 +173,26 @@ 1 false - - - - - - - - - - + + + + + + + + 1 true - - - - - - - - - - + + + + + + + + 1 @@ -222,24 +213,20 @@ 0 - - - - - - - - - - + + + + + + + + 0 - - - - - + + + 0 @@ -250,36 +237,31 @@ 60 14044 - - - - - + + + + 1 true - - - - - + + + 1 true - - - - - screensaver.xbmc.builtin.dim - - - - - + + + + screensaver.xbmc.builtin.dim + + + + @@ -438,11 +420,10 @@ refreshchangedelays - - - 0 - - + + 0 + + 2 @@ -458,11 +439,10 @@ - - - true - - + + true + + 4 @@ -472,16 +452,15 @@ 0.1 10.0 - - - - - true - 2 - - - - + + + + true + 2 + + + + 4 @@ -494,16 +473,15 @@ - - - - - true - 2 - - - - + + + + true + 2 + + + + 2 @@ -622,11 +600,10 @@ 2 74 - - - - - + + + + 1 @@ -639,11 +616,10 @@ - - - - - + + + + 1 @@ -660,11 +636,10 @@ - - - - - + + + + 1 @@ -672,11 +647,10 @@ charsets - - - - - + + + + 1 @@ -784,19 +758,15 @@ 1 - - - true - - + + true + 1 - - - true - - + + true + 2 @@ -848,11 +818,9 @@ 1 - - - true - - + + true + @@ -1087,11 +1055,10 @@ 1 true - - - true - - + + true + + 1 @@ -1102,11 +1069,10 @@ 1200 14045 - - - true - - + + true + + @@ -1232,15 +1198,13 @@ 1 true - - - - - 0 - - - - + + + + 0 + + + @@ -1352,16 +1316,15 @@ - - - - - 2 - 3 - - - - + + + + 2 + 3 + + + + 2 @@ -1372,17 +1335,16 @@ 320 14048 - - - - - 2 - 3 - 0 - - - - + + + + 2 + 3 + 0 + + + + 2 @@ -1392,11 +1354,10 @@ 1 8 - - - 3 - - + + 3 + + 1 @@ -1414,11 +1375,9 @@ 2 false - - - true - - + + true + @@ -1428,11 +1387,10 @@ fonts - - - true - - + + true + + 2 @@ -1442,12 +1400,11 @@ 2 74 - - - true - - - + + true + + + 2 @@ -1460,11 +1417,10 @@ - - - true - - + + true + + 2 @@ -1472,29 +1428,24 @@ charsets - - - true - - + + true + + 2 - - - true - - + + true + 2 - - - true - - + + true + @@ -1586,11 +1537,10 @@ 0 - - - - - + + + + @@ -1614,11 +1564,9 @@ 2 true - - - true - - + + true + 1 @@ -1651,21 +1599,19 @@ 2 xbmc true - - - true - - + + true + + 2 true - - - true - - + + true + + 1 @@ -1695,11 +1641,10 @@ 1 65535 - - - true - - + + true + + HAS_EVENT_SERVER @@ -1710,11 +1655,10 @@ 1 100 - - - true - - + + true + + HAS_EVENT_SERVER @@ -1725,20 +1669,17 @@ 1 100 - - - true - - + + true + + 1 false - - - true - - + + true + HAS_EVENT_SERVER @@ -1749,11 +1690,10 @@ 5 10000 - - - true - - + + true + + HAS_EVENT_SERVER @@ -1764,11 +1704,10 @@ 5 10000 - - - true - - + + true + + @@ -1791,21 +1730,18 @@ 1 false - - - true - - + + true + 1 true - - - true - - + + true + + @@ -1841,12 +1777,11 @@ resolutions - - - -1 - - - + + -1 + + + IsStandAlone @@ -1858,31 +1793,26 @@ - - - -1 - - - - + + -1 + + + + 2 true - - - -1 - - + + -1 + 1 false - - - - - + + + @@ -1959,76 +1889,64 @@ 2 true - - - - - 1 - 2 - - - - + + + + 1 + 2 + + + 2 true - - - - - 1 - 2 - - - - + + + + 1 + 2 + + + 2 false - - - - - 1 - 2 - - - - + + + + 1 + 2 + + + 2 true - - - 2 - - + + 2 + 2 true - - - 2 - - + + 2 + 2 true - - - - - true - 2 - - - - + + + + true + 2 + + + @@ -2046,16 +1964,15 @@ audiodevicespassthrough - - - - - 1 - 2 - - - - + + + + 1 + 2 + + + + @@ -2077,11 +1994,9 @@ 1 - - - - - + + + @@ -2118,21 +2033,19 @@ - - - true - - + + true + + 1 true - - - true - - + + true + + 1 @@ -2142,31 +2055,28 @@ 1 65535 - - - true - - + + true + + 1 true - - - true - - + + true + + 1 true - - - true - - + + true + + @@ -2231,11 +2141,9 @@ 1 - - - true - - + + true + 1 @@ -2257,11 +2165,9 @@ 2 false - - - 0 - - + + 0 + 4 diff --git a/xbmc/settings/Setting.cpp b/xbmc/settings/Setting.cpp index dc8bb65169..965dbc81cf 100644 --- a/xbmc/settings/Setting.cpp +++ b/xbmc/settings/Setting.cpp @@ -81,6 +81,22 @@ bool CSetting::Deserialize(const TiXmlNode *node, bool update /* = false */) if (m_level < (int)SettingLevelBasic || m_level > (int)SettingLevelInternal) m_level = SettingLevelStandard; + const TiXmlNode *dependencies = node->FirstChild("dependencies"); + if (dependencies != NULL) + { + const TiXmlNode *dependencyNode = dependencies->FirstChild("dependency"); + while (dependencyNode != NULL) + { + CSettingDependency dependency(m_settingsManager); + if (dependency.Deserialize(dependencyNode)) + m_dependencies.push_back(dependency); + else + CLog::Log(LOGWARNING, "CSetting: error reading tag of \"%s\"", m_id.c_str()); + + dependencyNode = dependencyNode->NextSibling("dependency"); + } + } + const TiXmlElement *control = node->FirstChildElement("control"); if (control != NULL) { @@ -90,22 +106,6 @@ bool CSetting::Deserialize(const TiXmlNode *node, bool update /* = false */) CLog::Log(LOGERROR, "CSetting: error reading tag of \"%s\"", m_id.c_str()); return false; } - - const TiXmlNode *dependencies = control->FirstChild("dependencies"); - if (dependencies != NULL) - { - const TiXmlNode *dependencyNode = dependencies->FirstChild("dependency"); - while (dependencyNode != NULL) - { - CSettingDependency dependency(m_settingsManager); - if (dependency.Deserialize(dependencyNode)) - m_dependencies.push_back(dependency); - else - CLog::Log(LOGWARNING, "CSetting: error reading tag of \"%s\"", m_id.c_str()); - - dependencyNode = dependencyNode->NextSibling("dependency"); - } - } } const TiXmlNode *updates = node->FirstChild("updates"); -- cgit v1.2.3 From bd525fac9251f042ebadbee2f9bb6437170f764f Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 18 May 2013 12:27:30 +0200 Subject: settings.xml: remove unneeded tags for action settings --- system/settings/settings.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/system/settings/settings.xml b/system/settings/settings.xml index 798cca75f1..b31ff40d69 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -13,7 +13,6 @@ - 1 @@ -1540,7 +1539,6 @@ - -- cgit v1.2.3 From 81474fdf5271ba1786f9aa049b1c5673ba1d310d Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 18 May 2013 12:40:36 +0200 Subject: settings: move tag into tag --- system/settings/settings.xml | 84 ++++++++++++++++++++++++++++++++------------ xbmc/settings/Setting.cpp | 26 +++++++------- 2 files changed, 75 insertions(+), 35 deletions(-) diff --git a/system/settings/settings.xml b/system/settings/settings.xml index b31ff40d69..7ce627e540 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -74,7 +74,9 @@ 1 - true + + true + true @@ -205,7 +207,9 @@ 0 screensaver.xbmc.builtin.dim xbmc.ui.screensaver - true + + true + @@ -660,9 +664,9 @@ 1 - true 657 + true false videos @@ -808,9 +812,9 @@ 1 - true 657 + true false @@ -1014,7 +1018,9 @@ 1 - true + + true + @@ -1053,7 +1059,9 @@ 1 - true + + true + true @@ -1211,7 +1219,9 @@ 0 visualization.glspectrum xbmc.player.musicviz - true + + true + @@ -1236,29 +1246,37 @@ 4 - true 16016 + + true + 4 - true 16016 + + true + 4 - true 16016 + + true + 4 - true 16016 + + true + @@ -1286,8 +1304,10 @@ 1 - true 657 + + true + @@ -1461,7 +1481,9 @@ 4 - true + + true + @@ -1532,7 +1554,9 @@ 0 weather.wunderground xbmc.python.weather - true + + true + 0 @@ -1596,7 +1620,9 @@ 2 xbmc - true + + true + true @@ -1605,7 +1631,9 @@ 2 - true + + true + true @@ -1735,7 +1763,9 @@ 1 - true + + true + true @@ -2039,7 +2069,9 @@ 1 - true + + true + true @@ -2061,7 +2093,9 @@ 1 - true + + true + true @@ -2070,7 +2104,9 @@ 1 - true + + true + true @@ -2146,8 +2182,10 @@ 1 - true 657 + + true + @@ -2307,7 +2345,9 @@ 4 - true + + true + diff --git a/xbmc/settings/Setting.cpp b/xbmc/settings/Setting.cpp index 965dbc81cf..c472ab2e02 100644 --- a/xbmc/settings/Setting.cpp +++ b/xbmc/settings/Setting.cpp @@ -792,25 +792,15 @@ bool CSettingString::Deserialize(const TiXmlNode *node, bool update /* = false * CLog::Log(LOGERROR, "CSettingString: invalid of \"%s\"", m_id.c_str()); return false; } - - // get allowempty (needs to be parsed before parsing the default value) - XMLUtils::GetBoolean(node, "allowempty", m_allowEmpty); // get heading XMLUtils::GetInt(node, "heading", m_heading); - - // get the default value - CStdString value; - if (XMLUtils::GetString(node, XML_ELM_DEFAULT, value)) - m_value = m_default = value; - else if (!update && !m_allowEmpty) - { - CLog::Log(LOGERROR, "CSettingString: error reading the default value of \"%s\"", m_id.c_str()); - return false; - } const TiXmlNode *constraints = node->FirstChild(XML_ELM_CONSTRAINTS); if (constraints != NULL) { + // get allowempty (needs to be parsed before parsing the default value) + XMLUtils::GetBoolean(constraints, "allowempty", m_allowEmpty); + // get the entries const TiXmlNode *options = constraints->FirstChild(XML_ELM_OPTIONS); if (options != NULL && options->FirstChild() != NULL && @@ -818,6 +808,16 @@ bool CSettingString::Deserialize(const TiXmlNode *node, bool update /* = false * m_optionsFiller = options->FirstChild()->ValueStr(); } + // get the default value + CStdString value; + if (XMLUtils::GetString(node, XML_ELM_DEFAULT, value)) + m_value = m_default = value; + else if (!update && !m_allowEmpty) + { + CLog::Log(LOGERROR, "CSettingString: error reading the default value of \"%s\"", m_id.c_str()); + return false; + } + return true; } -- cgit v1.2.3 From fe955c919c7d91b365ae868fefcb5ff5b8cc4b54 Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 18 May 2013 12:51:35 +0200 Subject: settings: move tag into tag --- system/settings/settings.xml | 34 ++++++++++++++++++++++++---------- xbmc/settings/SettingAddon.cpp | 18 +++++++++++------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/system/settings/settings.xml b/system/settings/settings.xml index 7ce627e540..49ee1f5fb8 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -6,7 +6,9 @@ 0 skin.confluence - xbmc.gui.skin + + xbmc.gui.skin + 0 @@ -206,8 +208,8 @@ 0 screensaver.xbmc.builtin.dim - xbmc.ui.screensaver + xbmc.ui.screensaver true @@ -718,17 +720,23 @@ 4 metadata.themoviedb.org - xbmc.metadata.scraper.movies + + xbmc.metadata.scraper.movies + 4 metadata.tvdb.com - xbmc.metadata.scraper.tvshows + + xbmc.metadata.scraper.tvshows + 4 metadata.musicvideos.theaudiodb.com - xbmc.metadata.scraper.musicvideos + + xbmc.metadata.scraper.musicvideos + @@ -1111,12 +1119,16 @@ 1 metadata.album.universal - xbmc.metadata.scraper.albums + + xbmc.metadata.scraper.albums + 1 metadata.artists.universal - xbmc.metadata.scraper.artists + + xbmc.metadata.scraper.artists + 1 @@ -1218,8 +1230,8 @@ 0 visualization.glspectrum - xbmc.player.musicviz + xbmc.player.musicviz true @@ -1553,8 +1565,8 @@ 0 weather.wunderground - xbmc.python.weather + xbmc.python.weather true @@ -1642,7 +1654,9 @@ 1 webinterface.default - xbmc.gui.webinterface + + xbmc.gui.webinterface + diff --git a/xbmc/settings/SettingAddon.cpp b/xbmc/settings/SettingAddon.cpp index bcf6dd38d6..4a60657350 100644 --- a/xbmc/settings/SettingAddon.cpp +++ b/xbmc/settings/SettingAddon.cpp @@ -68,15 +68,19 @@ bool CSettingAddon::Deserialize(const TiXmlNode *node, bool update /* = false */ CLog::Log(LOGERROR, "CSettingAddon: error reading the default value of \"%s\"", m_id.c_str()); return false; } - - // get the addon type + + bool ok = false; CStdString strAddonType; - bool ok = XMLUtils::GetString(node, "addontype", strAddonType); - if (ok) + const TiXmlNode *constraints = node->FirstChild("constraints"); + if (constraints != NULL) { - m_addonType = ADDON::TranslateType(strAddonType); - if (m_addonType == ADDON::ADDON_UNKNOWN) - ok = false; + // get the addon type + if (XMLUtils::GetString(constraints, "addontype", strAddonType)) + { + m_addonType = ADDON::TranslateType(strAddonType); + if (m_addonType != ADDON::ADDON_UNKNOWN) + ok = true; + } } if (!ok && !update) -- cgit v1.2.3 From 3345e0fc349316bd8c9b590e134165e8aae16fe4 Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 18 May 2013 13:07:16 +0200 Subject: settings: move tag into tag --- system/settings/settings.xml | 55 ++++++++++++++++++++++++++------------------ xbmc/settings/Setting.cpp | 9 ++++++-- 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/system/settings/settings.xml b/system/settings/settings.xml index 49ee1f5fb8..9227fc1e85 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -666,7 +666,6 @@ 1 - 657 true false @@ -674,7 +673,9 @@ videos - + + 657 + 1 @@ -820,12 +821,13 @@ 1 - 657 true false - + + 657 + 1 @@ -1246,50 +1248,56 @@ 2 [%N. ]%A - %T - 16016 - + + 16016 + 2 %D - 16016 - + + 16016 + 4 - 16016 true - + + 16016 + 4 - 16016 true - + + 16016 + 4 - 16016 true - + + 16016 + 4 - 16016 true - + + 16016 + 0 @@ -1316,17 +1324,19 @@ 1 - 657 true - + + 657 + 2 %A/%A - %B/[%N. ][%A - ]%T - 16016 - + + 16016 + 2 @@ -2196,11 +2206,12 @@ 1 - 657 true - + + 657 + diff --git a/xbmc/settings/Setting.cpp b/xbmc/settings/Setting.cpp index c472ab2e02..7db6e6a958 100644 --- a/xbmc/settings/Setting.cpp +++ b/xbmc/settings/Setting.cpp @@ -792,8 +792,13 @@ bool CSettingString::Deserialize(const TiXmlNode *node, bool update /* = false * CLog::Log(LOGERROR, "CSettingString: invalid of \"%s\"", m_id.c_str()); return false; } - // get heading - XMLUtils::GetInt(node, "heading", m_heading); + + const TiXmlNode *control = node->FirstChild("control"); + if (control != NULL) + { + // get heading + XMLUtils::GetInt(control, "heading", m_heading); + } const TiXmlNode *constraints = node->FirstChild(XML_ELM_CONSTRAINTS); if (constraints != NULL) -- cgit v1.2.3 From ee52d755c75017d97b2a6528f1fb2e6410550b92 Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 18 May 2013 13:29:33 +0200 Subject: settings: move tag into tag --- system/settings/darwin.xml | 5 +- system/settings/settings.xml | 170 ++++++++++++++++++++++++++----------------- xbmc/settings/Setting.cpp | 20 ++--- 3 files changed, 116 insertions(+), 79 deletions(-) diff --git a/system/settings/darwin.xml b/system/settings/darwin.xml index 71d61de31e..796df34119 100644 --- a/system/settings/darwin.xml +++ b/system/settings/darwin.xml @@ -48,12 +48,13 @@ 50 50 1000 - 14046 2 - + + 14046 + diff --git a/system/settings/settings.xml b/system/settings/settings.xml index 9227fc1e85..22c2072859 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -47,9 +47,10 @@ -20 2 20 - 14047 - + + 14047 + 0 @@ -240,12 +241,13 @@ 1 1 60 - 14044 - + + 14044 + @@ -363,9 +365,10 @@ 0 10 100 - 14047 - + + 14047 + HAVE_LIBVDPAU @@ -495,9 +498,10 @@ 0 1 20 - 14047 - + + 14047 + 1 @@ -812,9 +816,10 @@ 1 1 10 - 14045 - + + 14045 + @@ -857,9 +862,10 @@ 1 1 14 - 17999 - + + 17999 + @@ -870,9 +876,10 @@ 15 15 2880 - 14044 - + + 14044 + 1 @@ -921,9 +928,10 @@ 1 1 60 - 14045 - + + 14045 + 1 @@ -936,9 +944,10 @@ 0 250 10000 - 14046 - + + 14046 + @@ -951,9 +960,10 @@ 1 1 720 - 14044 - + + 14044 + 1 @@ -972,9 +982,10 @@ 1 1 365 - 17999 - + + 17999 + 1 @@ -983,9 +994,10 @@ 0 1 60 - 14044 - + + 14044 + 1 @@ -994,9 +1006,10 @@ 0 1 60 - 14044 - + + 14044 + @@ -1021,9 +1034,10 @@ 0 5 360 - 14044 - + + 14044 + 1 @@ -1040,9 +1054,10 @@ 0 1 60 - 14044 - + + 14044 + @@ -1084,12 +1099,13 @@ 5 5 1200 - 14045 true - + + 14045 + @@ -1184,9 +1200,10 @@ 77 1 101 - 14050 - + + 14050 + 2 @@ -1195,9 +1212,10 @@ 77 1 101 - 14050 - + + 14050 + 2 @@ -1212,9 +1230,10 @@ 0 1 15 - 14045 - + + 14045 + 1 @@ -1374,7 +1393,6 @@ 128 32 320 - 14048 @@ -1385,7 +1403,9 @@ - + + 14048 + 2 @@ -1549,9 +1569,10 @@ 1 1 100 - 14045 - + + 14045 + 0 @@ -2145,9 +2166,10 @@ 0 512 102400 - 14048 - + + 14048 + @@ -2160,9 +2182,10 @@ 0 5 120 - 14044 - + + 14044 + 2 @@ -2171,9 +2194,10 @@ 0 5 120 - 14044 - + + 14044 + 2 @@ -2252,9 +2276,10 @@ 0 256 4096 - 14049 - + + 14049 + @@ -2265,9 +2290,10 @@ 0 256 16384 - 14049 - + + 14049 + 4 @@ -2276,9 +2302,10 @@ 0 256 16384 - 14049 - + + 14049 + 4 @@ -2287,9 +2314,10 @@ 0 256 16384 - 14049 - + + 14049 + @@ -2300,9 +2328,10 @@ 0 256 4096 - 14049 - + + 14049 + 4 @@ -2311,9 +2340,10 @@ 0 256 4096 - 14049 - + + 14049 + 4 @@ -2322,9 +2352,10 @@ 0 256 4096 - 14049 - + + 14049 + @@ -2335,9 +2366,10 @@ 0 256 16384 - 14049 - + + 14049 + 4 @@ -2346,9 +2378,10 @@ 0 256 16384 - 14049 - + + 14049 + @@ -2359,9 +2392,10 @@ 0 256 16384 - 14049 - + + 14049 + diff --git a/xbmc/settings/Setting.cpp b/xbmc/settings/Setting.cpp index 7db6e6a958..ac0edf0d1a 100644 --- a/xbmc/settings/Setting.cpp +++ b/xbmc/settings/Setting.cpp @@ -409,6 +409,13 @@ bool CSettingInt::Deserialize(const TiXmlNode *node, bool update /* = false */) return false; } + if (m_control.GetFormat() == SettingControlFormatString) + { + const TiXmlNode *control = node->FirstChild("control"); + if (control != NULL) + XMLUtils::GetInt(control, "formatlabel", m_format); + } + const TiXmlNode *constraints = node->FirstChild(XML_ELM_CONSTRAINTS); if (constraints != NULL) { @@ -449,16 +456,11 @@ bool CSettingInt::Deserialize(const TiXmlNode *node, bool update /* = false */) // get maximum XMLUtils::GetInt(constraints, XML_ELM_MAXIMUM, m_max); - if (m_control.GetFormat() == SettingControlFormatString) + if (m_control.GetFormat() == SettingControlFormatString && m_labelMin < 0) { - XMLUtils::GetInt(constraints, "formatlabel", m_format); - - if (m_labelMin < 0) - { - CStdString strFormat; - if (XMLUtils::GetString(constraints, "format", strFormat) && !strFormat.empty()) - m_strFormat = strFormat; - } + CStdString strFormat; + if (XMLUtils::GetString(constraints, "format", strFormat) && !strFormat.empty()) + m_strFormat = strFormat; } } -- cgit v1.2.3 From 9cb2cdcfd058dc61da74ee20adf9032e86f1a46c Mon Sep 17 00:00:00 2001 From: montellese Date: Sat, 18 May 2013 13:30:27 +0200 Subject: settings: use #define for XML tag parsing --- xbmc/settings/Setting.cpp | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/xbmc/settings/Setting.cpp b/xbmc/settings/Setting.cpp index ac0edf0d1a..41b026155b 100644 --- a/xbmc/settings/Setting.cpp +++ b/xbmc/settings/Setting.cpp @@ -31,11 +31,17 @@ #define XML_ELM_DEFAULT "default" #define XML_ELM_VALUE "value" -#define XML_ELM_CONSTRAINTS "constraints" -#define XML_ELM_OPTIONS "options" -#define XML_ELM_MINIMUM "minimum" -#define XML_ELM_STEP "step" -#define XML_ELM_MAXIMUM "maximum" +#define XML_ELM_CONTROL "control" +#define XML_ELM_CONSTRAINTS "constraints" +#define XML_ELM_OPTIONS "options" +#define XML_ELM_OPTION "option" +#define XML_ELM_MINIMUM "minimum" +#define XML_ELM_STEP "step" +#define XML_ELM_MAXIMUM "maximum" +#define XML_ELM_DEPENDENCIES "dependencies" +#define XML_ELM_DEPENDENCY "dependency" +#define XML_ELM_UPDATES "updates" +#define XML_ELM_UPDATE "update" CSetting::CSetting(const std::string &id, CSettingsManager *settingsManager /* = NULL */) : ISetting(id, settingsManager), @@ -81,10 +87,10 @@ bool CSetting::Deserialize(const TiXmlNode *node, bool update /* = false */) if (m_level < (int)SettingLevelBasic || m_level > (int)SettingLevelInternal) m_level = SettingLevelStandard; - const TiXmlNode *dependencies = node->FirstChild("dependencies"); + const TiXmlNode *dependencies = node->FirstChild(XML_ELM_DEPENDENCIES); if (dependencies != NULL) { - const TiXmlNode *dependencyNode = dependencies->FirstChild("dependency"); + const TiXmlNode *dependencyNode = dependencies->FirstChild(XML_ELM_DEPENDENCY); while (dependencyNode != NULL) { CSettingDependency dependency(m_settingsManager); @@ -93,11 +99,11 @@ bool CSetting::Deserialize(const TiXmlNode *node, bool update /* = false */) else CLog::Log(LOGWARNING, "CSetting: error reading tag of \"%s\"", m_id.c_str()); - dependencyNode = dependencyNode->NextSibling("dependency"); + dependencyNode = dependencyNode->NextSibling(XML_ELM_DEPENDENCY); } } - const TiXmlElement *control = node->FirstChildElement("control"); + const TiXmlElement *control = node->FirstChildElement(XML_ELM_CONTROL); if (control != NULL) { if (!m_control.Deserialize(control, update) || @@ -108,10 +114,10 @@ bool CSetting::Deserialize(const TiXmlNode *node, bool update /* = false */) } } - const TiXmlNode *updates = node->FirstChild("updates"); + const TiXmlNode *updates = node->FirstChild(XML_ELM_UPDATES); if (updates != NULL) { - const TiXmlElement *updateElem = updates->FirstChildElement("update"); + const TiXmlElement *updateElem = updates->FirstChildElement(XML_ELM_UPDATE); while (updateElem != NULL) { CSettingUpdate update; @@ -123,7 +129,7 @@ bool CSetting::Deserialize(const TiXmlNode *node, bool update /* = false */) else CLog::Log(LOGWARNING, "CSetting: error reading tag of \"%s\"", m_id.c_str()); - updateElem = updateElem->NextSiblingElement("update"); + updateElem = updateElem->NextSiblingElement(XML_ELM_UPDATE); } } @@ -411,7 +417,7 @@ bool CSettingInt::Deserialize(const TiXmlNode *node, bool update /* = false */) if (m_control.GetFormat() == SettingControlFormatString) { - const TiXmlNode *control = node->FirstChild("control"); + const TiXmlNode *control = node->FirstChild(XML_ELM_CONTROL); if (control != NULL) XMLUtils::GetInt(control, "formatlabel", m_format); } @@ -428,7 +434,7 @@ bool CSettingInt::Deserialize(const TiXmlNode *node, bool update /* = false */) else { m_options.clear(); - const TiXmlElement *optionElement = options->FirstChildElement("option"); + const TiXmlElement *optionElement = options->FirstChildElement(XML_ELM_OPTION); while (optionElement != NULL) { std::pair entry; @@ -438,7 +444,7 @@ bool CSettingInt::Deserialize(const TiXmlNode *node, bool update /* = false */) m_options.push_back(entry); } - optionElement = optionElement->NextSiblingElement("option"); + optionElement = optionElement->NextSiblingElement(XML_ELM_OPTION); } } } @@ -795,7 +801,7 @@ bool CSettingString::Deserialize(const TiXmlNode *node, bool update /* = false * return false; } - const TiXmlNode *control = node->FirstChild("control"); + const TiXmlNode *control = node->FirstChild(XML_ELM_CONTROL); if (control != NULL) { // get heading -- cgit v1.2.3