Additional change for r852,r856. Improved reading the network statistics from Rainmeter.stats.

Some cosmetic changes.
This commit is contained in:
spx
2011-07-08 22:50:02 +00:00
parent 6c0ea88266
commit c2e3b6292d
4 changed files with 19 additions and 7 deletions

View File

@ -744,6 +744,13 @@ int CConfigParser::ReadInt(LPCTSTR section, LPCTSTR key, int defValue)
return (m_LastDefaultUsed) ? defValue : (int)ParseDouble(result, defValue, true);
}
unsigned int CConfigParser::ReadUInt(LPCTSTR section, LPCTSTR key, unsigned int defValue)
{
const std::wstring& result = ReadString(section, key, L"");
return (m_LastDefaultUsed) ? defValue : (unsigned int)ParseDouble(result, defValue, true);
}
// Works as ReadFloat except if the value is surrounded by parenthesis in which case it tries to evaluate the formula
double CConfigParser::ReadFormula(LPCTSTR section, LPCTSTR key, double defValue)
{
@ -1056,7 +1063,7 @@ void CConfigParser::ReadIniFile(const std::vector<std::wstring>& iniFileMappings
while (true)
{
items[0] = 0;
DWORD res = GetPrivateProfileString(NULL, NULL, NULL, items, itemsSize, iniRead.c_str());
DWORD res = GetPrivateProfileSectionNames(items, itemsSize, iniRead.c_str());
if (res == 0) // File not found
{
delete [] items;