mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Code cleanup
This commit is contained in:
parent
05f411c579
commit
66c3231b90
@ -2119,10 +2119,10 @@ bool CMeterWindow::ReadSkin()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create all meters and measures.
|
// Create all meters and measures.
|
||||||
std::list<CMeter*> meters;
|
m_HasNetMeasures = false;
|
||||||
std::list<CMeasure*> measures;
|
m_HasButtons = false;
|
||||||
std::list<std::wstring>::const_iterator iter = m_Parser.GetSections().begin();
|
CMeter* prevMeter = NULL;
|
||||||
for ( ; iter != m_Parser.GetSections().end(); ++iter)
|
for (auto iter = m_Parser.GetSections().cbegin(); iter != m_Parser.GetSections().cend(); ++iter)
|
||||||
{
|
{
|
||||||
const WCHAR* section = (*iter).c_str();
|
const WCHAR* section = (*iter).c_str();
|
||||||
|
|
||||||
@ -2136,7 +2136,13 @@ bool CMeterWindow::ReadSkin()
|
|||||||
CMeasure* measure = CMeasure::Create(measureName.c_str(), this, section);
|
CMeasure* measure = CMeasure::Create(measureName.c_str(), this, section);
|
||||||
if (measure)
|
if (measure)
|
||||||
{
|
{
|
||||||
measures.push_back(measure);
|
m_Measures.push_back(measure);
|
||||||
|
m_Parser.AddMeasure(measure);
|
||||||
|
|
||||||
|
if (measure->GetTypeID() == TypeID<CMeasureNet>())
|
||||||
|
{
|
||||||
|
m_HasNetMeasures = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@ -2149,37 +2155,6 @@ bool CMeterWindow::ReadSkin()
|
|||||||
CMeter* meter = CMeter::Create(meterName.c_str(), this, section);
|
CMeter* meter = CMeter::Create(meterName.c_str(), this, section);
|
||||||
if (meter)
|
if (meter)
|
||||||
{
|
{
|
||||||
meters.push_back(meter);
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_HasNetMeasures = false;
|
|
||||||
m_HasButtons = false;
|
|
||||||
|
|
||||||
// Add measures to containers.
|
|
||||||
m_Measures.reserve(measures.size());
|
|
||||||
for (auto iter = measures.cbegin(); iter != measures.cend(); ++iter)
|
|
||||||
{
|
|
||||||
CMeasure* measure = *iter;
|
|
||||||
m_Measures.push_back(measure);
|
|
||||||
m_Parser.AddMeasure(measure);
|
|
||||||
|
|
||||||
if (measure->GetTypeID() == TypeID<CMeasureNet>())
|
|
||||||
{
|
|
||||||
m_HasNetMeasures = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize meters.
|
|
||||||
m_Meters.reserve(meters.size());
|
|
||||||
CMeter* prevMeter = NULL;
|
|
||||||
for (auto iter = meters.cbegin(); iter != meters.cend(); ++iter)
|
|
||||||
{
|
|
||||||
CMeter* meter = *iter;
|
|
||||||
m_Meters.push_back(meter);
|
m_Meters.push_back(meter);
|
||||||
meter->SetRelativeMeter(prevMeter);
|
meter->SetRelativeMeter(prevMeter);
|
||||||
|
|
||||||
@ -2191,9 +2166,14 @@ bool CMeterWindow::ReadSkin()
|
|||||||
prevMeter = meter;
|
prevMeter = meter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize meters. Separate loop to avoid errors caused with section
|
// Initialize meters. Separate loop to avoid errors caused with section
|
||||||
// variables for nonexistent measures/meters.
|
// variables for nonexistent measures/meters.
|
||||||
for (auto iter = meters.cbegin(); iter != meters.cend(); ++iter)
|
for (auto iter = m_Meters.cbegin(); iter != m_Meters.cend(); ++iter)
|
||||||
{
|
{
|
||||||
CMeter* meter = *iter;
|
CMeter* meter = *iter;
|
||||||
meter->ReadOptions(m_Parser);
|
meter->ReadOptions(m_Parser);
|
||||||
@ -2207,7 +2187,7 @@ bool CMeterWindow::ReadSkin()
|
|||||||
|
|
||||||
// Initialize measures. Separate loop to avoid errors caused by
|
// Initialize measures. Separate loop to avoid errors caused by
|
||||||
// referencing nonexistent [measures] in the measure options.
|
// referencing nonexistent [measures] in the measure options.
|
||||||
for (auto iter = measures.cbegin(); iter != measures.cend(); ++iter)
|
for (auto iter = m_Measures.cbegin(); iter != m_Measures.cend(); ++iter)
|
||||||
{
|
{
|
||||||
CMeasure* measure = *iter;
|
CMeasure* measure = *iter;
|
||||||
measure->ReadOptions(m_Parser);
|
measure->ReadOptions(m_Parser);
|
||||||
|
Loading…
Reference in New Issue
Block a user