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:
@ -39,7 +39,8 @@ std::unordered_map<std::wstring, std::wstring> CConfigParser::c_MonitorVariables
|
||||
CConfigParser::CConfigParser() :
|
||||
m_Parser(MathParser_Create(NULL)),
|
||||
m_LastReplaced(false),
|
||||
m_LastDefaultUsed(false)
|
||||
m_LastDefaultUsed(false),
|
||||
m_LastValueDefined(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -71,6 +72,12 @@ void CConfigParser::Initialize(LPCTSTR filename, CRainmeter* pRainmeter, CMeterW
|
||||
m_FoundSections.clear();
|
||||
m_ListVariables.clear();
|
||||
|
||||
m_StyleTemplate.clear();
|
||||
m_LastUsedStyle.clear();
|
||||
m_LastReplaced = false;
|
||||
m_LastDefaultUsed = false;
|
||||
m_LastValueDefined = false;
|
||||
|
||||
// Set the built-in variables. Do this before the ini file is read so that the paths can be used with @include
|
||||
SetBuiltInVariables(pRainmeter, meterWindow);
|
||||
ResetMonitorVariables(meterWindow);
|
||||
@ -580,6 +587,7 @@ const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCT
|
||||
m_LastUsedStyle.clear();
|
||||
m_LastReplaced = false;
|
||||
m_LastDefaultUsed = false;
|
||||
m_LastValueDefined = false;
|
||||
|
||||
const std::wstring strSection = section;
|
||||
const std::wstring strKey = key;
|
||||
@ -634,19 +642,24 @@ const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCT
|
||||
}
|
||||
}
|
||||
|
||||
const std::wstring CURRENTSECTION = L"CURRENTSECTION";
|
||||
SetBuiltInVariable(CURRENTSECTION, strSection); // Set temporarily
|
||||
|
||||
if (ReplaceVariables(result))
|
||||
if (result.size() > 0)
|
||||
{
|
||||
m_LastReplaced = true;
|
||||
}
|
||||
m_LastValueDefined = true;
|
||||
|
||||
SetBuiltInVariable(CURRENTSECTION, L""); // Reset
|
||||
const std::wstring CURRENTSECTION = L"CURRENTSECTION";
|
||||
SetBuiltInVariable(CURRENTSECTION, strSection); // Set temporarily
|
||||
|
||||
if (bReplaceMeasures && ReplaceMeasures(result))
|
||||
{
|
||||
m_LastReplaced = true;
|
||||
if (ReplaceVariables(result))
|
||||
{
|
||||
m_LastReplaced = true;
|
||||
}
|
||||
|
||||
SetBuiltInVariable(CURRENTSECTION, L""); // Reset
|
||||
|
||||
if (bReplaceMeasures && ReplaceMeasures(result))
|
||||
{
|
||||
m_LastReplaced = true;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user