ConfigParser: Implement ReadBool

This may break backwards compatibility in some cases. For example, the FreeDiskSpace measure treated only `Type=1` as true and `Type={0, 2, 3, ...}` as false. Now `Type=0` is false and everything else is true like with most other boolean options.
This commit is contained in:
Birunthan Mohanathas
2013-07-31 13:36:53 +03:00
parent 6b8d8a65d0
commit 923215c0da
23 changed files with 59 additions and 58 deletions

View File

@ -331,7 +331,7 @@ void Meter::ReadOptions(ConfigParser& parser, const WCHAR* section)
}
bool oldHidden = m_Hidden;
m_Hidden = 0!=parser.ReadInt(section, L"Hidden", 0);
m_Hidden = parser.ReadBool(section, L"Hidden", false);
if (oldX != m_X || oldY != m_Y || oldHidden != m_Hidden)
{
@ -351,10 +351,10 @@ void Meter::ReadOptions(ConfigParser& parser, const WCHAR* section)
m_ToolTipTitle = parser.ReadString(section, L"ToolTipTitle", L"");
m_ToolTipIcon = parser.ReadString(section, L"ToolTipIcon", L"");
m_ToolTipWidth = parser.ReadInt(section, L"ToolTipWidth", 1000);
m_ToolTipType = 0!=parser.ReadInt(section, L"ToolTipType", 0);
m_ToolTipHidden = 0!=parser.ReadInt(section, L"ToolTipHidden", m_MeterWindow->GetMeterToolTipHidden());
m_ToolTipType = parser.ReadBool(section, L"ToolTipType", false);
m_ToolTipHidden = parser.ReadBool(section, L"ToolTipHidden", m_MeterWindow->GetMeterToolTipHidden());
m_AntiAlias = 0!=parser.ReadInt(section, L"AntiAlias", 0);
m_AntiAlias = parser.ReadBool(section, L"AntiAlias", false);
std::vector<Gdiplus::REAL> matrix = parser.ReadFloats(section, L"TransformationMatrix");
if (matrix.size() == 6)