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

@ -584,7 +584,11 @@ void CMeasureNet::ResetStats()
void CMeasureNet::ReadStats(const WCHAR* iniFile)
{
WCHAR buffer[64];
int count = GetPrivateProfileInt(L"Statistics", L"NetStatsCount", 0, iniFile);
CConfigParser parser;
parser.Initialize(iniFile, NULL, NULL, L"Statistics");
int count = parser.ReadInt(L"Statistics", L"NetStatsCount", 0);
c_StatValues.clear();
@ -593,18 +597,18 @@ void CMeasureNet::ReadStats(const WCHAR* iniFile)
ULARGE_INTEGER value;
_snwprintf_s(buffer, _TRUNCATE, L"NetStatsInHigh%i", i);
value.HighPart = (DWORD)GetPrivateProfileInt(L"Statistics", buffer, 0, iniFile);
value.HighPart = (DWORD)parser.ReadUInt(L"Statistics", buffer, 0);
_snwprintf_s(buffer, _TRUNCATE, L"NetStatsInLow%i", i);
value.LowPart = (DWORD)GetPrivateProfileInt(L"Statistics", buffer, 0, iniFile);
value.LowPart = (DWORD)parser.ReadUInt(L"Statistics", buffer, 0);
c_StatValues.push_back(value.QuadPart);
_snwprintf_s(buffer, _TRUNCATE, L"NetStatsOutHigh%i", i);
value.HighPart = (DWORD)GetPrivateProfileInt(L"Statistics", buffer, 0, iniFile);
value.HighPart = (DWORD)parser.ReadUInt(L"Statistics", buffer, 0);
_snwprintf_s(buffer, _TRUNCATE, L"NetStatsOutLow%i", i);
value.LowPart = (DWORD)GetPrivateProfileInt(L"Statistics", buffer, 0, iniFile);
value.LowPart = (DWORD)parser.ReadUInt(L"Statistics", buffer, 0);
c_StatValues.push_back(value.QuadPart);
}